]> Creatis software - cpPlugins.git/commitdiff
First dump for version 0.1.0
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 8 Mar 2016 22:44:02 +0000 (17:44 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 8 Mar 2016 22:44:02 +0000 (17:44 -0500)
250 files changed:
CMakeLists.txt
appli/CMakeLists.txt [new file with mode: 0644]
appli/PipelineEditor/CMakeLists.txt [new file with mode: 0644]
appli/PipelineEditor/PipelineEditor.cxx [new file with mode: 0644]
appli/PipelineEditor/PipelineEditor.h [new file with mode: 0644]
appli/PipelineEditor/PipelineEditor.ui [new file with mode: 0644]
appli/PipelineEditor/main.cxx [new file with mode: 0644]
appli/bash/CMakeLists.txt [new file with mode: 0644]
appli/bash/cpPlugins_HostCreator.cxx [new file with mode: 0644]
appli/examples/CMakeLists.txt [new file with mode: 0644]
appli/examples/example_LoadPluginsFile.cxx [new file with mode: 0644]
appli/examples/example_ReadWriteImage.cxx [new file with mode: 0644]
appli/examples/example_ReadWriteImageWithWorkspace.cxx [new file with mode: 0644]
cmake/CMakeLists.txt [new file with mode: 0644]
cmake/cpPlugins_KitwareTools.cmake [new file with mode: 0644]
cmake/cpPlugins_Options.cmake [new file with mode: 0644]
cmake/cpPlugins_Policies.cmake [new file with mode: 0644]
cmake/cpPlugins_Qt4Tools.cmake [new file with mode: 0644]
doc/third_party/Pluma/build/Doxyfile [deleted file]
doc/third_party/Pluma/build/Doxygen.hpp [deleted file]
doc/third_party/Pluma/build/doxygen.css [deleted file]
doc/third_party/Pluma/build/footer.htm [deleted file]
doc/third_party/Pluma/build/header.htm [deleted file]
doc/third_party/Pluma/html/Config_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/Connector_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/DLibrary_8cpp_source.htm [deleted file]
doc/third_party/Pluma/html/DLibrary_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/Dir_8cpp_source.htm [deleted file]
doc/third_party/Pluma/html/Dir_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/Doxygen_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/Host_8cpp_source.htm [deleted file]
doc/third_party/Pluma/html/Host_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/PluginManager_8cpp_source.htm [deleted file]
doc/third_party/Pluma/html/PluginManager_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/Pluma_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/Pluma_8inl_source.htm [deleted file]
doc/third_party/Pluma/html/Provider_8cpp_source.htm [deleted file]
doc/third_party/Pluma/html/Provider_8hpp_source.htm [deleted file]
doc/third_party/Pluma/html/annotated.htm [deleted file]
doc/third_party/Pluma/html/bc_s.png [deleted file]
doc/third_party/Pluma/html/bdwn.png [deleted file]
doc/third_party/Pluma/html/classes.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1DLibrary-members.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1DLibrary.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Host-members.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Host.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1PluginManager-members.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1PluginManager.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1PluginManager.png [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Pluma-members.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Pluma.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Pluma.png [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Provider-members.htm [deleted file]
doc/third_party/Pluma/html/classpluma_1_1Provider.htm [deleted file]
doc/third_party/Pluma/html/closed.png [deleted file]
doc/third_party/Pluma/html/doxygen.css [deleted file]
doc/third_party/Pluma/html/doxygen.png [deleted file]
doc/third_party/Pluma/html/dynsections.js [deleted file]
doc/third_party/Pluma/html/files.htm [deleted file]
doc/third_party/Pluma/html/ftv2blank.png [deleted file]
doc/third_party/Pluma/html/ftv2cl.png [deleted file]
doc/third_party/Pluma/html/ftv2doc.png [deleted file]
doc/third_party/Pluma/html/ftv2folderclosed.png [deleted file]
doc/third_party/Pluma/html/ftv2folderopen.png [deleted file]
doc/third_party/Pluma/html/ftv2lastnode.png [deleted file]
doc/third_party/Pluma/html/ftv2link.png [deleted file]
doc/third_party/Pluma/html/ftv2mlastnode.png [deleted file]
doc/third_party/Pluma/html/ftv2mnode.png [deleted file]
doc/third_party/Pluma/html/ftv2mo.png [deleted file]
doc/third_party/Pluma/html/ftv2node.png [deleted file]
doc/third_party/Pluma/html/ftv2ns.png [deleted file]
doc/third_party/Pluma/html/ftv2plastnode.png [deleted file]
doc/third_party/Pluma/html/ftv2pnode.png [deleted file]
doc/third_party/Pluma/html/ftv2splitbar.png [deleted file]
doc/third_party/Pluma/html/ftv2vertline.png [deleted file]
doc/third_party/Pluma/html/functions.htm [deleted file]
doc/third_party/Pluma/html/functions_func.htm [deleted file]
doc/third_party/Pluma/html/hierarchy.htm [deleted file]
doc/third_party/Pluma/html/index.htm [deleted file]
doc/third_party/Pluma/html/logo.png [deleted file]
doc/third_party/Pluma/html/nav_f.png [deleted file]
doc/third_party/Pluma/html/nav_g.png [deleted file]
doc/third_party/Pluma/html/nav_h.png [deleted file]
doc/third_party/Pluma/html/open.png [deleted file]
doc/third_party/Pluma/html/sync_off.png [deleted file]
doc/third_party/Pluma/html/sync_on.png [deleted file]
doc/third_party/Pluma/html/tab_a.png [deleted file]
doc/third_party/Pluma/html/tab_b.png [deleted file]
doc/third_party/Pluma/html/tab_h.png [deleted file]
doc/third_party/Pluma/html/tab_s.png [deleted file]
doc/third_party/Pluma/html/tabs.css [deleted file]
lib/CMakeLists.txt [new file with mode: 0644]
lib/ItkVtkGlue/CMakeLists.txt [new file with mode: 0644]
lib/ItkVtkGlue/itkImageToVTKImageFilter.h [new file with mode: 0644]
lib/ItkVtkGlue/itkImageToVTKImageFilter.hxx [new file with mode: 0644]
lib/ItkVtkGlue/itkVTKImageToImageFilter.h [new file with mode: 0644]
lib/ItkVtkGlue/itkVTKImageToImageFilter.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/BezierCurveFunction.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/BezierCurveFunction.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/GradientFunctionBase.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/GradientFunctionBase.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/GulsunTekMedialness.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/GulsunTekMedialness.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/ImageFunctionFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/ImageFunctorFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/InertiaMedialness.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/InertiaTensorFunction.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/IsoImageSlicer.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/IsoImageSlicer.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/IterativeGaussianModelEstimator.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/IterativeGaussianModelEstimator.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanConstantFilter.cxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanConstantFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanFilter.cxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanFilter.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanVelocityFilter.cxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/KalmanVelocityFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/LightCompensationFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/LightCompensationFilter.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/MacheteImageFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/MacheteImageFilter.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/ParallelImageMean.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/ParallelImageMean.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/RGBExtractFunction.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.hxx [new file with mode: 0644]
lib/cpExtensions/Algorithms/RGBToHSVFunction.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/RGBToYPbPrFunction.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx [new file with mode: 0644]
lib/cpExtensions/CMakeLists.txt [new file with mode: 0644]
lib/cpExtensions/Config.h.in [new file with mode: 0644]
lib/cpExtensions/DataStructures/Graph.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/Graph.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/ITKAndVTKImage.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdge.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdge.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdgeCell.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdgeCell.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdgeIterators.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdgeIterators.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdgeMesh.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/QuadEdgeMesh.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/VectorValuesContainer.h [new file with mode: 0644]
lib/cpExtensions/IO/MementoState.cxx [new file with mode: 0644]
lib/cpExtensions/IO/MementoState.h [new file with mode: 0644]
lib/cpExtensions/IO/MeshReader.h [new file with mode: 0644]
lib/cpExtensions/IO/MeshReader.hxx [new file with mode: 0644]
lib/cpExtensions/IO/WaveFrontOBJReader.h [new file with mode: 0644]
lib/cpExtensions/IO/WaveFrontOBJReader.hxx [new file with mode: 0644]
lib/cpExtensions/Interaction/BaseInteractorStyle.cxx [new file with mode: 0644]
lib/cpExtensions/Interaction/BaseInteractorStyle.h [new file with mode: 0644]
lib/cpExtensions/Interaction/ImageInteractorStyle.cxx [new file with mode: 0644]
lib/cpExtensions/Interaction/ImageInteractorStyle.h [new file with mode: 0644]
lib/cpExtensions/Interaction/SeedWidget.cxx [new file with mode: 0644]
lib/cpExtensions/Interaction/SeedWidget.h [new file with mode: 0644]
lib/cpExtensions/Interaction/SphereWidget.cxx [new file with mode: 0644]
lib/cpExtensions/Interaction/SphereWidget.h [new file with mode: 0644]
lib/cpExtensions/QT/SimpleMPRWidget.cxx [new file with mode: 0644]
lib/cpExtensions/QT/SimpleMPRWidget.h [new file with mode: 0644]
lib/cpExtensions/QT/SimpleMPRWidget.ui [new file with mode: 0644]
lib/cpExtensions/Visualization/Image3DMPR.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/Image3DMPR.h [new file with mode: 0644]
lib/cpExtensions/Visualization/ImageBlender.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/ImageBlender.h [new file with mode: 0644]
lib/cpExtensions/Visualization/ImageSliceActors.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/ImageSliceActors.h [new file with mode: 0644]
lib/cpExtensions/Visualization/MPRActors.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/MPRActors.h [new file with mode: 0644]
lib/cpExtensions/Visualization/MPRObjects.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/MPRObjects.h [new file with mode: 0644]
lib/cpExtensions/Visualization/MeshMapper.h [new file with mode: 0644]
lib/cpExtensions/Visualization/MeshMapper.hxx [new file with mode: 0644]
lib/cpExtensions/Visualization/OpenGLMeshMapper.h [new file with mode: 0644]
lib/cpExtensions/Visualization/OpenGLMeshMapper.hxx [new file with mode: 0644]
lib/cpExtensions/Visualization/SeedWidgetCorrector.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/SeedWidgetCorrector.h [new file with mode: 0644]
lib/cpPipelineEditor/Block.cxx [new file with mode: 0644]
lib/cpPipelineEditor/Block.h [new file with mode: 0644]
lib/cpPipelineEditor/CMakeLists.txt [new file with mode: 0644]
lib/cpPipelineEditor/Canvas.cxx [new file with mode: 0644]
lib/cpPipelineEditor/Canvas.h [new file with mode: 0644]
lib/cpPipelineEditor/Connection.cxx [new file with mode: 0644]
lib/cpPipelineEditor/Connection.h [new file with mode: 0644]
lib/cpPipelineEditor/Editor.cxx [new file with mode: 0644]
lib/cpPipelineEditor/Editor.h [new file with mode: 0644]
lib/cpPipelineEditor/Port.cxx [new file with mode: 0644]
lib/cpPipelineEditor/Port.h [new file with mode: 0644]
lib/cpPlugins/BaseWidget.cxx [new file with mode: 0644]
lib/cpPlugins/BaseWidget.h [new file with mode: 0644]
lib/cpPlugins/CMakeLists.txt [new file with mode: 0644]
lib/cpPlugins/Config.h.in [new file with mode: 0644]
lib/cpPlugins/DataObject.cxx [new file with mode: 0644]
lib/cpPlugins/DataObject.h [new file with mode: 0644]
lib/cpPlugins/Image.cxx [new file with mode: 0644]
lib/cpPlugins/Image.h [new file with mode: 0644]
lib/cpPlugins/Image.hxx [new file with mode: 0644]
lib/cpPlugins/Interface.cxx [new file with mode: 0644]
lib/cpPlugins/Interface.h [new file with mode: 0644]
lib/cpPlugins/Object.cxx [new file with mode: 0644]
lib/cpPlugins/Object.h [new file with mode: 0644]
lib/cpPlugins/Object.hxx [new file with mode: 0644]
lib/cpPlugins/Parameters.cxx [new file with mode: 0644]
lib/cpPlugins/Parameters.h [new file with mode: 0644]
lib/cpPlugins/ParametersQtDialog.cxx [new file with mode: 0644]
lib/cpPlugins/ParametersQtDialog.h [new file with mode: 0644]
lib/cpPlugins/Port.cxx [new file with mode: 0644]
lib/cpPlugins/Port.h [new file with mode: 0644]
lib/cpPlugins/ProcessObject.cxx [new file with mode: 0644]
lib/cpPlugins/ProcessObject.h [new file with mode: 0644]
lib/cpPlugins/ProcessObject.hxx [new file with mode: 0644]
lib/cpPlugins/Workspace.cxx [new file with mode: 0644]
lib/cpPlugins/Workspace.h [new file with mode: 0644]
lib/cpPlugins/WorkspaceIO.cxx [new file with mode: 0644]
lib/cpPlugins_ITKInstances/Base.cxx [new file with mode: 0644]
lib/cpPlugins_ITKInstances/Base.h [new file with mode: 0644]
lib/cpPlugins_ITKInstances/CMakeLists.txt [new file with mode: 0644]
lib/cpPlugins_ITKInstances/Config.h [new file with mode: 0644]
lib/cpPlugins_ITKInstances/Image.cxx [new file with mode: 0644]
lib/cpPlugins_ITKInstances/Image.h [new file with mode: 0644]
lib/third_party/CMakeLists.txt [new file with mode: 0644]
lib/third_party/tinyxml/CMakeLists.txt [new file with mode: 0644]
lib/third_party/tinyxml/readme.md [new file with mode: 0644]
lib/third_party/tinyxml/tinyxml2.cpp [new file with mode: 0644]
lib/third_party/tinyxml/tinyxml2.h [new file with mode: 0644]
plugins/CMakeLists.txt [new file with mode: 0644]
plugins/cpPluginsIO/CMakeLists.txt [new file with mode: 0644]
plugins/cpPluginsIO/DataReproducer.cxx [new file with mode: 0644]
plugins/cpPluginsIO/DataReproducer.h [new file with mode: 0644]
plugins/cpPluginsIO/DicomSeriesReader.cxx [new file with mode: 0644]
plugins/cpPluginsIO/DicomSeriesReader.h [new file with mode: 0644]
plugins/cpPluginsIO/ImageReader.cxx [new file with mode: 0644]
plugins/cpPluginsIO/ImageReader.h [new file with mode: 0644]
plugins/cpPluginsIO/ImageWriter.cxx [new file with mode: 0644]
plugins/cpPluginsIO/ImageWriter.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/CMakeLists.txt [new file with mode: 0644]
plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.h [new file with mode: 0644]
plugins/cpPluginsWidgets/CMakeLists.txt [new file with mode: 0644]
plugins/cpPluginsWidgets/SeedWidget.cxx [new file with mode: 0644]
plugins/cpPluginsWidgets/SeedWidget.h [new file with mode: 0644]

index 823705ed308fc168bc3f9b7f8cc7c865437d136d..97d52ff3fa5b16fc328eaccdb42b0bd61e5e3d2b 100644 (file)
@@ -1,20 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-## ============
-## = Policies =
-## ============
-
-SET(
-  policies
-  CMP0015
-  CMP0020
-  CMP0042
-  )
-FOREACH(policy ${policies})
-  IF(POLICY ${policy})
-    CMAKE_POLICY(SET ${policy} NEW)
-  ENDIF(POLICY ${policy})
-ENDFOREACH(policy)
+INCLUDE(cmake/cpPlugins_Policies.cmake)
 
 ## ================
 ## = Project name =
@@ -22,136 +7,42 @@ ENDFOREACH(policy)
 
 PROJECT(cpPlugins)
 SET(prj_MAJ_VER "0")
-SET(prj_MIN_VER "0")
-SET(prj_REL_VER "2")
-SET(prj_VERSION "${prj_MAJ_VER}.${prj_MIN_VER}.${prj_REL_VER}")
+SET(prj_MIN_VER "1")
+SET(prj_REL_VER "0")
+SET(prj_VER "${prj_MAJ_VER}.${prj_MIN_VER}.${prj_REL_VER}")
+SET(prj_sVER "${prj_MAJ_VER}")
 
 ## ===========
 ## = Options =
 ## ===========
 
-OPTION(USE_QT4 "Build Qt4-based code" OFF)
 OPTION(BUILD_EXAMPLES "Build examples" OFF)
 
-SET(LIBRARY_TYPE SHARED)
-
 ## ========================
 ## = Packages and options =
 ## ========================
 
-# Force c++11 language version
-# NOTE: It seems that by default on Visual Studio Compiler supports c++11,
-# so it only need to be test on other O.S.
-IF(NOT MSVC)
-  INCLUDE(CheckCXXCompilerFlag)
-  CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
-  IF(COMPILER_SUPPORTS_CXX11)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-  ELSE(COMPILER_SUPPORTS_CXX11)
-    CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
-    IF(COMPILER_SUPPORTS_CXX0X)
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-    ELSE(COMPILER_SUPPORTS_CXX0X)
-      MESSAGE(
-        FATAL_ERROR
-        "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support."
-        )
-    ENDIF(COMPILER_SUPPORTS_CXX0X)
-  ENDIF(COMPILER_SUPPORTS_CXX11)
-ENDIF(NOT MSVC)
-
-# Prepare header to build shared libs (windows)
-INCLUDE(GenerateExportHeader)
-
-# Find ITK and VTK
-FIND_PACKAGE(ITK REQUIRED)
-FIND_PACKAGE(VTK REQUIRED)
-
-INCLUDE(${ITK_USE_FILE})
-INCLUDE(${VTK_USE_FILE})
-
-# Do not use itk-vtk glue --> problems ahead!!!
-IF(ITKVtkGlue_LOADED)
-  MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
-ENDIF(ITKVtkGlue_LOADED)
-
-SET(QT4_FOUND "0")
-IF(USE_QT4)
-  FIND_PACKAGE(Qt4 REQUIRED)
-  INCLUDE(${QT_USE_FILE})
-
-  ## Check for required vtk-qt4 modules
-  SET(
-    vtk_required_modules
-    vtkGUISupportQt
-    vtkGUISupportQtOpenGL
-    )
-  FOREACH(vtk_module ${vtk_required_modules})
-    IF(NOT ${vtk_module}_LOADED)
-      MESSAGE(
-        FATAL_ERROR
-        "${vtk_module} module is required but not available."
-        )
-      SET(QT4_FOUND "0")
-    ENDIF(NOT ${vtk_module}_LOADED)
-  ENDFOREACH(vtk_module)
-  SET(QT4_FOUND "1")
-ENDIF(USE_QT4)
-
-## ================================================
-## = Do not allow to build inside the source tree =
-## ================================================
-
-IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
-  MESSAGE(FATAL_ERROR "Building in the source tree is not allowed.")
-ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+INCLUDE(cmake/cpPlugins_Options.cmake)
+INCLUDE(cmake/cpPlugins_KitwareTools.cmake)
+INCLUDE(cmake/cpPlugins_Qt4Tools.cmake)
 
-## =====================================
-## = Where to put executables and libs =
-## =====================================
-
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
-SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
-MARK_AS_ADVANCED(
-  CMAKE_BACKWARDS_COMPATIBILITY
-  EXECUTABLE_OUTPUT_PATH
-  LIBRARY_OUTPUT_PATH
-  )
-
-## ==============================
-## = Subdirs containing headers =
-## ==============================
+## =======================
+## = Include directories =
+## =======================
 
 INCLUDE_DIRECTORIES(
+  ${PROJECT_SOURCE_DIR}
+  ${PROJECT_BINARY_DIR}
   ${PROJECT_SOURCE_DIR}/lib
-  ${PROJECT_SOURCE_DIR}/lib/third_party
-  ${PROJECT_SOURCE_DIR}/lib/third_party/ItkVtkGlue
   ${PROJECT_BINARY_DIR}/lib
+  ${PROJECT_SOURCE_DIR}/plugins
+  ${PROJECT_BINARY_DIR}/plugins
+  ${PROJECT_SOURCE_DIR}/lib/third_party
   ${PROJECT_BINARY_DIR}/lib/third_party
-  ${PROJECT_BINARY_DIR}/lib/third_party/ItkVtkGlue
-  )
-IF(WIN32 OR APPLE)
-  INCLUDE_DIRECTORIES(
-    ${PROJECT_SOURCE_DIR}/lib/third_party/glext
-    )
-ENDIF(WIN32 OR APPLE)
-
-## =======================
-## = Local bash commands =
-## =======================
-SET(
-  bash_PROGRAMS
-  cpPlugins_createHost
+  ${PROJECT_SOURCE_DIR}/lib/ItkVtkGlue
+  ${PROJECT_BINARY_DIR}/lib/ItkVtkGlue
   )
 
-FOREACH(prog ${bash_PROGRAMS})
-  IF(MSVC)
-    SET(${prog}_APP ${PROJECT_BINARY_DIR}/$(ConfigurationName)/${prog})
-  ELSE(MSVC)
-    SET(${prog}_APP ${PROJECT_BINARY_DIR}/${prog})
-  ENDIF(MSVC)
-ENDFOREACH(prog)
-
 ## ===========================
 ## = Subdirs containing code =
 ## ===========================
@@ -159,6 +50,7 @@ ENDFOREACH(prog)
 SUBDIRS(
   cmake
   lib
+  plugins
   appli
   )
 
diff --git a/appli/CMakeLists.txt b/appli/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a290efe
--- /dev/null
@@ -0,0 +1,17 @@
+SUBDIRS(
+  bash
+  )
+IF(BUILD_EXAMPLES)
+  SUBDIRS(
+    examples
+    )
+ENDIF(BUILD_EXAMPLES)
+
+IF(USE_QT4)
+  SUBDIRS(
+    PipelineEditor
+    )
+ENDIF(USE_QT4)
+
+
+## eof - $RCSfile$
diff --git a/appli/PipelineEditor/CMakeLists.txt b/appli/PipelineEditor/CMakeLists.txt
new file mode 100644 (file)
index 0000000..33f7148
--- /dev/null
@@ -0,0 +1,51 @@
+SET(App_NAME "PipelineEditor")
+SET(Dir_NAME "PipelineEditor")
+
+## ====================================================
+## = Source code, user interafaces and resources here =
+## ====================================================
+
+SET(App_SOURCE_DIR "${PROJECT_SOURCE_DIR}/appli/${Dir_NAME}")
+SET(App_BINARY_DIR "${PROJECT_BINARY_DIR}/appli/${Dir_NAME}")
+SET(App_QT_SOURCES PipelineEditor.cxx)
+SET(App_SOURCES    main.cxx)
+SET(App_QT_HEADERS PipelineEditor.h)
+FILE(GLOB App_QT_UI  "${App_SOURCE_DIR}/*.ui")
+FILE(GLOB App_QT_RES "${App_SOURCE_DIR}/*.qrc")
+
+## =====================
+## = Compilation rules =
+## =====================
+INCLUDE_DIRECTORIES(
+  ${App_SOURCE_DIR}
+  ${App_BINARY_DIR}
+  )
+
+QT4_WRAP_UI(App_QT_UI_Headers ${App_QT_UI})
+QT4_WRAP_CPP(App_QT_HEADERS_MOC_SOURCES ${App_QT_HEADERS})
+QT4_ADD_RESOURCES(App_QT_RES_SOURCES ${App_QT_RES})
+
+SET(GUI_TYPE "")
+IF(WIN32)
+  SET(GUI_TYPE WIN32)
+ENDIF(WIN32)
+IF(APPLE)
+  SET(GUI_TYPE MACOSX_BUNDLE)
+ENDIF(APPLE)
+
+ADD_EXECUTABLE(
+  ${App_NAME}
+  ${GUI_TYPE}
+  ${App_QT_UI_Headers}
+  ${App_SOURCES}
+  ${App_QT_SOURCES}
+  ${App_QT_HEADERS_MOC_SOURCES}
+  ${App_QT_RES_SOURCES}
+  )
+TARGET_LINK_LIBRARIES(
+  ${App_NAME}
+  cpExtensions
+  cpPipelineEditor
+  )
+
+## eof - $RCSfile$
diff --git a/appli/PipelineEditor/PipelineEditor.cxx b/appli/PipelineEditor/PipelineEditor.cxx
new file mode 100644 (file)
index 0000000..139ae71
--- /dev/null
@@ -0,0 +1,390 @@
+#include "PipelineEditor.h"
+#include "ui_PipelineEditor.h"
+
+#include <cpPipelineEditor/Editor.h>
+
+#include <QFileDialog>
+#include <QMessageBox>
+
+#include <vtkImageData.h>
+#include <vtkPolyData.h>
+
+#include <cpPlugins/DataObject.h>
+
+// -------------------------------------------------------------------------
+#define PipelineEditor_ConnectAction( ACTION )          \
+  this->connect(                                        \
+    this->m_UI->Action##ACTION, SIGNAL( triggered( ) ), \
+    this, SLOT( _Action##ACTION( ) )                    \
+    )
+
+// -------------------------------------------------------------------------
+#define PipelineEditor_ConnectButton( BUTTON )          \
+  this->connect(                                        \
+    this->m_UI->Button##BUTTON, SIGNAL( clicked( ) ),   \
+    this, SLOT( _Button##BUTTON( ) )                    \
+    )
+
+// -------------------------------------------------------------------------
+PipelineEditor::
+PipelineEditor( int argc, char* argv[], QWidget* parent )
+  : QMainWindow( parent ),
+    m_UI( new Ui::PipelineEditor ),
+    m_Workspace( NULL ),
+    m_PluginsPath( "." )
+{
+  this->m_UI->setupUi( this );
+
+  // Prepare plugins interface
+  QFileInfo info( argv[ 0 ] );
+  if( info.exists( ) )
+  {
+    this->m_PluginsPath = info.canonicalPath( ).toStdString( );
+    this->_LoadPluginsFromPath( this->m_PluginsPath );
+
+  } // fi
+
+  /* TODO
+     this->m_Interface = new cpPlugins::Interface( );
+     this->m_PluginsPath = info.canonicalPath( ).toStdString( );
+     if( !( this->m_Interface->LoadDefaultConfiguration( this->m_PluginsPath ) ) )
+     if( this->m_Interface->LoadFromFolder( this->m_PluginsPath, false ) != "" )
+     if( !( this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath ) ) )
+     QMessageBox::critical(
+     this,
+     "Error creating default plugins configuration",
+     "Could not save default plugins configuration"
+     );
+     this->_UpdateLoadedPlugins( );
+
+     } // fi
+  */
+
+  // Create an empty workspace
+  this->m_Workspace = new cpPlugins::Workspace( );
+  this->m_Workspace->SetInterface( &( this->m_Interface ) );
+  this->m_UI->Canvas->editor( )->setWorkspace( this->m_Workspace );
+  this->m_Workspace->SetMPRViewer( this->m_UI->Viewer );
+
+  // Connect actions to slots
+  PipelineEditor_ConnectButton( LoadPluginsFile );
+  PipelineEditor_ConnectButton( LoadPluginsPath );
+  PipelineEditor_ConnectAction( OpenWorkspace );
+  PipelineEditor_ConnectAction( SaveWorkspace );
+  this->connect(
+    this->m_UI->Canvas->editor( ),
+    SIGNAL( execFilter( const std::string& ) ),
+    this,
+    SLOT( _ExecFilter( const std::string& ) )
+    );
+  this->connect(
+    this->m_UI->Canvas->editor( ),
+    SIGNAL( showFilterOutput( const std::string&, const std::string& ) ),
+    this,
+    SLOT( _ShowFilterOutput( const std::string&, const std::string& ) )
+    );
+}
+
+// -------------------------------------------------------------------------
+PipelineEditor::
+~PipelineEditor( )
+{
+  if( this->m_Workspace != NULL )
+    delete this->m_Workspace;
+  delete this->m_UI;
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_LoadPluginsFromPath( const std::string& path )
+{
+  QDir dir( path.c_str( ) );
+  std::stringstream filters_str;
+  filters_str << "*." << cpPlugins_PLUGIN_EXT;
+  QStringList filters;
+  filters << filters_str.str( ).c_str( );
+  auto files = dir.entryList( filters );
+  for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt )
+  {
+    try
+    {
+      this->m_Interface.LoadPluginFile( fIt->toStdString( ) );
+    }
+    catch( ... )
+    {
+      // Just ignore un-loadable libraries
+    }
+
+  } // yrt
+  this->_UpdateLoadedPlugins( );
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_UpdateLoadedPlugins( )
+{
+  auto filters = this->m_Interface.GetFilters( );
+  if( filters.size( ) == 0 )
+  {
+    QMessageBox::critical(
+      this,
+      "Error loading default plugins",
+      "No plugins loaded: remember to load some!!!"
+      );
+    return;
+
+  } // fi
+
+  for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
+  {
+    // Create or get category
+    QList< QTreeWidgetItem* > cat_items =
+      this->m_UI->LoadedPlugins->findItems(
+        cIt->first.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
+        );
+    QTreeWidgetItem* cat = NULL;
+    if( cat_items.size( ) == 0 )
+    {
+      cat = new QTreeWidgetItem(
+        ( QTreeWidgetItem* )( NULL ), QStringList( cIt->first.c_str( ) )
+        );
+      this->m_UI->LoadedPlugins->addTopLevelItem( cat );
+    }
+    else
+      cat = cat_items[ 0 ];
+
+    // Create filters
+    auto fIt = cIt->second.begin( );
+    for( ; fIt != cIt->second.end( ); ++fIt )
+    {
+      QList< QTreeWidgetItem* > filter_items =
+        this->m_UI->LoadedPlugins->findItems(
+          fIt->first.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
+          );
+      auto fiIt = filter_items.begin( );
+      auto found_fiIt = filter_items.end( );
+      for( ; fiIt != filter_items.end( ); ++fiIt )
+        if( ( *fiIt )->parent( ) == cat )
+          found_fiIt = fiIt;
+
+      // Add filter
+      if( found_fiIt == filter_items.end( ) )
+        QTreeWidgetItem* filter = new QTreeWidgetItem(
+          cat, QStringList( fIt->first.c_str( ) )
+          );
+
+    } // rof
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ButtonLoadPluginsFile( )
+{
+  /*
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::ExistingFiles );
+  dlg.setDirectory( "." );
+
+  std::stringstream name_filter;
+  std::string suffix = std::string( cpPlugins_PLUGIN_EXT ).substr( 1 );
+
+  name_filter << "Plugins file (*" << cpPlugins_PLUGIN_EXT << ");;All files (*)";
+  dlg.setNameFilter( name_filter.str( ).c_str( ) );
+  dlg.setDefaultSuffix( suffix.c_str( ) );
+
+  if( !( dlg.exec( ) ) )
+    return;
+
+  // Read
+  QStringList names = dlg.selectedFiles( );
+  std::stringstream err_str;
+  for( auto qIt = names.begin( ); qIt != names.end( ); ++qIt )
+    err_str << this->m_Interface->Load( qIt->toStdString( ) );
+
+  // Show an error message
+  std::string err = err_str.str( );
+  if( err.size( ) > 0 )
+    QMessageBox::critical(
+      this,
+      "Error loading plugins",
+      err.c_str( )
+      );
+
+  // Update view
+  this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath );
+  this->_UpdateLoadedPlugins( );
+  */
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ButtonLoadPluginsPath( )
+{
+  /*
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::DirectoryOnly );
+  dlg.setDirectory( "." );
+  if( !( dlg.exec( ) ) )
+    return;
+
+  // Read
+  std::string dir = dlg.selectedFiles( ).begin( )->toStdString( );
+  std::string err = this->m_Interface->LoadFromFolder( dir, false );
+  if( err != "" )
+    QMessageBox::critical(
+      this,
+      "Error loading plugins directory",
+      err.c_str( )
+      );
+
+  // Update view
+  this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath );
+  this->_UpdateLoadedPlugins( );
+  */
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ActionOpenWorkspace( )
+{
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::ExistingFile );
+  dlg.setDirectory( "." );
+  dlg.setNameFilter(
+    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
+    );
+  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
+  if( !( dlg.exec( ) ) )
+    return;
+  std::string fname = dlg.selectedFiles( ).at( 0 ).toStdString( );
+
+  if( this->m_Workspace != NULL )
+    delete this->m_Workspace;
+  this->m_Workspace = new cpPlugins::Workspace( );
+  this->m_Workspace->SetInterface( &( this->m_Interface ) );
+  this->m_Workspace->SetMPRViewer( this->m_UI->Viewer );
+  std::string err = this->m_Workspace->LoadWorkspace( fname );
+  if( err != "" )
+  {
+    delete this->m_Workspace;
+    this->m_Workspace = NULL;
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error loading workspace" ),
+      QMessageBox::tr( err.c_str( ) )
+      );
+  }
+  else
+    this->m_UI->Canvas->editor( )->setWorkspace( this->m_Workspace );
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ActionSaveWorkspace( )
+{
+  if( this->m_Workspace == NULL )
+    return;
+
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::AnyFile );
+  dlg.setDirectory( "." );
+  dlg.setAcceptMode( QFileDialog::AcceptSave );
+  dlg.setNameFilter(
+    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
+    );
+  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
+  if( !( dlg.exec( ) ) )
+    return;
+  std::string fname = dlg.selectedFiles( ).at( 0 ).toStdString( );
+
+  std::string err = this->m_Workspace->SaveWorkspace( fname );
+  if( err != "" )
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error saving workspace" ),
+      QMessageBox::tr( err.c_str( ) )
+      );
+}
+
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ExecFilter( const std::string& filter_name )
+{
+  if( this->m_Workspace != NULL )
+  {
+    // Update filter, if needed
+    std::string err = this->m_Workspace->Execute( filter_name );
+    if( err != "" )
+      QMessageBox::critical(
+        this,
+        QMessageBox::tr( "Error executing filter" ),
+        QMessageBox::tr( err.c_str( ) )
+        );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ShowFilterOutput(
+  const std::string& filter_name, const std::string& output_name
+  )
+{
+  typedef cpPlugins::DataObject _TDataObject;
+
+  // Update filter, if needed
+  this->_ExecFilter( filter_name );
+
+  // Get output
+  auto filter = this->m_Workspace->GetFilter( filter_name );
+  if( filter != NULL )
+  {
+    auto output = filter->GetOutputData( output_name );
+    if( output != NULL )
+    {
+      std::string data_name = output_name + "@" + filter_name;
+      auto idata = output->GetVTK< vtkImageData >( );
+      auto mdata = output->GetVTK< vtkPolyData >( );
+      if( idata != NULL )
+      {
+        if( this->m_UI->Viewer->AddData( idata, data_name, "" ) )
+        {
+          if( this->m_UI->Viewer->GetNumberOfData( ) > 1 )
+            this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
+          else
+            this->m_UI->Viewer->SetMainImage( data_name );
+          this->m_UI->Viewer->ShowData( data_name );
+
+        } // fi
+      }
+      else if( mdata != NULL )
+      {
+      }
+      else
+        QMessageBox::critical(
+          this,
+          QMessageBox::tr( "Error showing data" ),
+          QMessageBox::tr( "No known VTK conversion!" )
+          );
+
+      /* TODO
+         if( this->m_UI->Viewer->AddData( output, data_name, "" ) )
+         {
+         if( this->m_UI->Viewer->GetNumberOfData( ) > 1 )
+         this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
+         else
+         this->m_UI->Viewer->SetMainImage( data_name );
+         this->m_UI->Viewer->ShowData( data_name );
+         }
+         else
+      */
+
+    } // fi
+
+  } // fi
+}
+
+// eof - $RCSfile$
diff --git a/appli/PipelineEditor/PipelineEditor.h b/appli/PipelineEditor/PipelineEditor.h
new file mode 100644 (file)
index 0000000..ffeeafd
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef __PIPELINEEDITOR__H__
+#define __PIPELINEEDITOR__H__
+
+// Qt stuff
+#include <QMainWindow>
+#include <cpPlugins/Interface.h>
+#include <cpPlugins/Workspace.h>
+
+// -------------------------------------------------------------------------
+namespace Ui
+{
+  class PipelineEditor;
+}
+
+/**
+ */
+class PipelineEditor
+  : public QMainWindow
+{
+  Q_OBJECT;
+
+public:
+  typedef PipelineEditor Self;
+  typedef QMainWindow      Superclass;
+
+public:
+  explicit PipelineEditor(
+    int argc, char* argv[],
+    QWidget* parent = 0
+    );
+  virtual ~PipelineEditor( );
+
+protected:
+  void _LoadPluginsFromPath( const std::string& path );
+  void _UpdateLoadedPlugins( );
+
+protected slots:
+  void _ButtonLoadPluginsFile( );
+  void _ButtonLoadPluginsPath( );
+  void _ActionOpenWorkspace( );
+  void _ActionSaveWorkspace( );
+  void _ExecFilter( const std::string& filter_name );
+  void _ShowFilterOutput(
+    const std::string& filter_name, const std::string& output_name
+    );
+
+private:
+  Ui::PipelineEditor*   m_UI;
+  cpPlugins::Workspace* m_Workspace;
+  cpPlugins::Interface  m_Interface;
+  std::string           m_PluginsPath;
+};
+
+#endif // __CPPIPELINEEDITOR__H__
+
+// eof - $RCSfile$
diff --git a/appli/PipelineEditor/PipelineEditor.ui b/appli/PipelineEditor/PipelineEditor.ui
new file mode 100644 (file)
index 0000000..4a3e330
--- /dev/null
@@ -0,0 +1,235 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PipelineEditor</class>
+ <widget class="QMainWindow" name="PipelineEditor">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>800</width>
+    <height>600</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="MainWidget">
+   <layout class="QGridLayout" name="gridLayout">
+    <item row="0" column="0">
+     <widget class="QSplitter" name="splitter_2">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <widget class="cpExtensions::QT::SimpleMPRWidget" name="Viewer" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>200</height>
+        </size>
+       </property>
+      </widget>
+      <widget class="QSplitter" name="splitter">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <widget class="QFrame" name="frame">
+        <property name="minimumSize">
+         <size>
+          <width>251</width>
+          <height>331</height>
+         </size>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QGroupBox" name="groupBox">
+           <property name="minimumSize">
+            <size>
+             <width>202</width>
+             <height>67</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>202</width>
+             <height>67</height>
+            </size>
+           </property>
+           <property name="title">
+            <string>Plugins</string>
+           </property>
+           <layout class="QHBoxLayout" name="horizontalLayout">
+            <item>
+             <widget class="QPushButton" name="ButtonLoadPluginsFile">
+              <property name="minimumSize">
+               <size>
+                <width>85</width>
+                <height>31</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>85</width>
+                <height>31</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>File</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="ButtonLoadPluginsPath">
+              <property name="minimumSize">
+               <size>
+                <width>85</width>
+                <height>31</height>
+               </size>
+              </property>
+              <property name="maximumSize">
+               <size>
+                <width>85</width>
+                <height>31</height>
+               </size>
+              </property>
+              <property name="text">
+               <string>Path</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </item>
+         <item>
+          <widget class="QTreeWidget" name="LoadedPlugins">
+           <property name="minimumSize">
+            <size>
+             <width>229</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="dragEnabled">
+            <bool>true</bool>
+           </property>
+           <property name="dragDropMode">
+            <enum>QAbstractItemView::DragOnly</enum>
+           </property>
+           <property name="alternatingRowColors">
+            <bool>true</bool>
+           </property>
+           <property name="uniformRowHeights">
+            <bool>true</bool>
+           </property>
+           <column>
+            <property name="text">
+             <string>Loaded plugins</string>
+            </property>
+           </column>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+       <widget class="cpPipelineEditor::Canvas" name="Canvas" native="true">
+        <property name="minimumSize">
+         <size>
+          <width>500</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="acceptDrops">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </widget>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="Menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>27</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="MenuFile">
+    <property name="title">
+     <string>&amp;File</string>
+    </property>
+    <widget class="QMenu" name="MenuWorkspace">
+     <property name="title">
+      <string>Workspace</string>
+     </property>
+     <addaction name="ActionOpenWorkspace"/>
+     <addaction name="ActionSaveWorkspace"/>
+    </widget>
+    <addaction name="MenuWorkspace"/>
+    <addaction name="separator"/>
+    <addaction name="ActionExit"/>
+   </widget>
+   <addaction name="MenuFile"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="ActionOpenWorkspace">
+   <property name="text">
+    <string>Open</string>
+   </property>
+  </action>
+  <action name="ActionSaveWorkspace">
+   <property name="text">
+    <string>Save</string>
+   </property>
+  </action>
+  <action name="ActionExit">
+   <property name="text">
+    <string>E&amp;xit</string>
+   </property>
+  </action>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>cpPipelineEditor::Canvas</class>
+   <extends>QWidget</extends>
+   <header>cpPipelineEditor/Canvas.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>cpExtensions::QT::SimpleMPRWidget</class>
+   <extends>QWidget</extends>
+   <header location="global">cpExtensions/QT/SimpleMPRWidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>ActionExit</sender>
+   <signal>triggered()</signal>
+   <receiver>PipelineEditor</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/appli/PipelineEditor/main.cxx b/appli/PipelineEditor/main.cxx
new file mode 100644 (file)
index 0000000..2013a69
--- /dev/null
@@ -0,0 +1,81 @@
+#include "PipelineEditor.h"
+#include <cstdlib>
+#include <QApplication>
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+  QApplication a( argc, argv );
+  PipelineEditor w( argc, argv, NULL );
+  w.show( );
+
+  return( a.exec( ) );
+}
+
+// -------------------------------------------------------------------------
+#ifdef _WIN32
+
+#include <memory>
+#include <vector>
+#include <windows.h>
+#include <shellapi.h>
+
+/**
+ */
+class Win32CommandLineConverter
+{
+private:
+  std::unique_ptr< char*[ ] > argv_;
+  std::vector< std::unique_ptr< char[ ] > > storage_;
+
+public:
+  Win32CommandLineConverter( )
+    {
+      LPWSTR cmd_line = GetCommandLineW( );
+      int argc;
+      LPWSTR* w_argv = CommandLineToArgvW( cmd_line, &argc );
+      argv_ = std::unique_ptr< char*[ ] >( new char*[ argc ] );
+      storage_.reserve( argc );
+      for( int i = 0; i < argc; ++i )
+      {
+        storage_.push_back( ConvertWArg( w_argv[ i ] ) );
+        argv_[ i ] = storage_.back( ).get( );
+
+      } // rof
+      LocalFree( w_argv );
+    }
+  int argc( ) const
+    {
+      return( static_cast< int >(storage_.size( ) ) );
+    }
+  char** argv( ) const
+    {
+      return( argv_.get( ) );
+    }
+  static std::unique_ptr< char[ ] > ConvertWArg( LPWSTR w_arg )
+    {
+      int size = WideCharToMultiByte(
+        CP_UTF8, 0, w_arg, -1, nullptr, 0, nullptr, nullptr
+        );
+      std::unique_ptr< char[ ] > ret( new char[ size ] );
+      WideCharToMultiByte(
+        CP_UTF8, 0, w_arg, -1, ret.get( ), size, nullptr, nullptr
+        );
+      return( ret );
+    }
+};
+
+int CALLBACK WinMain(
+  HINSTANCE hInstance,
+  HINSTANCE hPrevInstance,
+  LPSTR lpCmdLine,
+  int nCmdShow
+  )
+{
+  Win32CommandLineConverter cmd_line;
+  return( main( cmd_line.argc( ), cmd_line.argv( ) ) );
+}
+
+#endif
+
+// eof - $RCSfile$
diff --git a/appli/bash/CMakeLists.txt b/appli/bash/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2eac91c
--- /dev/null
@@ -0,0 +1,16 @@
+SET(
+  bash_SOURCES
+  cpPlugins_HostCreator
+  )
+
+FOREACH(program ${bash_SOURCES})
+  ADD_EXECUTABLE(${program} ${program}.cxx)
+  INSTALL(
+    TARGETS ${program}
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib/static
+    )
+ENDFOREACH(program)
+
+## eof - $RCSfile$
diff --git a/appli/bash/cpPlugins_HostCreator.cxx b/appli/bash/cpPlugins_HostCreator.cxx
new file mode 100644 (file)
index 0000000..6721271
--- /dev/null
@@ -0,0 +1,169 @@
+#include <algorithm>
+#include <iostream>
+#include <iterator>
+#include <fstream>
+#include <map>
+#include <sstream>
+#include <streambuf>
+#include <vector>
+
+// -------------------------------------------------------------------------
+typedef std::map< std::string, std::string > TPair;
+typedef std::map< std::string, TPair >        TInfo;
+
+// -------------------------------------------------------------------------
+bool is_valid_class( const std::string& str )
+{
+  return( str.find( "cpPlugins_Id_Macro" ) != std::string::npos );
+}
+
+// -------------------------------------------------------------------------
+void process_header( TInfo& info, const std::string& file_name )
+{
+  // Load file into a buffer
+  std::ifstream file_stream( file_name.c_str( ) );
+  if( !file_stream )
+    return;
+  std::string buf;
+  file_stream.seekg( 0, std::ios::end );
+  buf.reserve( file_stream.tellg( ) );
+  file_stream.seekg( 0, std::ios::beg );
+  buf.assign(
+    ( std::istreambuf_iterator< char >( file_stream ) ),
+    std::istreambuf_iterator< char >( )
+    );
+  file_stream.close( );
+
+  // Replace separators with spaces
+  std::replace( buf.begin( ), buf.end( ), ',', ' ' );
+  std::replace( buf.begin( ), buf.end( ), ';', ' ' );
+  std::replace( buf.begin( ), buf.end( ), ':', ' ' );
+  std::replace( buf.begin( ), buf.end( ), '(', ' ' );
+  std::replace( buf.begin( ), buf.end( ), ')', ' ' );
+  std::replace( buf.begin( ), buf.end( ), '{', ' ' );
+  std::replace( buf.begin( ), buf.end( ), '}', ' ' );
+
+  // Tokenize buffer
+  std::istringstream tokenizer( buf );
+  std::vector< std::string > tokens;
+  std::copy(
+    std::istream_iterator< std::string >( tokenizer ),
+    std::istream_iterator< std::string >( ),
+    std::back_inserter( tokens )
+    );
+
+  // Find pivot
+  auto p = std::find_if( tokens.begin( ), tokens.end( ), is_valid_class );
+  if( p != tokens.end( ) )
+  {
+    // Find class name and category
+    auto cls_it = p; cls_it++;
+    auto cat_it = cls_it; cat_it++;
+
+    // Find namespace
+    typedef std::reverse_iterator< std::vector< std::string >::iterator > _RIt;
+    _RIt r_end( tokens.begin( ) );
+    _RIt r_begin( cls_it );
+    auto ns_it = std::find( r_begin, r_end, "namespace" ); ns_it--;
+
+    // Update info
+    info[ *cat_it ][ *cls_it ] = *ns_it;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+  if( argc < 3 )
+  {
+    std::cerr
+      << "Usage: " << argv[ 0 ]
+      << " output_file header_file_0.h header_file_0.h ..."
+      << std::endl;
+    return( 1 );
+
+  } // fi
+
+  // Parse all header files
+  TInfo info;
+  for( int i = 2; i < argc; ++i )
+    process_header( info, argv[ i ] );
+  if( info.size( ) == 0 )
+  {
+    std::cerr << "ERROR: No valid input headers." << std::endl;
+    return( 1 );
+
+  } // fi
+
+  // Write data
+  std::ofstream out_stream( argv[ 1 ] );
+
+  // Write include section
+  out_stream
+    << "#include <map>" << std::endl
+    << "#include <set>" << std::endl;
+  for( int i = 2; i < argc; ++i )
+    out_stream << "#include \"" << argv[ i ] << "\"" <<std::endl;
+
+  // Write init/finish section
+  out_stream
+    << std::endl
+    << "void __attribute__ ((constructor)) _initialize( )" << std::endl
+    << "{" << std::endl << "}" << std::endl << std::endl
+    << "void __attribute__ ((destructor)) _finalize( )" << std::endl
+    << "{" << std::endl << "}" << std::endl << std::endl;
+
+  // Write access function
+  out_stream
+    << "extern \"C\" std::map< std::string, std::set< std::string > > "
+    << "LoadedFilters( )" << std::endl << "{" << std::endl
+    << "  std::map< std::string, std::set< std::string > > classes;"
+    << std::endl;
+  int i = 0;
+  for( auto iIt = info.begin( ); iIt != info.end( ); ++iIt )
+  {
+    for( auto jIt = iIt->second.begin( ); jIt != iIt->second.end( ); ++jIt )
+    {
+      out_stream
+        << "  auto f" << i << " = "
+        << jIt->second << "::" << jIt->first
+        << "::New( );" << std::endl
+        << "  classes[ f" << i << "->GetClassCategory( ) ].insert( "
+        << "f" << i << "->GetClassName( ) );" << std::endl;
+      i++;
+
+    } // rof
+
+  } // rof
+  out_stream
+    << "  return( classes );" << std::endl
+    << "}" << std::endl << std::endl;
+
+  // Write creators
+  for( auto iIt = info.begin( ); iIt != info.end( ); ++iIt )
+  {
+    for( auto jIt = iIt->second.begin( ); jIt != iIt->second.end( ); ++jIt )
+    {
+      out_stream
+        << "extern \"C\" cpPlugins::ProcessObject::Pointer "
+        << iIt->first << "_" << jIt->first
+        << "( )" << std::endl << "{" << std::endl
+        << std::endl
+        << "  cpPlugins::ProcessObject::Pointer p;" << std::endl
+        << "  " << jIt->second << "::" << jIt->first << "::Pointer f = "
+        << jIt->second << "::" << jIt->first << "::New( );" << std::endl
+        << "  p = f.GetPointer( );" << std::endl << "  return( p );"
+        << std::endl;
+      out_stream
+        << "}" << std::endl << std::endl;
+
+    } // rof
+
+  } // rof
+  out_stream.close( );
+
+  return( 0 );
+}
+
+// eof - $RCSfile$
diff --git a/appli/examples/CMakeLists.txt b/appli/examples/CMakeLists.txt
new file mode 100644 (file)
index 0000000..020c854
--- /dev/null
@@ -0,0 +1,13 @@
+SET(
+  examples_SOURCES
+  example_LoadPluginsFile
+  example_ReadWriteImage
+  example_ReadWriteImageWithWorkspace
+  )
+
+FOREACH(example ${examples_SOURCES})
+  ADD_EXECUTABLE(${example} ${example}.cxx)
+  TARGET_LINK_LIBRARIES(${example} cpPlugins)
+ENDFOREACH(example)
+
+## eof - $RCSfile$
diff --git a/appli/examples/example_LoadPluginsFile.cxx b/appli/examples/example_LoadPluginsFile.cxx
new file mode 100644 (file)
index 0000000..e43f383
--- /dev/null
@@ -0,0 +1,44 @@
+#include <iostream>
+#include <cpPlugins/Interface.h>
+
+int main( int argc, char* argv[] )
+{
+  if( argc < 2 )
+  {
+    std::cerr << "Usage: " << argv[ 0 ] << " plugins_library" << std::endl;
+    return( 1 );
+
+  } // fi
+
+  // Load interface
+  cpPlugins::Interface interface;
+  try
+  {
+    interface.LoadPluginFile( argv[ 1 ] );
+  }
+  catch( std::exception& err )
+  {
+    std::cerr
+      << "Interface load failed on \"" << argv[ 1 ] << "\": "
+      << err.what( )
+      << std::endl;
+    return( 1 );
+
+  } // fi
+
+  // Show loaded filters
+  auto filters = interface.GetFilters( );
+  for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
+  {
+    std::cout << "Category: " << cIt->first << std::endl;
+    for( auto nIt = cIt->second.begin( ); nIt != cIt->second.end( ); ++nIt )
+      std::cout
+        << "\tFilter: " << nIt->first
+        << " (" << nIt->second << ")"
+        << std::endl;
+
+  } // rof
+  return( 0 );
+}
+
+// eof - $RCSfile$
diff --git a/appli/examples/example_ReadWriteImage.cxx b/appli/examples/example_ReadWriteImage.cxx
new file mode 100644 (file)
index 0000000..50b8f43
--- /dev/null
@@ -0,0 +1,95 @@
+#include <iostream>
+#include <cpPlugins/Interface.h>
+
+int main( int argc, char* argv[] )
+{
+  if( argc < 4 )
+  {
+    std::cerr
+      << "Usage: " << argv[ 0 ]
+      << " plugins_library input_image(s) output_image" << std::endl;
+    return( 1 );
+
+  } // fi
+
+  // Load interface
+  int ret = 0;
+  cpPlugins::Interface interface;
+  try
+  {
+    interface.LoadPluginFile( argv[ 1 ] );
+  }
+  catch( std::exception& err )
+  {
+    std::cerr
+      << "Interface load failed on \"" << argv[ 1 ] << "\": "
+      << err.what( )
+      << std::endl;
+    ret = 1;
+
+  } // fi
+
+  // Create filters
+  cpPlugins::ProcessObject::Pointer reader;
+  cpPlugins::ProcessObject::Pointer writer;
+  try
+  {
+    reader = interface.Create( "IO", "ImageReader" );
+    if( reader.IsNull( ) )
+    {
+      std::cerr
+        << "\"IO::ImageReader\" creation failed from \""
+        << argv[ 1 ] << "\""
+        << std::endl;
+      ret = 1;
+
+    } // fi
+    writer = interface.Create( "IO", "ImageWriter" );
+    if( writer.IsNull( ) )
+    {
+      std::cerr
+        << "\"IO::ImageWriter\" creation failed from \""
+        << argv[ 1 ] << "\""
+        << std::endl;
+      ret = 1;
+
+    } // fi
+  }
+  catch( std::exception& err )
+  {
+    std::cerr
+      << "Filter creation failed on \"" << argv[ 1 ] << "\": "
+      << err.what( )
+      << std::endl;
+    ret = 1;
+
+  } // yrt
+
+  if( ret == 0 )
+  {
+    // Configure filters
+    auto reader_params = reader->GetParameters( );
+    for( int i = 2; i < argc - 1; ++i )
+      reader_params->AddToOpenFileNameList( "FileNames", argv[ i ] );
+    auto writer_params = writer->GetParameters( );
+    writer_params->SetOpenFileName( "FileName", argv[ argc - 1 ] );
+
+    // Connect filters
+    writer->SetInput( "Input", reader->GetOutput( "Output" ) );
+
+    // Execute filters
+    std::string err = writer->Update( );
+    if( err != "" )
+    {
+      std::cout << "Error caught: " << err << std::endl;
+      ret = 1;
+
+    } // fi
+
+  } // fi
+
+  // Ok finish
+  return( ret );
+}
+
+// eof - $RCSfile$
diff --git a/appli/examples/example_ReadWriteImageWithWorkspace.cxx b/appli/examples/example_ReadWriteImageWithWorkspace.cxx
new file mode 100644 (file)
index 0000000..9a82138
--- /dev/null
@@ -0,0 +1,60 @@
+#include <iostream>
+#include <cpPlugins/Interface.h>
+#include <cpPlugins/Workspace.h>
+
+int main( int argc, char* argv[] )
+{
+  if( argc < 4 )
+  {
+    std::cerr
+      << "Usage: " << argv[ 0 ]
+      << " plugins_library input_image(s) output_image" << std::endl;
+    return( 1 );
+
+  } // fi
+
+  // Load interface
+  int ret = 0;
+  cpPlugins::Interface interface;
+  try
+  {
+    interface.LoadPluginFile( argv[ 1 ] );
+  }
+  catch( std::exception& err )
+  {
+    std::cerr
+      << "Interface load failed on \"" << argv[ 1 ] << "\": "
+      << err.what( )
+      << std::endl;
+    ret = 1;
+
+  } // fi
+
+  // Create filters
+  cpPlugins::Workspace workspace;
+  workspace.SetInterface( &interface );
+  auto reader = workspace.CreateFilter( "IO", "ImageReader", "reader" );
+  auto writer = workspace.CreateFilter( "IO", "ImageWriter", "writer" );
+  workspace.Connect( "reader", "writer", "Output", "Input" );
+
+  // Configure filters
+  auto reader_params = reader->GetParameters( );
+  for( int i = 2; i < argc - 1; ++i )
+    reader_params->AddToOpenFileNameList( "FileNames", argv[ i ] );
+  auto writer_params = writer->GetParameters( );
+  writer_params->SetOpenFileName( "FileName", argv[ argc - 1 ] );
+
+  // Execute
+  std::string err = workspace.Execute( );
+  if( err != "" )
+  {
+    std::cout << "Error caught: " << err << std::endl;
+    ret = 1;
+
+  } // fi
+
+  // Ok finish
+  return( ret );
+}
+
+// eof - $RCSfile$
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4b26944
--- /dev/null
@@ -0,0 +1 @@
+## eof - $RCSfile$
diff --git a/cmake/cpPlugins_KitwareTools.cmake b/cmake/cpPlugins_KitwareTools.cmake
new file mode 100644 (file)
index 0000000..c920959
--- /dev/null
@@ -0,0 +1,19 @@
+# ====================
+# = Find ITK and VTK =
+# ====================
+
+FIND_PACKAGE(ITK REQUIRED)
+FIND_PACKAGE(VTK REQUIRED)
+
+INCLUDE(${ITK_USE_FILE})
+INCLUDE(${VTK_USE_FILE})
+
+# =================================================
+# = Do not use itk-vtk glue --> problems ahead!!! =
+# =================================================
+
+IF(ITKVtkGlue_LOADED)
+  MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
+ENDIF(ITKVtkGlue_LOADED)
+
+## eof - $RCSfile$
diff --git a/cmake/cpPlugins_Options.cmake b/cmake/cpPlugins_Options.cmake
new file mode 100644 (file)
index 0000000..44b4f8f
--- /dev/null
@@ -0,0 +1,48 @@
+# ============================================================================
+# = Force c++11 language version                                             =
+# = NOTE: It seems that by default on Visual Studio Compiler supports c++11, =
+# = so it only need to be tested on other OS.                                =
+# ============================================================================
+
+IF(NOT MSVC)
+  INCLUDE(CheckCXXCompilerFlag)
+  CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+  IF(COMPILER_SUPPORTS_CXX11)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+  ELSE(COMPILER_SUPPORTS_CXX11)
+    CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+    IF(COMPILER_SUPPORTS_CXX0X)
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+    ELSE(COMPILER_SUPPORTS_CXX0X)
+      MESSAGE(
+        FATAL_ERROR
+        "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support."
+        )
+    ENDIF(COMPILER_SUPPORTS_CXX0X)
+  ENDIF(COMPILER_SUPPORTS_CXX11)
+ENDIF(NOT MSVC)
+
+# Prepare header to build shared libs (windows)
+INCLUDE(GenerateExportHeader)
+
+## ================================================
+## = Do not allow to build inside the source tree =
+## ================================================
+
+IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+  MESSAGE(FATAL_ERROR "Building in the source tree is not allowed.")
+ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+
+## =====================================
+## = Where to put executables and libs =
+## =====================================
+
+SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
+MARK_AS_ADVANCED(
+  CMAKE_BACKWARDS_COMPATIBILITY
+  EXECUTABLE_OUTPUT_PATH
+  LIBRARY_OUTPUT_PATH
+  )
+
+## eof - $RCSfile$
diff --git a/cmake/cpPlugins_Policies.cmake b/cmake/cpPlugins_Policies.cmake
new file mode 100644 (file)
index 0000000..a26f448
--- /dev/null
@@ -0,0 +1,13 @@
+SET(
+  policies
+  CMP0015
+  CMP0020
+  CMP0042
+  )
+FOREACH(policy ${policies})
+  IF(POLICY ${policy})
+    CMAKE_POLICY(SET ${policy} NEW)
+  ENDIF(POLICY ${policy})
+ENDFOREACH(policy)
+
+## eof - $RCSfile$
diff --git a/cmake/cpPlugins_Qt4Tools.cmake b/cmake/cpPlugins_Qt4Tools.cmake
new file mode 100644 (file)
index 0000000..d046e6b
--- /dev/null
@@ -0,0 +1,24 @@
+OPTION(USE_QT4 "Build Qt4-based code" ON)
+
+SET(QT4_FOUND "0")
+IF(USE_QT4)
+  FIND_PACKAGE(Qt4 REQUIRED)
+  INCLUDE(${QT_USE_FILE})
+  SET(
+    vtk_required_modules
+    vtkGUISupportQt
+    vtkGUISupportQtOpenGL
+    )
+  FOREACH(vtk_module ${vtk_required_modules})
+    IF(NOT ${vtk_module}_LOADED)
+      MESSAGE(
+        FATAL_ERROR
+        "${vtk_module} module is required but not available."
+        )
+      SET(QT4_FOUND "0")
+    ENDIF(NOT ${vtk_module}_LOADED)
+  ENDFOREACH(vtk_module)
+  SET(QT4_FOUND "1")
+ENDIF(USE_QT4)
+
+## eof - $RCSfile$
diff --git a/doc/third_party/Pluma/build/Doxyfile b/doc/third_party/Pluma/build/Doxyfile
deleted file mode 100644 (file)
index b0d5dd6..0000000
+++ /dev/null
@@ -1,1597 +0,0 @@
-# Doxyfile 1.6.3
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file 
-# that follow. The default is UTF-8 which is also the encoding used for all 
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
-# iconv built into libc) for the transcoding. See 
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = Pluma
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
-# if some version control system is used.
-
-PROJECT_NUMBER         = 
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = ..
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       = "The $name class" \
-                         "The $name widget" \
-                         "The $name file" \
-                         is \
-                         provides \
-                         specifies \
-                         contains \
-                         represents \
-                         a \
-                         an \
-                         the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
-# description.
-
-ALWAYS_DETAILED_SEC    = YES
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
-# inherited members of a class in the documentation of that class as if those 
-# members were ordinary class members. Constructors, destructors and assignment 
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user-defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
-# path to strip.
-
-STRIP_FROM_PATH        = 
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    = 
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the JavaDoc 
-# comments will behave just like regular Qt-style comments 
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
-# interpret the first line (until the first dot) of a Qt-style 
-# comment as the brief description. If set to NO, the comments 
-# will behave just like regular Qt-style comments (thus requiring 
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
-# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
-# comments) as a brief description. This used to be the default behaviour. 
-# The new default is to treat a multi-line C++ comment block as a detailed 
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 4
-
-# This tag can be used to specify a number of aliases that acts 
-# as commands in the documentation. An alias has the form "name=value". 
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
-# put the command \sideeffect (or @sideeffect) in the documentation, which 
-# will result in a user-defined paragraph with heading "Side Effects:". 
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                = 
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
-# sources only. Doxygen will then generate output that is more tailored for C. 
-# For instance, some of the names that are used will be different. The list 
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
-# sources only. Doxygen will then generate output that is more tailored for 
-# Java. For instance, namespaces will be presented as packages, qualified 
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
-# sources only. Doxygen will then generate output that is more tailored for 
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
-# sources. Doxygen will then generate output that is tailored for 
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses. 
-# With this tag you can assign which parser to use for a given extension. 
-# Doxygen has a built-in mapping, but you can override or extend it using this tag. 
-# The format is ext=language, where ext is a file extension, and language is one of 
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set
-# FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING      = 
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
-# to include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to 
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
-# Doxygen will parse them like normal C++ but will assume all classes use public 
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter 
-# and setter methods for a property. Setting this option to YES (the default) 
-# will make doxygen to replace the get and set methods by a property in the 
-# documentation. This will only work if the methods are indeed getting or 
-# setting a simple type. If this is not the case, or you want to show the 
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
-# tag is set to YES, then doxygen will reuse the documentation of the first 
-# member in the group (if any) for the other members of the group. By default 
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
-# is documented as struct, union, or enum with the name of the typedef. So 
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
-# with name TypeT. When disabled the typedef will appear as a member of a file, 
-# namespace, or class. And the struct will be named TypeS. This can typically 
-# be useful for C code in case the coding convention dictates that all compound 
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
-# determine which symbols to keep in memory and which to flush to disk. 
-# When the cache is full, less often used symbols will be written to disk. 
-# For small to medium size projects (<1000 input files) the default value is 
-# probably good enough. For larger projects a too small cache size can cause 
-# doxygen to be busy swapping symbols to and from disk most of the time 
-# causing a significant performance penality. 
-# If the system has enough physical memory increasing the cache will improve the 
-# performance by keeping more symbols in memory. Note that the value works on 
-# a logarithmic scale so increasing the size by one will rougly double the 
-# memory usage. The cache size is given by this formula: 
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
-# will be included in the documentation.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
-# defined locally in source files will be included in the documentation. 
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be 
-# extracted and appear in the documentation as a namespace called 
-# 'anonymous_namespace{file}', where file will be replaced with the base 
-# name of the file that contains the anonymous namespace. By default 
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these classes will be included in the various 
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
-# friend (class|struct|union) declarations. 
-# If set to NO (the default) these declarations will be included in the 
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
-# documentation blocks found inside the body of a function. 
-# If set to NO (the default) these blocks will be appended to the 
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
-# file names in lower-case letters. If set to YES upper-case letters are also 
-# allowed. This is useful if you have classes or files whose names only differ 
-# in case and if your file system supports case sensitive file names. Windows 
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 
-# will list include files with double quotes in the documentation 
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES   = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
-# declaration order.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
-# hierarchy of group names into alphabetical order. If set to NO (the default) 
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
-# Note: This option applies only to the class list, not to the 
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or 
-# disable (NO) the todo list. This list is created by putting \todo 
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or 
-# disable (NO) the test list. This list is created by putting \test 
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or 
-# disable (NO) the bug list. This list is created by putting \bug 
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
-# disable (NO) the deprecated list. This list is created by putting 
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional 
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       = 
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consists of for it to appear in 
-# the documentation. If the initializer consists of more lines than specified 
-# here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
-# documentation can be controlled using \showinitializer or \hideinitializer 
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
-# at the bottom of the documentation of classes and structs. If set to YES the 
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
-# This will remove the Files entry from the Quick Index and from the 
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
-# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from 
-# the version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    = 
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
-# doxygen. The layout file controls the global structure of the generated output files 
-# in an output format independent way. The create the layout file that represents 
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
-# of the layout file.
-
-LAYOUT_FILE            = 
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated 
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
-# documentation.
-
-WARN_NO_PARAMDOC       = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning 
-# and error messages should be written. If left blank the output is written 
-# to stderr.
-
-WARN_LOGFILE           = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
-# with spaces.
-
-INPUT                  = ../../../Pluma/ \
-                         Doxygen.hpp
-
-# This tag can be used to specify the character encoding of the source files 
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
-# also the default input encoding. Doxygen uses libiconv (or the iconv built 
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS          = *.c \
-                         *.cc \
-                         *.cxx \
-                         *.cpp \
-                         *.c++ \
-                         *.d \
-                         *.java \
-                         *.ii \
-                         *.ixx \
-                         *.ipp \
-                         *.i++ \
-                         *.inl \
-                         *.hh \
-                         *.hxx \
-                         *.hpp \
-                         *.h++ \
-                         *.idl \
-                         *.odl \
-                         *.cs \
-                         *.php \
-                         *.php3 \
-                         *.inc \
-                         *.dox \
-                         *.py
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
-# should be searched for input files as well. Possible values are YES and NO. 
-# If left blank NO is used.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                = 
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
-# directories that are symbolic links (a Unix filesystem feature) are excluded 
-# from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = .svn \
-                         Linux \
-                         Unix \
-                         OSX*
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
-# (namespaces, classes, functions, etc.) that should be excluded from the 
-# output. The symbol name can be a fully qualified name, a word, or if the 
-# wildcard * is used, a substring. Examples: ANamespace, AClass, 
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        = priv
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
-# the \include command).
-
-EXAMPLE_PATH           = 
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank all files are included.
-
-EXAMPLE_PATTERNS       = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
-# searched for input files to be used with the \include or \dontinclude 
-# commands irrespective of the value of the RECURSIVE tag. 
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
-# the \image command).
-
-IMAGE_PATH             = 
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
-# ignored.
-
-INPUT_FILTER           = 
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
-
-FILTER_PATTERNS        = 
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
-# INPUT_FILTER) will be used to filter the input files when producing source 
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources. 
-# Note: To get rid of all source code in the generated output, make sure also 
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body 
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES 
-# then for each documented function all documented 
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES 
-# then for each documented function all documented entities 
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
-# link to the source code.  Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = NO
-
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .htm
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard header.
-
-HTML_HEADER            = header.htm
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard footer.
-
-HTML_FOOTER            = footer.htm
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET        = doxygen.css
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
-# page will contain the date and time when the page was generated. Setting 
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP         = YES
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
-# documentation will contain sections that can be hidden and shown after the 
-# page has loaded. For this to work a browser that supports 
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files 
-# will be generated that can be used as input for Apple's Xcode 3 
-# integrated development environment, introduced with OSX 10.5 (Leopard). 
-# To create a documentation set, doxygen will generate a Makefile in the 
-# HTML output directory. Running make will produce the docset in that 
-# directory and running "make install" will install the docset in 
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
-# it at startup. 
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET        = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
-# feed. A documentation feed provides an umbrella under which multiple 
-# documentation sets from a single provider (such as a company or product suite) 
-# can be grouped.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
-# should uniquely identify the documentation set bundle. This should be a 
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
-# be used to specify the file name of the resulting .chm file. You 
-# can add a path in front of the file if the result should not be 
-# written to the html output directory.
-
-CHM_FILE               = ../Pluma.chm
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
-# be used to specify the location (absolute path including file name) of 
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION           = "C:/Program Files/HTML Help Workshop/hhc.exe"
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
-# controls if a separate .chi index file is generated (YES) or that 
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
-# content.
-
-CHM_INDEX_ENCODING     = 
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
-# controls whether a binary table of contents is generated (YES) or a 
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members 
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
-# are set, an additional index file will be generated that can be used as input for 
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
-# HTML documentation.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
-# be used to specify the file name of the resulting .qch file. 
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE               = 
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 
-# For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   = 
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS  = 
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 
-# filter section matches. 
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS  = 
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
-# be used to specify the location of Qt's qhelpgenerator. 
-# If non-empty doxygen will try to run qhelpgenerator on the generated 
-# .qhp file.
-
-QHG_LOCATION           = 
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
-# will be generated, which together with the HTML files, form an Eclipse help  
-# plugin. To install this plugin and make it available under the help contents 
-# menu in Eclipse, the contents of the directory containing the HTML and XML 
-# files needs to be copied into the plugins directory of eclipse. The name of 
-# the directory within the plugins directory should be the same as 
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin 
-# the directory name containing the HTML and XML files should also have 
-# this name.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20]) 
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 1
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
-# structure should be generated to display hierarchical information. 
-# If the tag value is set to YES, a side panel will be generated 
-# containing a tree-like index structure (just like the one that 
-# is generated for HTML Help). For this to work a browser that supports 
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES       = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
-# used to set the initial width (in pixels) of the frame in which the tree 
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-# Use this tag to change the font size of Latex formulas included 
-# as images in the HTML documentation. The default is 10. Note that 
-# when you change the font size after a successful doxygen run you need 
-# to manually remove any form_*.png images from the HTML output directory 
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript 
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should 
-# typically be disabled. For large projects the javascript based search engine 
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE           = NO
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index 
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvances is that it is more difficult to setup 
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
-# generate Latex output.
-
-GENERATE_LATEX         = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
-# invoked. If left blank `latex' will be used as the default command name. 
-# Note that when enabling USE_PDFLATEX this option is only used for 
-# generating bitmaps for formulas in the HTML output, but not in the 
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
-# generate index for LaTeX. If left blank `makeindex' will be used as the 
-# default command name.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         = 
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           = 
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
-# plain latex in the generated Makefile. Set this option to YES to get a 
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE      = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# The RTF output is optimized for Word 97 and may not look very pretty with 
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using WORD or other 
-# programs which support those fields. 
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's 
-# config file, i.e. a series of assignments. You only have to provide 
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    = 
-
-# Set optional variables used in the generation of an rtf document. 
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
-# generate man pages
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to 
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
-# then it will generate one additional man file for each entity 
-# documented in the real man page(s). These additional files 
-# only source the real man page, but without them the man command 
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will 
-# generate an XML file that captures the structure of 
-# the code including all documentation.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_SCHEMA             = 
-
-# The XML_DTD tag can be used to specify an XML DTD, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_DTD                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
-# generate an AutoGen Definitions (see autogen.sf.net) file 
-# that captures the structure of the code including all 
-# documentation. Note that this feature is still experimental 
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
-# generate a Perl module file that captures the structure of 
-# the code including all documentation. Note that this 
-# feature is still experimental and incomplete at the 
-# moment.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
-# nicely formatted so it can be parsed by a human reader.  This is useful 
-# if you want to understand what is going on.  On the other hand, if this 
-# tag is set to NO the size of the Perl module output will be much smaller 
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file 
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
-# This is useful so different doxyrules.make files included by the same 
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX = 
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. Macro expansion can be done in a controlled 
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF     = YES
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
-# the preprocessor.
-
-INCLUDE_PATH           = 
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
-# patterns (like *.h and *.hpp) to filter out the header-files in the 
-# directories. If left blank, the patterns specified with FILE_PATTERNS will 
-# be used.
-
-INCLUDE_FILE_PATTERNS  = 
-
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
-# instead of the = operator.
-
-PREDEFINED             = 
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
-# this tag can be used to specify a list of macro names that should be expanded. 
-# The macro definition that is found in the sources will be used. 
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      = 
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line, have an all uppercase name, and do not end with a semicolon. Such 
-# function macros are typically used for boiler-plate code, and will confuse 
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
-# does not have to be run to correct the links. 
-# Note that each tag file must have a unique name 
-# (where the name does NOT include the path) 
-# If a tag file is not located in the directory in which doxygen 
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES               = 
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       = 
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
-# in the modules index. If set to NO, only the current project's groups will 
-# be listed.
-
-EXTERNAL_GROUPS        = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script 
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
-# or super classes. Setting the tag to NO turns the diagrams off. Note that 
-# this option is superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc 
-# command. Doxygen will then run the mscgen tool (see 
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
-# the mscgen tool resides. If left empty the tool is assumed to be found in the 
-# default search path.
-
-MSCGEN_PATH            = D:/Programmes/mscgen
-
-# If set to YES, the inheritance and collaboration graphs will hide 
-# inheritance and usage relations if the target is undocumented 
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = NO
-
-# By default doxygen will write a font called FreeSans.ttf to the output 
-# directory and reference it in all dot files that doxygen generates. This 
-# font does not include all possible unicode characters however, so when you need 
-# these (or just want a differently looking font) you can specify the font name 
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
-# which can be done by putting it in a standard location or by setting the 
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
-# containing the font.
-
-DOT_FONTNAME           = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
-# The default size is 10pt.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the output directory to look for the 
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
-# different font using DOT_FONTNAME you can set the path where dot 
-# can find it using this tag.
-
-DOT_FONTPATH           = 
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
-# Language.
-
-UML_LOOK               = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the 
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
-# tags are set to YES then doxygen will generate a graph for each documented 
-# file showing the direct and indirect include dependencies of the file with 
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
-# documented header file showing the documented files that directly or 
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
-# doxygen will generate a call dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable call graphs 
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
-# doxygen will generate a caller dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable caller 
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
-# in a graphical way. The dependency relations are determined by the #include 
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
-# generated by dot. Possible values are png, jpg, or gif 
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT       = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH               = 
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that 
-# contain dot files that are included in the documentation (see the 
-# \dotfile command).
-
-DOTFILE_DIRS           = 
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
-# nodes that will be shown in the graph. If the number of nodes in a graph 
-# becomes larger than this value, doxygen will truncate the graph, which is 
-# visualized by representing a node as a red box. Note that doxygen if the 
-# number of direct children of the root node in a graph is already larger than 
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes 
-# that lay further from the root node will be omitted. Note that setting this 
-# option to 1 or 2 may greatly reduce the computation time needed for large 
-# code bases. Also note that the size of a graph can be further restricted by 
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, because dot on Windows does not 
-# seem to support this out of the box. Warning: Depending on the platform used, 
-# enabling this option may lead to badly anti-aliased labels on the edges of 
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
-# generate a legend page explaining the meaning of the various boxes and 
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
-# remove the intermediate dot files that are used to generate 
-# the various graphs.
-
-DOT_CLEANUP            = YES
diff --git a/doc/third_party/Pluma/build/Doxygen.hpp b/doc/third_party/Pluma/build/Doxygen.hpp
deleted file mode 100644 (file)
index 9b307a1..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-////////////////////////////////////////////////////////////\r
-/// \mainpage\r
-///\r
-/// \section welcome Welcome\r
-/// Welcome to Pluma documentation. Here you will find a detailed\r
-/// view of all Pluma <a href="./annotated.htm">classes</a>.<br>\r
-/// If you are looking for support, you can visit the official website\r
-/// at <a href="http://pluma-framework.sourceforge.net/">http://pluma-framework.sourceforge.net/</a>.<br><br>\r
-///\r
-/// CSS based on <a href="http://www.sfml-dev.org/documentation/1.6/">SFML1.6 documentation</a><br>\r
-///\r
-/// \section example Short Example\r
-/// A short example to demonstrate Pluma usage:<br>\r
-/// A host application define a Device interface. A certain plugin\r
-/// defines a Keyboard, witch is a Device.\r
-/// The host will use DeviceProviders to create objects of type Device.\r
-/// The plugin will provide host specifically with a KeyboardProvider.<br>\r
-///\r
-/// Device hpp (shared):\r
-/// \code\r
-/// #include <Pluma/Pluma.hpp>\r
-/// class Device{\r
-/// public:\r
-///     virtual std::string getDescription() const = 0;\r
-/// };\r
-/// // create DevicedProvider class\r
-/// PLUMA_PROVIDER_HEADER(Device);\r
-/// \endcode\r
-///\r
-/// Device cpp (shared):\r
-/// \code\r
-/// #include "Device.hpp"\r
-/// generate DevicedProvider with version 6, and compatible with at least v.3\r
-/// PLUMA_PROVIDER_SOURCE(Device, 6, 3);\r
-/// \endcode\r
-///\r
-///\r
-/// <br>\r
-/// Keyboard code on the plugin side:\r
-/// \code\r
-/// #include <Pluma/Pluma.hpp>\r
-/// #include "Device.hpp"\r
-///\r
-/// class Keyboard: public Device{\r
-/// public:\r
-///     std::string getDescription() const{\r
-///         return "keyboard";\r
-///     }\r
-/// };\r
-///\r
-/// // create KeyboardProvider, it implements DeviceProvider\r
-/// PLUMA_INHERIT_PROVIDER(Keyboard, Device);\r
-/// \endcode\r
-///\r
-/// plugin connector:\r
-/// \code\r
-/// #include <Pluma/Connector.hpp>\r
-/// #include "Keyboard.hpp"\r
-///\r
-/// PLUMA_CONNECTOR\r
-/// bool connect(pluma::Host& host){\r
-///     // add a keyboard provider to host\r
-///     host.add( new KeyboardProvider() );\r
-///     return true;\r
-/// }\r
-/// \endcode\r
-///\r
-///\r
-/// Host application code:\r
-/// \code\r
-/// #include <Pluma/Pluma.hpp>\r
-///\r
-/// #include "Device.hpp"\r
-/// #include <iostream>\r
-/// #include <vector>\r
-///\r
-/// int main(){\r
-///\r
-///     pluma::Pluma plugins;\r
-///     // Tell plugins manager to accept providers of the type DeviceProvider\r
-///     plugins.acceptProviderType<DeviceProvider>();\r
-///     // Load library "standard_devices" from folder "plugins"\r
-///     plugins.load("plugins", "standard_devices");\r
-///\r
-///     // Get device providers into a vector\r
-///     std::vector<DeviceProvider*> providers;\r
-///     plugins.getProviders(providers);\r
-///\r
-///     // create a Device from the first provider\r
-///     if (!providers.empty()){\r
-///         Device* myDevice = providers.first()->create();\r
-///         // do something with myDevice\r
-///         std::cout << device->getDescription() << std::endl;\r
-///         // and delete it in the end\r
-///         delete myDevice;\r
-///     }\r
-///     return 0;\r
-/// }\r
-/// \endcode\r
-///\r
-////////////////////////////////////////////////////////////\r
diff --git a/doc/third_party/Pluma/build/doxygen.css b/doc/third_party/Pluma/build/doxygen.css
deleted file mode 100644 (file)
index de219ac..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-div#logo\r
-{\r
-    margin-bottom : 1em;\r
-    background    : url("./logo-bg.jpg") repeat-x;\r
-}\r
-\r
-div#logo a\r
-{\r
-    display : block;\r
-}\r
-\r
-p#footer\r
-{\r
-    text-decoration : overline;\r
-    color           : #606060;\r
-    padding-top     : 1em;\r
-    text-align      : center;\r
-    font-size       : smaller;\r
-}\r
-\r
-p#footer a\r
-{\r
-    color           : #007298;\r
-    text-decoration : none;\r
-}\r
-\r
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {\r
-       font-family: Geneva, Arial, Helvetica, sans-serif;\r
-}\r
-BODY,TD {\r
-       font-size: 90%;\r
-}\r
-H1 {\r
-    text-align    : center;\r
-    margin-top    : 0px;\r
-    color         : #2090B0;\r
-    font-size     : 160%;\r
-}\r
-H2 {\r
-       font-size: 120%;\r
-}\r
-H3 {\r
-       font-size: 100%;\r
-}\r
-CAPTION { font-weight: bold }\r
-DIV.qindex {\r
-       width: 100%;\r
-       background-color: #E0FFE0;\r
-       border: 1px dotted #808080;\r
-       text-align: center;\r
-       margin: 2px;\r
-       padding: 2px;\r
-       line-height: 140%;\r
-}\r
-DIV.nav {\r
-       width: 100%;\r
-       background-color: #e8eef2;\r
-       border: 1px solid #84b0c7;\r
-       text-align: center;\r
-       margin: 2px;\r
-       padding: 2px;\r
-       line-height: 140%;\r
-}\r
-DIV.navtab {\r
-       background-color: #e8eef2;\r
-       border: 1px solid #84b0c7;\r
-       text-align: center;\r
-       margin: 2px;\r
-       margin-right: 15px;\r
-       padding: 2px;\r
-}\r
-TD.navtab {\r
-       font-size: 70%;\r
-}\r
-A.qindex {\r
-       text-decoration: none;\r
-       font-weight: bold;\r
-}\r
-A.qindex:visited {\r
-       text-decoration: none;\r
-       font-weight: bold;\r
-}\r
-A.qindex:hover {\r
-       text-decoration: none;\r
-       background-color: #ddddff;\r
-}\r
-A.qindexHL {\r
-       text-decoration: none;\r
-       font-weight: bold;\r
-       background-color: #6666cc;\r
-       color: #ffffff;\r
-       border: 1px double #9295C2;\r
-}\r
-A.qindexHL:hover {\r
-       text-decoration: none;\r
-       background-color: #6666cc;\r
-       color: #ffffff;\r
-}\r
-A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }\r
-A.el { text-decoration: none; font-weight: bold }\r
-A.elRef { font-weight: bold }\r
-A.code:link { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;}\r
-A.code:visited { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;}\r
-A.codeRef:link { font-weight: normal; color: #0000FF}\r
-A.codeRef:visited { font-weight: normal; color: #0000FF}\r
-/*A:hover { text-decoration: none; background-color: #f2f2ff }*/\r
-DL.el { margin-left: -1cm }\r
-.fragment {\r
-       font-family: monospace, fixed;\r
-       font-size: 95%;\r
-}\r
-PRE.fragment {\r
-       border: 1px solid #CCCCCC;\r
-       background-color: #f5f5f5;\r
-       margin-top: 4px;\r
-       margin-bottom: 4px;\r
-       margin-left: 2px;\r
-       margin-right: 8px;\r
-       padding-left: 6px;\r
-       padding-right: 6px;\r
-       padding-top: 4px;\r
-       padding-bottom: 4px;\r
-}\r
-DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\r
-\r
-DIV.groupHeader {\r
-       margin-left: 16px;\r
-       margin-top: 12px;\r
-       margin-bottom: 6px;\r
-       font-weight: bold;\r
-}\r
-DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }\r
-BODY {\r
-       background: white;\r
-       color: black;\r
-       margin-right: 20px;\r
-       margin-left: 20px;\r
-}\r
-TD.indexkey {\r
-       background-color: #e8eef2;\r
-       font-weight: bold;\r
-       padding-right  : 10px;\r
-       padding-top    : 2px;\r
-       padding-left   : 10px;\r
-       padding-bottom : 2px;\r
-       margin-left    : 0px;\r
-       margin-right   : 0px;\r
-       margin-top     : 2px;\r
-       margin-bottom  : 2px;\r
-       border: 1px solid #CCCCCC;\r
-}\r
-TD.indexvalue {\r
-       background-color: #e8eef2;\r
-       font-style: italic;\r
-       padding-right  : 10px;\r
-       padding-top    : 2px;\r
-       padding-left   : 10px;\r
-       padding-bottom : 2px;\r
-       margin-left    : 0px;\r
-       margin-right   : 0px;\r
-       margin-top     : 2px;\r
-       margin-bottom  : 2px;\r
-       border: 1px solid #CCCCCC;\r
-}\r
-TR.memlist {\r
-   background-color: #f0f0f0; \r
-}\r
-P.formulaDsp { text-align: center; }\r
-IMG.formulaDsp { }\r
-IMG.formulaInl { vertical-align: middle; }\r
-SPAN.keyword       { color: #0000FF }\r
-SPAN.keywordtype   { color: #0000FF }\r
-SPAN.keywordflow   { color: #0000FF }\r
-SPAN.comment       { color: #008000 }\r
-SPAN.preprocessor  { color: #008080 }\r
-SPAN.stringliteral { color: #008080 }\r
-SPAN.charliteral   { color: #008080 }\r
-.mdescLeft {\r
-       padding: 0px 8px 4px 8px;\r
-       font-size: 80%;\r
-       font-style: italic;\r
-       background-color: #FAFAFA;\r
-       border-top: 1px none #E0E0E0;\r
-       border-right: 1px none #E0E0E0;\r
-       border-bottom: 1px none #E0E0E0;\r
-       border-left: 1px none #E0E0E0;\r
-       margin: 0px;\r
-}\r
-.mdescRight {\r
-       padding: 0px 8px 4px 8px;\r
-       font-size: 80%;\r
-       font-style: italic;\r
-       background-color: #FAFAFA;\r
-       border-top: 1px none #E0E0E0;\r
-       border-right: 1px none #E0E0E0;\r
-       border-bottom: 1px none #E0E0E0;\r
-       border-left: 1px none #E0E0E0;\r
-       margin: 0px;\r
-}\r
-.memItemLeft {\r
-       padding: 1px 0px 0px 8px;\r
-       margin: 4px;\r
-       border-top-width: 1px;\r
-       border-right-width: 1px;\r
-       border-bottom-width: 1px;\r
-       border-left-width: 1px;\r
-       border-top-color: #E0E0E0;\r
-       border-right-color: #E0E0E0;\r
-       border-bottom-color: #E0E0E0;\r
-       border-left-color: #E0E0E0;\r
-       border-top-style: solid;\r
-       border-right-style: none;\r
-       border-bottom-style: none;\r
-       border-left-style: none;\r
-       background-color: #FAFAFA;\r
-       font-size: 80%;\r
-}\r
-.memItemRight {\r
-       padding: 1px 8px 0px 8px;\r
-       margin: 4px;\r
-       border-top-width: 1px;\r
-       border-right-width: 1px;\r
-       border-bottom-width: 1px;\r
-       border-left-width: 1px;\r
-       border-top-color: #E0E0E0;\r
-       border-right-color: #E0E0E0;\r
-       border-bottom-color: #E0E0E0;\r
-       border-left-color: #E0E0E0;\r
-       border-top-style: solid;\r
-       border-right-style: none;\r
-       border-bottom-style: none;\r
-       border-left-style: none;\r
-       background-color: #FAFAFA;\r
-       font-size: 80%;\r
-}\r
-.memTemplItemLeft {\r
-       padding: 1px 0px 0px 8px;\r
-       margin: 4px;\r
-       border-top-width: 1px;\r
-       border-right-width: 1px;\r
-       border-bottom-width: 1px;\r
-       border-left-width: 1px;\r
-       border-top-color: #E0E0E0;\r
-       border-right-color: #E0E0E0;\r
-       border-bottom-color: #E0E0E0;\r
-       border-left-color: #E0E0E0;\r
-       border-top-style: none;\r
-       border-right-style: none;\r
-       border-bottom-style: none;\r
-       border-left-style: none;\r
-       background-color: #FAFAFA;\r
-       font-size: 80%;\r
-}\r
-.memTemplItemRight {\r
-       padding: 1px 8px 0px 8px;\r
-       margin: 4px;\r
-       border-top-width: 1px;\r
-       border-right-width: 1px;\r
-       border-bottom-width: 1px;\r
-       border-left-width: 1px;\r
-       border-top-color: #E0E0E0;\r
-       border-right-color: #E0E0E0;\r
-       border-bottom-color: #E0E0E0;\r
-       border-left-color: #E0E0E0;\r
-       border-top-style: none;\r
-       border-right-style: none;\r
-       border-bottom-style: none;\r
-       border-left-style: none;\r
-       background-color: #FAFAFA;\r
-       font-size: 80%;\r
-}\r
-.memTemplParams {\r
-       padding: 1px 0px 0px 8px;\r
-       margin: 4px;\r
-       border-top-width: 1px;\r
-       border-right-width: 1px;\r
-       border-bottom-width: 1px;\r
-       border-left-width: 1px;\r
-       border-top-color: #E0E0E0;\r
-       border-right-color: #E0E0E0;\r
-       border-bottom-color: #E0E0E0;\r
-       border-left-color: #E0E0E0;\r
-       border-top-style: solid;\r
-       border-right-style: none;\r
-       border-bottom-style: none;\r
-       border-left-style: none;\r
-       color: #606060;\r
-       background-color: #FAFAFA;\r
-       font-size: 80%;\r
-}\r
-.search     { color: #003399;\r
-              font-weight: bold;\r
-}\r
-FORM.search {\r
-              margin-bottom: 0px;\r
-              margin-top: 0px;\r
-}\r
-INPUT.search { font-size: 75%;\r
-               color: #000080;\r
-               font-weight: normal;\r
-               background-color: #e8eef2;\r
-}\r
-TD.tiny      { font-size: 75%;\r
-}\r
-a {\r
-       color: #2090B0;\r
-}\r
-a:visited {\r
-       color: #2090B0;\r
-}\r
-.dirtab { padding: 4px;\r
-          border-collapse: collapse;\r
-          border: 1px solid #84b0c7;\r
-}\r
-TH.dirtab { background: #e8eef2;\r
-            font-weight: bold;\r
-}\r
-HR { height: 1px;\r
-     border: none;\r
-     border-top: 1px solid black;\r
-}\r
-\r
-/* Style for detailed member documentation */\r
-.memtemplate {\r
-  font-size: 80%;\r
-  color: #606060;\r
-  font-weight: normal;\r
-} \r
-.memnav { \r
-  background-color: #e8eef2;\r
-  border: 1px solid #84b0c7;\r
-  text-align: center;\r
-  margin: 2px;\r
-  margin-right: 15px;\r
-  padding: 2px;\r
-}\r
-.memitem {\r
-  /*padding: 4px;*/\r
-  background-color: #F0FFF0;\r
-  border-width: 1px;\r
-  border-style: solid;\r
-  border-color: #808080;\r
-  /*-moz-border-radius: 8px 8px 8px 8px;*/\r
-}\r
-.memname {\r
-  white-space: nowrap;\r
-  font-weight: bold;\r
-}\r
-.memdoc{\r
-  padding-left: 10px;\r
-}\r
-.memproto {\r
-  background-color: #D0FFD0;\r
-  width: 100%;\r
-  border-bottom-width: 1px;\r
-  border-bottom-style: dotted;\r
-  border-bottom-color: #808080;\r
-  font-weight: bold;\r
-  /*-moz-border-radius: 8px 8px 8px 8px;*/\r
-}\r
-.paramkey {\r
-  text-align: right;\r
-}\r
-.paramtype {\r
-  white-space: nowrap;\r
-}\r
-.paramname {\r
-  color: #602020;\r
-  font-style: italic;\r
-  white-space: nowrap;\r
-}\r
-/* End Styling for detailed member documentation */\r
-\r
-/* for the tree view */\r
-.ftvtree {\r
-       font-family: sans-serif;\r
-       margin:0.5em;\r
-}\r
-.directory { font-size: 9pt; font-weight: bold; }\r
-.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }\r
-.directory > h3 { margin-top: 0; }\r
-.directory p { margin: 0px; white-space: nowrap; }\r
-.directory div { display: none; margin: 0px; }\r
-.directory img { vertical-align: -30%; }\r
diff --git a/doc/third_party/Pluma/build/footer.htm b/doc/third_party/Pluma/build/footer.htm
deleted file mode 100644 (file)
index 0681f33..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-\r
-        <p id="footer">\r
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;\r
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;\r
-        </p>\r
-\r
-    </body>\r
-</html>\r
diff --git a/doc/third_party/Pluma/build/header.htm b/doc/third_party/Pluma/build/header.htm
deleted file mode 100644 (file)
index e7890bd..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
-<html>\r
-    <head>\r
-        <title>Pluma - Plug-in Management Framework</title>\r
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />\r
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />\r
-        <link href="tabs.css" rel="stylesheet" type="text/css" />\r
-    </head>\r
-    <body>\r
-        <div id="logo">\r
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />\r
-        </div>\r
diff --git a/doc/third_party/Pluma/html/Config_8hpp_source.htm b/doc/third_party/Pluma/html/Config_8hpp_source.htm
deleted file mode 100644 (file)
index fb54cd0..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Config.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">// Based on SFML configuration header</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// SFML Config.hpp:</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">// http://www.sfml-dev.org/documentation/2.0/Config_8hpp-source.htm</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">// Acknowledgements to Simple and Fast Multimedia Library</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment">// http://www.sfml-dev.org/</span></div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#ifndef PLUMA_CONFIG_HPP</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_CONFIG_HPP</span></div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">// Identify the operating system</span></div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment"></span><span class="preprocessor">#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="comment">// Windows</span></div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">    #define PLUMA_SYS_WINDOWS</span></div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #ifndef WIN32_LEAN_AND_MEAN</span></div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor"></span><span class="preprocessor">        #define WIN32_LEAN_AND_MEAN</span></div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #ifndef NOMINMAX</span></div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor"></span><span class="preprocessor">        #define NOMINMAX</span></div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#elif defined(linux) || defined(__linux)</span></div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="comment">// Linux</span></div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">    #define PLUMA_SYS_LINUX</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="comment">// MacOS</span></div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">    #define PLUMA_SYS_MACOS</span></div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)</span></div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="comment">// FreeBSD</span></div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">    #define PLUMA_SYS_FREEBSD</span></div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="comment">// Unsupported system</span></div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">    #error This operating system is not supported by this library</span></div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment">// Define library file extension based on OS</span></div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="comment"></span><span class="preprocessor">#ifdef PLUMA_SYS_WINDOWS</span></div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor"></span><span class="preprocessor">     #define PLUMA_LIB_EXTENSION &quot;dll&quot;</span></div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#elif defined(PLUMA_SYS_MACOS)</span></div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor"></span><span class="preprocessor">     #define PLUMA_LIB_EXTENSION &quot;dylib&quot;</span></div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#elif defined(PLUMA_SYS_LINUX) || defined(PLUMA_SYS_FREEBSD)</span></div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor"></span><span class="preprocessor">     #define PLUMA_LIB_EXTENSION &quot;so&quot;</span></div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#else</span></div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor"></span>   <span class="comment">// unknown library file type</span></div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">    #error Unknown library file extension for this operating system</span></div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">// Define portable import / export macros</span></div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment"></span><span class="preprocessor">#if defined(PLUMA_SYS_WINDOWS)</span></div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="preprocessor">    #ifndef PLUMA_STATIC</span></div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="comment">// Windows platforms</span></div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="preprocessor">        #ifdef PLUMA_EXPORTS</span></div>
-<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            <span class="comment">// From DLL side, we must export</span></div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="preprocessor">            #define PLUMA_API __declspec(dllexport)</span></div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="preprocessor">        #else</span></div>
-<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            <span class="comment">// From client application side, we must import</span></div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="preprocessor">            #define PLUMA_API __declspec(dllimport)</span></div>
-<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="preprocessor">        #endif</span></div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="comment">// For Visual C++ compilers, we also need to turn off this annoying C4251 warning.</span></div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="comment">// You can read lots ot different things about it, but the point is the code will</span></div>
-<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="comment">// just work fine, and so the simplest way to get rid of this warning is to disable it</span></div>
-<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">        #ifdef _MSC_VER</span></div>
-<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="preprocessor">            #pragma warning(disable : 4251)</span></div>
-<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">        #endif</span></div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">    #else</span></div>
-<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="comment">// No specific directive needed for static build</span></div>
-<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="preprocessor">        #define PLUMA_API</span></div>
-<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="comment">// Other platforms don&#39;t need to define anything</span></div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="preprocessor">    #define PLUMA_API</span></div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div>
-<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div>
-<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div>
-<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="preprocessor">#endif // PLUMA_CONFIG_HPP</span></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Connector_8hpp_source.htm b/doc/third_party/Pluma/html/Connector_8hpp_source.htm
deleted file mode 100644 (file)
index 5a36cdf..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Connector.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_CONNECTOR_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_CONNECTOR_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">// Define portable import/export macros for Plugin registration</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"></span><span class="preprocessor">#if defined(PLUMA_SYS_WINDOWS)</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">    #ifndef PLUMA_STATIC_PLUGIN</span></div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;         <span class="comment">// Windows platforms</span></div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">        #ifndef PLUGIN_IMPORTS</span></div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            <span class="comment">// From DLL side, we must export</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">            #ifdef __cplusplus</span></div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor"></span><span class="preprocessor">               #define PLUMA_CONNECTOR extern &quot;C&quot; __declspec(dllexport)</span></div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor"></span><span class="preprocessor">            #else</span></div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor"></span><span class="preprocessor">               #define PLUMA_CONNECTOR __declspec(dllexport)</span></div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor"></span><span class="preprocessor">            #endif</span></div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">        #else</span></div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <span class="comment">// From client application side, we must import</span></div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">            #ifdef __cplusplus</span></div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor"></span><span class="preprocessor">               #define PLUMA_CONNECTOR extern &quot;C&quot; __declspec(dllimport)</span></div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor"></span><span class="preprocessor">            #else</span></div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor"></span><span class="preprocessor">               #define PLUMA_CONNECTOR __declspec(dllimport)</span></div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor"></span><span class="preprocessor">            #endif</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">        #endif</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">    #else</span></div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <span class="comment">// Only define the extern &quot;C&quot; for static build</span></div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">        #ifdef __cplusplus</span></div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor"></span><span class="preprocessor">           #define PLUMA_CONNECTOR extern &quot;C&quot;</span></div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor"></span><span class="preprocessor">        #else</span></div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor"></span><span class="preprocessor">           #define PLUMA_CONNECTOR</span></div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor"></span><span class="preprocessor">        #endif</span></div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="comment">// Only define the extern &quot;C&quot; for other platforms</span></div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">    #ifdef __cplusplus</span></div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="preprocessor"></span><span class="preprocessor">       #define PLUMA_CONNECTOR extern &quot;C&quot;</span></div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #else</span></div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor"></span><span class="preprocessor">       #define PLUMA_CONNECTOR</span></div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor">#endif // PLUMA_CONNECTOR_HPP</span></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/DLibrary_8cpp_source.htm b/doc/third_party/Pluma/html/DLibrary_8cpp_source.htm
deleted file mode 100644 (file)
index e4e4562..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">DLibrary.cpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/DLibrary.hpp&gt;</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
-<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">   37</a></span>&#160;<a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>* <a class="code" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">DLibrary::load</a>(<span class="keyword">const</span> std::string&amp; path){</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">if</span> ( path.empty() ){</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Failed to load library: Empty path\n&quot;</span>);</div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    }</div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">void</span>* handle = NULL;</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="comment">// load library - OS dependent operation</span></div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">    #ifdef PLUMA_SYS_WINDOWS</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor"></span>        handle = ::LoadLibraryA(path.c_str());</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="keywordflow">if</span> (!handle){</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;            fprintf(stderr, <span class="stringliteral">&quot;Failed to load library \&quot;%s\&quot;.\n&quot;</span>, path.c_str());</div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        }</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">    #else</span></div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor"></span>        handle = ::dlopen(path.c_str(), RTLD_NOW);</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordflow">if</span> (!handle){</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <span class="keyword">const</span> <span class="keywordtype">char</span>* errorString = ::dlerror();</div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            fprintf(stderr, <span class="stringliteral">&quot;Failed to load library \&quot;%s\&quot;.&quot;</span>, path.c_str());</div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;            <span class="keywordflow">if</span>(errorString) fprintf(stderr, <span class="stringliteral">&quot; OS returned error: \&quot;%s\&quot;.&quot;</span>, errorString);</div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            fprintf(stderr, <span class="stringliteral">&quot;\n&quot;</span>);</div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        }</div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor"></span>    <span class="comment">// return a DLibrary with the DLL handle</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>(handle);</div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;}</div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div>
-<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">   67</a></span>&#160;<a class="code" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">DLibrary::~DLibrary</a>(){</div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordflow">if</span> (handle){</div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">        #ifdef PLUMA_SYS_WINDOWS</span></div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor"></span>            ::FreeLibrary( (HMODULE)handle );</div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">        #else</span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor"></span>            ::dlclose(handle);</div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">        #endif</span></div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor"></span>    }</div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;}</div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
-<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">   79</a></span>&#160;<span class="keywordtype">void</span>* <a class="code" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">DLibrary::getSymbol</a>(<span class="keyword">const</span> std::string&amp; symbol){</div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">if</span> (!handle){</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Cannot inspect library symbols, library isn&#39;t loaded.\n&quot;</span>);</div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    }</div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="keywordtype">void</span>* res;</div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">    #ifdef PLUMA_SYS_WINDOWS</span></div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor"></span>        res = (<span class="keywordtype">void</span>*)(::GetProcAddress((HMODULE)handle, symbol.c_str()));</div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor">    #else</span></div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor"></span>        res = (<span class="keywordtype">void</span>*)(::dlsym(handle, symbol.c_str()));</div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor">    #endif</span></div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor"></span>    <span class="keywordflow">if</span> (!res){</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Library symbol \&quot;%s\&quot; not found.\n&quot;</span>, symbol.c_str());</div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">return</span> res;</div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;}</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;DLibrary::DLibrary(<span class="keywordtype">void</span>* handle):</div>
-<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    handle(handle)</div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;{</div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="comment">// Nothing to do</span></div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;}</div>
-<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a32400d8e50c0f03cb525ca7500b4516e"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">pluma::DLibrary::load</a></div><div class="ttdeci">static DLibrary * load(const std::string &amp;path)</div><div class="ttdoc">Load a library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00037">DLibrary.cpp:37</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm"><div class="ttname"><a href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a></div><div class="ttdoc">Manages a Dynamic Linking Library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8hpp_source.htm#l00049">DLibrary.hpp:49</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a57dd3726140cce08957e40cb5b001d84"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">pluma::DLibrary::getSymbol</a></div><div class="ttdeci">void * getSymbol(const std::string &amp;symbol)</div><div class="ttdoc">Get a symbol from the library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00079">DLibrary.cpp:79</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a3fa679bc824b36ce61b67716bedd15c7"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">pluma::DLibrary::~DLibrary</a></div><div class="ttdeci">~DLibrary()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00067">DLibrary.cpp:67</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/DLibrary_8hpp_source.htm b/doc/third_party/Pluma/html/DLibrary_8hpp_source.htm
deleted file mode 100644 (file)
index 6030a7a..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">DLibrary.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_DYNAMIC_LIBRARY_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_DYNAMIC_LIBRARY_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">// include OS dependent support for DLL</span></div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#ifdef PLUMA_SYS_WINDOWS</span></div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #include &lt;Windows.h&gt;</span></div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #include &lt;dlfcn.h&gt;</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
-<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classpluma_1_1DLibrary.htm">   49</a></span>&#160;<span class="keyword">class </span><a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>{</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keyword">static</span> <a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>* <a class="code" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">load</a>(<span class="keyword">const</span> std::string&amp; path);</div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">~DLibrary</a>();</div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keywordtype">void</span>* <a class="code" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">getSymbol</a>(<span class="keyword">const</span> std::string&amp; symbol);</div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>();</div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
-<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>(<span class="keywordtype">void</span>* handle);</div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div>
-<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="comment">// Member data</span></div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
-<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordtype">void</span>* handle; </div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div>
-<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;};</div>
-<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div>
-<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
-<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div>
-<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="preprocessor">#endif // PLUMA_DYNAMIC_LIBRARY_HPP</span></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a32400d8e50c0f03cb525ca7500b4516e"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">pluma::DLibrary::load</a></div><div class="ttdeci">static DLibrary * load(const std::string &amp;path)</div><div class="ttdoc">Load a library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00037">DLibrary.cpp:37</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm"><div class="ttname"><a href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a></div><div class="ttdoc">Manages a Dynamic Linking Library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8hpp_source.htm#l00049">DLibrary.hpp:49</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a57dd3726140cce08957e40cb5b001d84"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">pluma::DLibrary::getSymbol</a></div><div class="ttdeci">void * getSymbol(const std::string &amp;symbol)</div><div class="ttdoc">Get a symbol from the library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00079">DLibrary.cpp:79</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a3fa679bc824b36ce61b67716bedd15c7"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">pluma::DLibrary::~DLibrary</a></div><div class="ttdeci">~DLibrary()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00067">DLibrary.cpp:67</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Dir_8cpp_source.htm b/doc/third_party/Pluma/html/Dir_8cpp_source.htm
deleted file mode 100644 (file)
index 8c2d4c2..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Dir.cpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Dir.hpp&gt;</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;Pluma/uce-dirent.h&gt;</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;queue&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">namespace </span>dir{</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keywordtype">void</span> listFiles(std::list&lt;std::string&gt;&amp; list, <span class="keyword">const</span> std::string&amp; folder, <span class="keyword">const</span> std::string&amp; extension, <span class="keywordtype">bool</span> recursive){</div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    DIR* dir;</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    DIR* subDir;</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keyword">struct </span>dirent *ent;</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="comment">// try to open top folder</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    dir = opendir(folder.c_str());</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordflow">if</span> (dir == NULL){</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="comment">// could not open directory</span></div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;      fprintf(stderr, <span class="stringliteral">&quot;Could not open \&quot;%s\&quot; directory.\n&quot;</span>, folder.c_str());</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;      <span class="keywordflow">return</span>;</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    }<span class="keywordflow">else</span>{</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <span class="comment">// close, we&#39;ll process it next</span></div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        closedir(dir);</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    }</div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="comment">// enqueue top folder</span></div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    std::queue&lt;std::string&gt; folders;</div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    folders.push(folder);</div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="comment">// run while has queued folders</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordflow">while</span> (!folders.empty()){</div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        std::string currFolder = folders.front();</div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        folders.pop();</div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        dir = opendir(currFolder.c_str());</div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <span class="keywordflow">if</span> (dir == NULL) <span class="keywordflow">continue</span>;</div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <span class="comment">// iterate through all the files and directories</span></div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <span class="keywordflow">while</span> ((ent = readdir (dir)) != NULL) {</div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            std::string name(ent-&gt;d_name);</div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;            <span class="comment">// ignore &quot;.&quot; and &quot;..&quot; directories</span></div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            <span class="keywordflow">if</span> ( name.compare(<span class="stringliteral">&quot;.&quot;</span>) == 0 || name.compare(<span class="stringliteral">&quot;..&quot;</span>) == 0) <span class="keywordflow">continue</span>;</div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            <span class="comment">// add path to the file name</span></div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            std::string path = currFolder;</div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            path.append(<span class="stringliteral">&quot;/&quot;</span>);</div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            path.append(name);</div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            <span class="comment">// check if it&#39;s a folder by trying to open it</span></div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            subDir = opendir(path.c_str());</div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            <span class="keywordflow">if</span> (subDir != NULL){</div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                <span class="comment">// it&#39;s a folder: close, we can process it later</span></div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                closedir(subDir);</div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                <span class="keywordflow">if</span> (recursive) folders.push(path);</div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            }<span class="keywordflow">else</span>{</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                <span class="comment">// it&#39;s a file</span></div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                <span class="keywordflow">if</span> (extension.empty()){</div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                    list.push_back(path);</div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                }<span class="keywordflow">else</span>{</div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                    <span class="comment">// check file extension</span></div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                    <span class="keywordtype">size_t</span> lastDot = name.find_last_of(<span class="charliteral">&#39;.&#39;</span>);</div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                    std::string ext = name.substr(lastDot+1);</div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                    <span class="keywordflow">if</span> (ext.compare(extension) == 0){</div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                        <span class="comment">// match</span></div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                        list.push_back(path);</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;                    }</div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;                } <span class="comment">// endif (extension test)</span></div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            } <span class="comment">// endif (folder test)</span></div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        } <span class="comment">// endwhile (nextFile)</span></div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        closedir(dir);</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    } <span class="comment">// endwhile (queued folders)</span></div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;} <span class="comment">// end listFiles</span></div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
-<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;}   <span class="comment">// namespace dir</span></div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Dir_8hpp_source.htm b/doc/third_party/Pluma/html/Dir_8hpp_source.htm
deleted file mode 100644 (file)
index 1b8b876..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Dir.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_DIRECTORY_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_DIRECTORY_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;list&gt;</span></div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">namespace </span>dir{</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keywordtype">void</span> listFiles(</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    std::list&lt;std::string&gt;&amp; list,</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">const</span> std::string&amp; folder,</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keyword">const</span> std::string&amp; extension = <span class="stringliteral">&quot;&quot;</span>,</div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keywordtype">bool</span> recursive = <span class="keyword">false</span></div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;);</div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;}   <span class="comment">// namespace dir</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#endif // PLUMA_DIRECTORY_HPP</span></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Doxygen_8hpp_source.htm b/doc/third_party/Pluma/html/Doxygen_8hpp_source.htm
deleted file mode 100644 (file)
index 0a8d6d5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Doxygen.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Host_8cpp_source.htm b/doc/third_party/Pluma/html/Host_8cpp_source.htm
deleted file mode 100644 (file)
index b70cfb6..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Host.cpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Host.hpp&gt;</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;Host::Host(){</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="comment">// Nothing to do</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
-<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">   42</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">Host::add</a>(<a class="code" href="classpluma_1_1Provider.htm">Provider</a>* provider){</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keywordflow">if</span> (provider == NULL){</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Trying to add a null provider.\n&quot;</span>);</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    }</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordflow">if</span> (!validateProvider(provider)){</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keyword">delete</span> provider;</div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    }</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    addRequests[ provider-&gt;plumaGetType() ].push_back(provider);</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;}</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;Host::~Host(){</div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    clearProviders();</div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="comment">// map frees itself</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;}</div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keywordtype">void</span> Host::clearProviders(){</div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    ProvidersMap::iterator it;</div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordflow">for</span> (it = knownTypes.begin() ; it != knownTypes.end() ; ++it){</div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        std::list&lt;Provider*&gt;&amp; providers = it-&gt;second.providers;</div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        std::list&lt;Provider*&gt;::iterator provIt;</div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="keywordflow">for</span> (provIt = providers.begin() ; provIt != providers.end() ; ++provIt){</div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            <span class="keyword">delete</span> *provIt;</div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        }</div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        std::list&lt;Provider*&gt;().swap(providers);</div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    }</div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;}</div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="keywordtype">bool</span> Host::knows(<span class="keyword">const</span> std::string&amp; type)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">return</span> knownTypes.find(type) != knownTypes.end();</div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;}</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Host::getVersion(<span class="keyword">const</span> std::string&amp; type)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    ProvidersMap::const_iterator it = knownTypes.find(type);</div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordflow">if</span> (it != knownTypes.end())</div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">return</span> it-&gt;second.version;</div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">return</span> 0;</div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;}</div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Host::getLowestVersion(<span class="keyword">const</span> std::string&amp; type)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    ProvidersMap::const_iterator it = knownTypes.find(type);</div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordflow">if</span> (it != knownTypes.end())</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <span class="keywordflow">return</span> it-&gt;second.lowestVersion;</div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordflow">return</span> 0;</div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;}</div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
-<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="keywordtype">void</span> Host::registerType(<span class="keyword">const</span> std::string&amp; type, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lowestVersion){</div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">if</span> (!knows(type)){</div>
-<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        ProviderInfo pi;</div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        pi.version = version;</div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        pi.lowestVersion = lowestVersion;</div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        knownTypes[type] = pi;</div>
-<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
-<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div>
-<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
-<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="keyword">const</span> std::list&lt;Provider*&gt;* Host::getProviders(<span class="keyword">const</span> std::string&amp; type)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    ProvidersMap::const_iterator it = knownTypes.find(type);</div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordflow">if</span> (it != knownTypes.end())</div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">return</span> &amp;it-&gt;second.providers;</div>
-<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordflow">return</span> NULL;</div>
-<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;}</div>
-<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
-<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div>
-<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="keywordtype">bool</span> Host::validateProvider(Provider* provider)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keyword">const</span> std::string&amp; type = provider-&gt;plumaGetType();</div>
-<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordflow">if</span> ( !knows(type) ){</div>
-<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;%s provider type isn&#39;t registered.\n&quot;</span>, type.c_str());</div>
-<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    }</div>
-<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordflow">if</span> (!provider-&gt;isCompatible(*<span class="keyword">this</span>)){</div>
-<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Incompatible %s provider version.\n&quot;</span>, type.c_str());</div>
-<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    }</div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div>
-<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="keywordtype">bool</span> Host::registerProvider(Provider* provider){</div>
-<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordflow">if</span> (!validateProvider(provider)){</div>
-<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <span class="keyword">delete</span> provider;</div>
-<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    }</div>
-<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    knownTypes[ provider-&gt;plumaGetType() ].providers.push_back(provider);</div>
-<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;}</div>
-<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div>
-<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div>
-<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="keywordtype">void</span> Host::cancelAddictions(){</div>
-<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    TempProvidersMap::iterator it;</div>
-<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordflow">for</span>( it = addRequests.begin() ; it != addRequests.end() ; ++it){</div>
-<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        std::list&lt;Provider*&gt; lst = it-&gt;second;</div>
-<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        std::list&lt;Provider*&gt;::iterator providerIt;</div>
-<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <span class="keywordflow">for</span> (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt){</div>
-<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;            <span class="keyword">delete</span> *providerIt;</div>
-<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        }</div>
-<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div>
-<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="comment">// clear map</span></div>
-<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    TempProvidersMap().swap(addRequests);</div>
-<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;}</div>
-<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div>
-<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div>
-<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="keywordtype">bool</span> Host::confirmAddictions(){</div>
-<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">if</span> (addRequests.empty()) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    TempProvidersMap::iterator it;</div>
-<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordflow">for</span>( it = addRequests.begin() ; it != addRequests.end() ; ++it){</div>
-<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        std::list&lt;Provider*&gt; lst = it-&gt;second;</div>
-<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        std::list&lt;Provider*&gt;::iterator providerIt;</div>
-<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        <span class="keywordflow">for</span> (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt){</div>
-<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;            knownTypes[it-&gt;first].providers.push_back(*providerIt);</div>
-<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        }</div>
-<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    }</div>
-<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="comment">// clear map</span></div>
-<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    TempProvidersMap().swap(addRequests);</div>
-<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;}</div>
-<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div>
-<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
-<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;} <span class="comment">//namespace pluma</span></div>
-<div class="ttc" id="classpluma_1_1Provider_htm"><div class="ttname"><a href="classpluma_1_1Provider.htm">pluma::Provider</a></div><div class="ttdoc">Interface to provide applications with objects from plugins. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8hpp_source.htm#l00042">Provider.hpp:42</a></div></div>
-<div class="ttc" id="classpluma_1_1Host_htm_ab673ba94ff56a12cdf2a7a25ebb8cc36"><div class="ttname"><a href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">pluma::Host::add</a></div><div class="ttdeci">bool add(Provider *provider)</div><div class="ttdoc">Add provider. </div><div class="ttdef"><b>Definition:</b> <a href="Host_8cpp_source.htm#l00042">Host.cpp:42</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Host_8hpp_source.htm b/doc/third_party/Pluma/html/Host_8hpp_source.htm
deleted file mode 100644 (file)
index 8ca0182..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Host.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_HOST_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_HOST_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;Pluma/Provider.hpp&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;list&gt;</span></div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
-<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classpluma_1_1Host.htm">   44</a></span>&#160;<span class="keyword">class </span>PLUMA_API <a class="code" href="classpluma_1_1Host.htm">Host</a>{</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classpluma_1_1PluginManager.htm">PluginManager</a>;</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classpluma_1_1Provider.htm">Provider</a>;</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordtype">bool</span> add(<a class="code" href="classpluma_1_1Provider.htm">Provider</a>* provider);</div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <a class="code" href="classpluma_1_1Host.htm">Host</a>();</div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    ~<a class="code" href="classpluma_1_1Host.htm">Host</a>();</div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keywordtype">bool</span> knows(<span class="keyword">const</span> std::string&amp; type) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getVersion(<span class="keyword">const</span> std::string&amp; type) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getLowestVersion(<span class="keyword">const</span> std::string&amp; type) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
-<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keywordtype">void</span> registerType(<span class="keyword">const</span> std::string&amp; type, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lowestVersion);</div>
-<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keyword">const</span> std::list&lt;Provider*&gt;* getProviders(<span class="keyword">const</span> std::string&amp; type) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div>
-<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordtype">void</span> clearProviders();</div>
-<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div>
-<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keywordtype">bool</span> validateProvider(<a class="code" href="classpluma_1_1Provider.htm">Provider</a>* provider) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div>
-<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <span class="keywordtype">bool</span> registerProvider(<a class="code" href="classpluma_1_1Provider.htm">Provider</a>* provider);</div>
-<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div>
-<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordtype">void</span> cancelAddictions();</div>
-<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
-<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="keywordtype">bool</span> confirmAddictions();</div>
-<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div>
-<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div>
-<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
-<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="comment">// Member data</span></div>
-<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div>
-<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keyword">struct </span>ProviderInfo{</div>
-<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version;</div>
-<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lowestVersion;</div>
-<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        std::list&lt;Provider*&gt; providers;</div>
-<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    };</div>
-<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div>
-<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keyword">typedef</span> std::map&lt;std::string, ProviderInfo &gt; ProvidersMap;</div>
-<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keyword">typedef</span> std::map&lt;std::string, std::list&lt;Provider*&gt; &gt; TempProvidersMap;</div>
-<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div>
-<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    ProvidersMap knownTypes;        </div>
-<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    TempProvidersMap addRequests;   </div>
-<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div>
-<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;};</div>
-<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div>
-<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div>
-<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="preprocessor">#endif // PLUMA_HOST_HPP</span></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm"><div class="ttname"><a href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></div><div class="ttdoc">Manages loaded plugins. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8hpp_source.htm#l00044">PluginManager.hpp:44</a></div></div>
-<div class="ttc" id="classpluma_1_1Provider_htm"><div class="ttname"><a href="classpluma_1_1Provider.htm">pluma::Provider</a></div><div class="ttdoc">Interface to provide applications with objects from plugins. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8hpp_source.htm#l00042">Provider.hpp:42</a></div></div>
-<div class="ttc" id="classpluma_1_1Host_htm"><div class="ttname"><a href="classpluma_1_1Host.htm">pluma::Host</a></div><div class="ttdoc">Manages providers. </div><div class="ttdef"><b>Definition:</b> <a href="Host_8hpp_source.htm#l00044">Host.hpp:44</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/PluginManager_8cpp_source.htm b/doc/third_party/Pluma/html/PluginManager_8cpp_source.htm
deleted file mode 100644 (file)
index 20f62fb..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">PluginManager.cpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/PluginManager.hpp&gt;</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;Pluma/DLibrary.hpp&gt;</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;Pluma/Dir.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;cstdio&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
-<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">   37</a></span>&#160;<a class="code" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">PluginManager::PluginManager</a>(){</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="comment">// Nothing to do</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;}</div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
-<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">   43</a></span>&#160;<a class="code" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">PluginManager::~PluginManager</a>(){</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <a class="code" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">unloadAll</a>();</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;}</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
-<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">   49</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">PluginManager::load</a>(<span class="keyword">const</span> std::string&amp; path){</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    std::string plugName = getPluginName(path);</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    std::string realPath = resolvePathExtension(path);</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <a class="code" href="classpluma_1_1DLibrary.htm">DLibrary</a>* lib = <a class="code" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">DLibrary::load</a>(realPath);</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordflow">if</span> (!lib) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    fnRegisterPlugin* registerFunction;</div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    registerFunction = <span class="keyword">reinterpret_cast&lt;</span>fnRegisterPlugin*<span class="keyword">&gt;</span>(lib-&gt;<a class="code" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">getSymbol</a>(<span class="stringliteral">&quot;connect&quot;</span>));</div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordflow">if</span>(!registerFunction){</div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Failed to initialize plugin \&quot;%s\&quot;: connect function not found\n&quot;</span>, plugName.c_str());</div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="keyword">delete</span> lib;</div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    }</div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="comment">// try to initialize plugin:</span></div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordflow">if</span> (!registerFunction(host)){</div>
-<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        <span class="comment">// plugin decided to fail</span></div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Self registry failed on plugin \&quot;%s\&quot;.\n&quot;</span>, plugName.c_str());</div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        host.cancelAddictions();</div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keyword">delete</span> lib;</div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    }</div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="comment">// Store the library if addictions are confirmed</span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordflow">if</span> (host.confirmAddictions())</div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        libraries[plugName] = lib;</div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keywordflow">else</span>{</div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="comment">// otherwise nothing was registered</span></div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Nothing registered by plugin \&quot;%s\&quot;.\n&quot;</span>, plugName.c_str());</div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keyword">delete</span> lib;</div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    }</div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;}</div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div>
-<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874">   85</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">PluginManager::load</a>(<span class="keyword">const</span> std::string&amp; folder, <span class="keyword">const</span> std::string&amp; pluginName){</div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordflow">if</span> (folder.empty())</div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(pluginName);</div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (folder[folder.size()-1] == <span class="charliteral">&#39;/&#39;</span> || folder[folder.size()-1] == <span class="charliteral">&#39;\\&#39;</span>)</div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(folder + pluginName);</div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(folder + <span class="charliteral">&#39;/&#39;</span> + pluginName);</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;}</div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div>
-<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">   95</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">PluginManager::loadFromFolder</a>(<span class="keyword">const</span> std::string&amp; folder, <span class="keywordtype">bool</span> recursive){</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    std::list&lt;std::string&gt; files;</div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    dir::listFiles(files, folder, PLUMA_LIB_EXTENSION, recursive);</div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="comment">// try to load every library</span></div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordtype">int</span> res = 0;</div>
-<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    std::list&lt;std::string&gt;::const_iterator it;</div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">for</span> (it = files.begin() ; it != files.end() ; ++it){</div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="keywordflow">if</span> ( <a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(*it) ) ++res;</div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    }</div>
-<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordflow">return</span> res;</div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;}</div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div>
-<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">  109</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">PluginManager::unload</a>(<span class="keyword">const</span> std::string&amp; pluginName){</div>
-<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    std::string plugName = getPluginName(pluginName);</div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    LibMap::iterator it = libraries.find(plugName);</div>
-<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordflow">if</span>( it != libraries.end() ) {</div>
-<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keyword">delete</span> it-&gt;second;</div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        libraries.erase(it);</div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    }</div>
-<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;}</div>
-<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
-<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div>
-<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">  122</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">PluginManager::unloadAll</a>(){</div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
-<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    host.clearProviders();</div>
-<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    LibMap::iterator it;</div>
-<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordflow">for</span> (it = libraries.begin() ; it != libraries.end() ; ++it){</div>
-<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <span class="keyword">delete</span> it-&gt;second;</div>
-<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    }</div>
-<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    libraries.clear();</div>
-<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;}</div>
-<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;std::string PluginManager::getPluginName(<span class="keyword">const</span> std::string&amp; path){</div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keywordtype">size_t</span> lastDash = path.find_last_of(<span class="stringliteral">&quot;/\\&quot;</span>);</div>
-<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keywordtype">size_t</span> lastDot = path.find_last_of(<span class="charliteral">&#39;.&#39;</span>);</div>
-<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordflow">if</span> (lastDash == std::string::npos) lastDash = 0;</div>
-<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordflow">else</span> ++lastDash;</div>
-<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordflow">if</span> (lastDot &lt; lastDash || lastDot == std::string::npos){</div>
-<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="comment">// path without extension</span></div>
-<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        lastDot = path.length();</div>
-<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div>
-<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">return</span> path.substr(lastDash, lastDot-lastDash);</div>
-<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;}</div>
-<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div>
-<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div>
-<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;std::string PluginManager::resolvePathExtension(<span class="keyword">const</span> std::string&amp; path){</div>
-<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="keywordtype">size_t</span> lastDash = path.find_last_of(<span class="stringliteral">&quot;/\\&quot;</span>);</div>
-<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordtype">size_t</span> lastDot = path.find_last_of(<span class="charliteral">&#39;.&#39;</span>);</div>
-<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="keywordflow">if</span> (lastDash == std::string::npos) lastDash = 0;</div>
-<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keywordflow">else</span> ++lastDash;</div>
-<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordflow">if</span> (lastDot &lt; lastDash || lastDot == std::string::npos){</div>
-<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        <span class="comment">// path without extension, add it</span></div>
-<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">return</span> path + <span class="stringliteral">&quot;.&quot;</span> + PLUMA_LIB_EXTENSION;</div>
-<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div>
-<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordflow">return</span> path;</div>
-<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;}</div>
-<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div>
-<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div>
-<div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">  162</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">PluginManager::registerType</a>(<span class="keyword">const</span> std::string&amp; type, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lowestVersion){</div>
-<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    host.registerType(type, version, lowestVersion);</div>
-<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;}</div>
-<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
-<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div>
-<div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">  168</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">PluginManager::addProvider</a>(<a class="code" href="classpluma_1_1Provider.htm">Provider</a>* provider){</div>
-<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keywordflow">if</span> (provider == NULL){</div>
-<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        fprintf(stderr, <span class="stringliteral">&quot;Trying to add null provider\n&quot;</span>);</div>
-<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    }</div>
-<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keywordflow">return</span> host.registerProvider(provider);</div>
-<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;}</div>
-<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div>
-<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
-<div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">  178</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">PluginManager::getLoadedPlugins</a>(std::vector&lt;const std::string*&gt;&amp; pluginNames)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    pluginNames.reserve(pluginNames.size()+libraries.size());</div>
-<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    LibMap::const_iterator it;</div>
-<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordflow">for</span>(it = libraries.begin() ; it != libraries.end() ; ++it){</div>
-<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        pluginNames.push_back(&amp;(it-&gt;first));</div>
-<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    }</div>
-<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;}</div>
-<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
-<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div>
-<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">  188</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">PluginManager::isLoaded</a>(<span class="keyword">const</span> std::string&amp; pluginName)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keywordflow">return</span> libraries.find(getPluginName(pluginName)) != libraries.end();</div>
-<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;}</div>
-<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div>
-<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div>
-<div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">  194</a></span>&#160;<span class="keyword">const</span> std::list&lt;Provider*&gt;* <a class="code" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">PluginManager::getProviders</a>(<span class="keyword">const</span> std::string&amp; type)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keywordflow">return</span> host.getProviders(type);</div>
-<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;}</div>
-<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div>
-<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div>
-<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div>
-<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_a52f6408d4cf95c6f36b518ab2d3a7745"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">pluma::PluginManager::unload</a></div><div class="ttdeci">bool unload(const std::string &amp;pluginName)</div><div class="ttdoc">Unload a plugin. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00109">PluginManager.cpp:109</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_ab70b5b6b719bdbd64c27ae2dcb12a64d"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">pluma::PluginManager::registerType</a></div><div class="ttdeci">void registerType(const std::string &amp;type, unsigned int version, unsigned int lowestVersion)</div><div class="ttdoc">Register a provider type. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00162">PluginManager.cpp:162</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_a697a20dc97957e0c2a5dad33f39d93db"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">pluma::PluginManager::unloadAll</a></div><div class="ttdeci">void unloadAll()</div><div class="ttdoc">Unload all loaded plugins. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00122">PluginManager.cpp:122</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_a8378a698812f8f079ff8aea7c1474d67"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">pluma::PluginManager::PluginManager</a></div><div class="ttdeci">PluginManager()</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00037">PluginManager.cpp:37</a></div></div>
-<div class="ttc" id="classpluma_1_1Provider_htm"><div class="ttname"><a href="classpluma_1_1Provider.htm">pluma::Provider</a></div><div class="ttdoc">Interface to provide applications with objects from plugins. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8hpp_source.htm#l00042">Provider.hpp:42</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_ad5eab1dcae10122fdfb8d94d7b391e9e"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">pluma::PluginManager::getProviders</a></div><div class="ttdeci">const std::list&lt; Provider * &gt; * getProviders(const std::string &amp;type) const </div><div class="ttdoc">Get providers of a certain type. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00194">PluginManager.cpp:194</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a32400d8e50c0f03cb525ca7500b4516e"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">pluma::DLibrary::load</a></div><div class="ttdeci">static DLibrary * load(const std::string &amp;path)</div><div class="ttdoc">Load a library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00037">DLibrary.cpp:37</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm"><div class="ttname"><a href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a></div><div class="ttdoc">Manages a Dynamic Linking Library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8hpp_source.htm#l00049">DLibrary.hpp:49</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_a4d892e345288c26dea091d62ee2b03eb"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">pluma::PluginManager::loadFromFolder</a></div><div class="ttdeci">int loadFromFolder(const std::string &amp;folder, bool recursive=false)</div><div class="ttdoc">Load all plugins from a given folder. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00095">PluginManager.cpp:95</a></div></div>
-<div class="ttc" id="classpluma_1_1DLibrary_htm_a57dd3726140cce08957e40cb5b001d84"><div class="ttname"><a href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">pluma::DLibrary::getSymbol</a></div><div class="ttdeci">void * getSymbol(const std::string &amp;symbol)</div><div class="ttdoc">Get a symbol from the library. </div><div class="ttdef"><b>Definition:</b> <a href="DLibrary_8cpp_source.htm#l00079">DLibrary.cpp:79</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_aa00400d23efa8a8f94e44dd1c5bf54e6"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">pluma::PluginManager::load</a></div><div class="ttdeci">bool load(const std::string &amp;path)</div><div class="ttdoc">Load a plugin given it&#39;s path. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00049">PluginManager.cpp:49</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_a4d7a0e1151b75300350834a59db5748b"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">pluma::PluginManager::~PluginManager</a></div><div class="ttdeci">~PluginManager()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00043">PluginManager.cpp:43</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_adbd75738cd4d8969608c9da8b58a03c3"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">pluma::PluginManager::isLoaded</a></div><div class="ttdeci">bool isLoaded(const std::string &amp;pluginName) const </div><div class="ttdoc">Check if a plug-in is loaded. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00188">PluginManager.cpp:188</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_a187e60d3fe7524774c08eb58ebcb843f"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">pluma::PluginManager::getLoadedPlugins</a></div><div class="ttdeci">void getLoadedPlugins(std::vector&lt; const std::string * &gt; &amp;pluginNames) const </div><div class="ttdoc">Get the name of all loaded plugins. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00178">PluginManager.cpp:178</a></div></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm_af27f8e89b8e29359495b6398464ebf02"><div class="ttname"><a href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">pluma::PluginManager::addProvider</a></div><div class="ttdeci">bool addProvider(Provider *provider)</div><div class="ttdoc">Directly add a new provider. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8cpp_source.htm#l00168">PluginManager.cpp:168</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/PluginManager_8hpp_source.htm b/doc/third_party/Pluma/html/PluginManager_8hpp_source.htm
deleted file mode 100644 (file)
index ace857e..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">PluginManager.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_PLUGIN_MANAGER_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_PLUGIN_MANAGER_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;Pluma/Host.hpp&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">class </span>DLibrary;</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
-<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classpluma_1_1PluginManager.htm">   44</a></span>&#160;<span class="keyword">class </span>PLUMA_API <a class="code" href="classpluma_1_1PluginManager.htm">PluginManager</a>{</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    ~<a class="code" href="classpluma_1_1PluginManager.htm">PluginManager</a>();</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordtype">bool</span> load(<span class="keyword">const</span> std::string&amp; path);</div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keywordtype">bool</span> load(<span class="keyword">const</span> std::string&amp; folder, <span class="keyword">const</span> std::string&amp; pluginName);</div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordtype">int</span> loadFromFolder(<span class="keyword">const</span> std::string&amp; folder, <span class="keywordtype">bool</span> recursive = <span class="keyword">false</span>);</div>
-<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">bool</span> unload(<span class="keyword">const</span> std::string&amp; pluginName);</div>
-<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keywordtype">void</span> unloadAll();</div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div>
-<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keywordtype">bool</span> addProvider(<a class="code" href="classpluma_1_1Provider.htm">Provider</a>* provider);</div>
-<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
-<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordtype">void</span> getLoadedPlugins(std::vector&lt;const std::string*&gt;&amp; pluginNames) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div>
-<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordtype">bool</span> isLoaded(<span class="keyword">const</span> std::string&amp; pluginName) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div>
-<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div>
-<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="keyword">protected</span>:</div>
-<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div>
-<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <a class="code" href="classpluma_1_1PluginManager.htm">PluginManager</a>();</div>
-<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div>
-<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordtype">void</span> registerType(<span class="keyword">const</span> std::string&amp; type, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lowestVersion);</div>
-<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div>
-<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keyword">const</span> std::list&lt;Provider*&gt;* getProviders(<span class="keyword">const</span> std::string&amp; type) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div>
-<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;</div>
-<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div>
-<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="keyword">static</span> std::string getPluginName(<span class="keyword">const</span> std::string&amp; path);</div>
-<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div>
-<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <span class="keyword">static</span> std::string resolvePathExtension(<span class="keyword">const</span> std::string&amp; path);</div>
-<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div>
-<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div>
-<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div>
-<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <span class="keyword">typedef</span> <span class="keywordtype">bool</span> fnRegisterPlugin(<a class="code" href="classpluma_1_1Host.htm">Host</a>&amp;);</div>
-<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="keyword">typedef</span> std::map&lt;std::string,DLibrary*&gt; LibMap;</div>
-<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div>
-<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    LibMap libraries;   </div>
-<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <a class="code" href="classpluma_1_1Host.htm">Host</a> host;          </div>
-<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;</div>
-<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;};</div>
-<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;</div>
-<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div>
-<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;<span class="preprocessor">#endif // PLUMA_PLUGIN_MANAGER_HPP</span></div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm"><div class="ttname"><a href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></div><div class="ttdoc">Manages loaded plugins. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8hpp_source.htm#l00044">PluginManager.hpp:44</a></div></div>
-<div class="ttc" id="classpluma_1_1Provider_htm"><div class="ttname"><a href="classpluma_1_1Provider.htm">pluma::Provider</a></div><div class="ttdoc">Interface to provide applications with objects from plugins. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8hpp_source.htm#l00042">Provider.hpp:42</a></div></div>
-<div class="ttc" id="classpluma_1_1Host_htm"><div class="ttname"><a href="classpluma_1_1Host.htm">pluma::Host</a></div><div class="ttdoc">Manages providers. </div><div class="ttdef"><b>Definition:</b> <a href="Host_8hpp_source.htm#l00044">Host.hpp:44</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Pluma_8hpp_source.htm b/doc/third_party/Pluma/html/Pluma_8hpp_source.htm
deleted file mode 100644 (file)
index 54cbe25..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Pluma.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_PLUMA_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_PLUMA_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;Pluma/Provider.hpp&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;Pluma/PluginManager.hpp&gt;</span></div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">// Andy macro to convert parameter to string</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment"></span><span class="preprocessor">#define PLUMA_2STRING(X) #X</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment">// Macro that helps host applications defining</span></div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">// their provider classes</span></div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment"></span><span class="preprocessor">#define PLUMA_PROVIDER_HEADER(TYPE)\</span></div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">virtual TYPE* create() const = 0;\</span></div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">PLUMA_PROVIDER_HEADER_END</span></div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">// Macro that generate first part of the provider definition</span></div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment"></span><span class="preprocessor">#define PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\</span></div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">class TYPE##Provider: public pluma::Provider{\</span></div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">private:\</span></div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">    friend class pluma::Pluma;\</span></div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">    static const unsigned int PLUMA_INTERFACE_VERSION;\</span></div>
-<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">    static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;\</span></div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">    static const std::string PLUMA_PROVIDER_TYPE;\</span></div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">    std::string plumaGetType() const{ return PLUMA_PROVIDER_TYPE; }\</span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">public:\</span></div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">    unsigned int getVersion() const{ return PLUMA_INTERFACE_VERSION; }</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment">// Macro that generate last part of the provider definition</span></div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment"></span><span class="preprocessor">#define PLUMA_PROVIDER_HEADER_END };</span></div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="comment">// Macro that generate the provider declaration</span></div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="comment"></span><span class="preprocessor">#define PLUMA_PROVIDER_SOURCE(TYPE, Version, LowestVersion)\</span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">const std::string TYPE##Provider::PLUMA_PROVIDER_TYPE = PLUMA_2STRING( TYPE );\</span></div>
-<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">const unsigned int TYPE##Provider::PLUMA_INTERFACE_VERSION = Version;\</span></div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">const unsigned int TYPE##Provider::PLUMA_INTERFACE_LOWEST_VERSION = LowestVersion;</span></div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="comment">// Macro that helps plugins generating their provider implementations</span></div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="comment">// PRE: SPECIALIZED_TYPE must inherit from BASE_TYPE</span></div>
-<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment"></span><span class="preprocessor">#define PLUMA_INHERIT_PROVIDER(SPECIALIZED_TYPE, BASE_TYPE)\</span></div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor">class SPECIALIZED_TYPE##Provider: public BASE_TYPE##Provider{\</span></div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">public:\</span></div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">    BASE_TYPE * create() const{ return new SPECIALIZED_TYPE (); }\</span></div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">};</span></div>
-<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div>
-<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="classpluma_1_1Pluma.htm">   94</a></span>&#160;<span class="keyword">class </span><a class="code" href="classpluma_1_1Pluma.htm">Pluma</a>: <span class="keyword">public</span> <a class="code" href="classpluma_1_1PluginManager.htm">PluginManager</a>{</div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <a class="code" href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">Pluma</a>();</div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Prov<span class="keywordtype">id</span>erType&gt;</div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">acceptProviderType</a>();</div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div>
-<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Prov<span class="keywordtype">id</span>erType&gt;</div>
-<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">getProviders</a>(std::vector&lt;ProviderType*&gt;&amp; providers);</div>
-<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;};</div>
-<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div>
-<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="preprocessor">#include &lt;Pluma/Pluma.inl&gt;</span></div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
-<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div>
-<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#endif // PLUMA_PLUMA_HPP</span></div>
-<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div>
-<div class="ttc" id="classpluma_1_1PluginManager_htm"><div class="ttname"><a href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></div><div class="ttdoc">Manages loaded plugins. </div><div class="ttdef"><b>Definition:</b> <a href="PluginManager_8hpp_source.htm#l00044">PluginManager.hpp:44</a></div></div>
-<div class="ttc" id="classpluma_1_1Pluma_htm"><div class="ttname"><a href="classpluma_1_1Pluma.htm">pluma::Pluma</a></div><div class="ttdoc">Pluma plugins management. </div><div class="ttdef"><b>Definition:</b> <a href="Pluma_8hpp_source.htm#l00094">Pluma.hpp:94</a></div></div>
-<div class="ttc" id="classpluma_1_1Pluma_htm_a49fa0b2b4497885c4e978259be0a7abe"><div class="ttname"><a href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">pluma::Pluma::getProviders</a></div><div class="ttdeci">void getProviders(std::vector&lt; ProviderType * &gt; &amp;providers)</div><div class="ttdoc">Get the stored providers of a certain type. </div></div>
-<div class="ttc" id="classpluma_1_1Pluma_htm_a200c59b0983c7ca53d11b03cf8220bc7"><div class="ttname"><a href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">pluma::Pluma::acceptProviderType</a></div><div class="ttdeci">void acceptProviderType()</div><div class="ttdoc">Tell Pluma to accept a certain type of providers. </div></div>
-<div class="ttc" id="classpluma_1_1Pluma_htm_adf4e065f5169931f6290f3828b49e7bb"><div class="ttname"><a href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">pluma::Pluma::Pluma</a></div><div class="ttdeci">Pluma()</div><div class="ttdoc">Default Constructor. </div><div class="ttdef"><b>Definition:</b> <a href="Pluma_8inl_source.htm#l00027">Pluma.inl:27</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Pluma_8inl_source.htm b/doc/third_party/Pluma/html/Pluma_8inl_source.htm
deleted file mode 100644 (file)
index 3955ab5..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Pluma.inl</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">   27</a></span>&#160;<span class="keyword">inline</span> Pluma::Pluma(){</div>
-<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="comment">// Nothing to do</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Prov<span class="keywordtype">id</span>erType&gt;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keywordtype">void</span> Pluma::acceptProviderType(){</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    PluginManager::registerType(</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        ProviderType::PLUMA_PROVIDER_TYPE,</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        ProviderType::PLUMA_INTERFACE_VERSION,</div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        ProviderType::PLUMA_INTERFACE_LOWEST_VERSION</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    );</div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;}</div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> Prov<span class="keywordtype">id</span>erType&gt;</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keywordtype">void</span> Pluma::getProviders(std::vector&lt;ProviderType*&gt;&amp; providers){</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keyword">const</span> std::list&lt;Provider*&gt;* lst = PluginManager::getProviders(ProviderType::PLUMA_PROVIDER_TYPE);</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordflow">if</span> (!lst) <span class="keywordflow">return</span>;</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    providers.reserve(providers.size() + lst-&gt;size());</div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    std::list&lt;Provider*&gt;::const_iterator it;</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordflow">for</span> (it = lst-&gt;begin() ; it != lst-&gt;end() ; ++it)</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        providers.push_back(static_cast&lt;ProviderType*&gt;(*it));</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}</div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Provider_8cpp_source.htm b/doc/third_party/Pluma/html/Provider_8cpp_source.htm
deleted file mode 100644 (file)
index 64e9be5..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Provider.cpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Provider.hpp&gt;</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;Pluma/Host.hpp&gt;</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">   36</a></span>&#160;<a class="code" href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">Provider::~Provider</a>(){</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="comment">// Nothing to do</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
-<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">   42</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">Provider::isCompatible</a>(<span class="keyword">const</span> <a class="code" href="classpluma_1_1Host.htm">Host</a>&amp; host)<span class="keyword"> const</span>{</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="comment">// check compatibility with host</span></div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keyword">const</span> std::string&amp; type = this-&gt;plumaGetType();</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keywordflow">if</span> (!host.knows(type)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> lowest = host.getLowestVersion(type);</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> current = host.getVersion(type);</div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> myVersion = this-&gt;<a class="code" href="classpluma_1_1Provider.htm#af8643b65e111e010edff6e7a489265e6">getVersion</a>();</div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keywordflow">return</span> lowest &lt;= myVersion &amp;&amp; myVersion &lt;= current;</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;}</div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="ttc" id="classpluma_1_1Provider_htm_a111a1db902d6372282f8407c9d845c21"><div class="ttname"><a href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">pluma::Provider::~Provider</a></div><div class="ttdeci">virtual ~Provider()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8cpp_source.htm#l00036">Provider.cpp:36</a></div></div>
-<div class="ttc" id="classpluma_1_1Provider_htm_af8643b65e111e010edff6e7a489265e6"><div class="ttname"><a href="classpluma_1_1Provider.htm#af8643b65e111e010edff6e7a489265e6">pluma::Provider::getVersion</a></div><div class="ttdeci">virtual unsigned int getVersion() const =0</div><div class="ttdoc">Get provider version. </div></div>
-<div class="ttc" id="classpluma_1_1Host_htm"><div class="ttname"><a href="classpluma_1_1Host.htm">pluma::Host</a></div><div class="ttdoc">Manages providers. </div><div class="ttdef"><b>Definition:</b> <a href="Host_8hpp_source.htm#l00044">Host.hpp:44</a></div></div>
-<div class="ttc" id="classpluma_1_1Provider_htm_a192ea5a17a8fe9de1f3ba6572f44f266"><div class="ttname"><a href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">pluma::Provider::isCompatible</a></div><div class="ttdeci">bool isCompatible(const Host &amp;host) const </div><div class="ttdoc">Check compatibility with host. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8cpp_source.htm#l00042">Provider.cpp:42</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/Provider_8hpp_source.htm b/doc/third_party/Pluma/html/Provider_8hpp_source.htm
deleted file mode 100644 (file)
index bba5d6a..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Provider.hpp</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// Pluma - Plug-in Management Framework</span></div>
-<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)</span></div>
-<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
-<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
-<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
-<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
-<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// subject to the following restrictions:</span></div>
-<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
-<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    you must not claim that you wrote the original software.</span></div>
-<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
-<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
-<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
-<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//    and must not be misrepresented as being the original software.</span></div>
-<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
-<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//</span></div>
-<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"></span></div>
-<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef PLUMA_PROVIDER_HPP</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define PLUMA_PROVIDER_HPP</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">// Headers</span></div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"></span><span class="preprocessor">#include &lt;Pluma/Config.hpp&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">namespace </span>pluma{</div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">class </span>Host;</div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
-<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classpluma_1_1Provider.htm">   42</a></span>&#160;<span class="keyword">class </span>PLUMA_API <a class="code" href="classpluma_1_1Provider.htm">Provider</a>{</div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classpluma_1_1Host.htm">Host</a>;</div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">public</span>:</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classpluma_1_1Provider.htm">Provider</a>();</div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getVersion() <span class="keyword">const</span> = 0;</div>
-<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">bool</span> isCompatible(<span class="keyword">const</span> <a class="code" href="classpluma_1_1Host.htm">Host</a>&amp; host) <span class="keyword">const</span>;</div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
-<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
-<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="keyword">private</span>:</div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">virtual</span> std::string plumaGetType() <span class="keyword">const</span> = 0;</div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;};</div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;}   <span class="comment">// namespace pluma</span></div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor">#endif // PLUMA_PROVIDER_HPP</span></div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
-<div class="ttc" id="classpluma_1_1Provider_htm"><div class="ttname"><a href="classpluma_1_1Provider.htm">pluma::Provider</a></div><div class="ttdoc">Interface to provide applications with objects from plugins. </div><div class="ttdef"><b>Definition:</b> <a href="Provider_8hpp_source.htm#l00042">Provider.hpp:42</a></div></div>
-<div class="ttc" id="classpluma_1_1Host_htm"><div class="ttname"><a href="classpluma_1_1Host.htm">pluma::Host</a></div><div class="ttdoc">Manages providers. </div><div class="ttdef"><b>Definition:</b> <a href="Host_8hpp_source.htm#l00044">Host.hpp:44</a></div></div>
-</div><!-- fragment --></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/annotated.htm b/doc/third_party/Pluma/html/annotated.htm
deleted file mode 100644 (file)
index b5d70dd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li class="current"><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Class List</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
-<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
-<tr id="row_0_" class="even"><td class="entry"><img id="arr_0_" src="ftv2mlastnode.png" alt="\" width="16" height="22" onclick="toggleFolder('0_')"/><img src="ftv2ns.png" alt="N" width="24" height="22" /><b>pluma</b></td><td class="desc"></td></tr>
-<tr id="row_0_0_"><td class="entry"><img src="ftv2blank.png" alt="&#160;" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1DLibrary.htm" target="_self">DLibrary</a></td><td class="desc">Manages a Dynamic Linking Library </td></tr>
-<tr id="row_0_1_" class="even"><td class="entry"><img src="ftv2blank.png" alt="&#160;" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1Host.htm" target="_self">Host</a></td><td class="desc">Manages providers </td></tr>
-<tr id="row_0_2_"><td class="entry"><img src="ftv2blank.png" alt="&#160;" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1PluginManager.htm" target="_self">PluginManager</a></td><td class="desc">Manages loaded plugins </td></tr>
-<tr id="row_0_3_" class="even"><td class="entry"><img src="ftv2blank.png" alt="&#160;" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1Pluma.htm" target="_self">Pluma</a></td><td class="desc"><a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> plugins management </td></tr>
-<tr id="row_0_4_"><td class="entry"><img src="ftv2blank.png" alt="&#160;" width="16" height="22" /><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1Provider.htm" target="_self">Provider</a></td><td class="desc">Interface to provide applications with objects from plugins </td></tr>
-</table>
-</div><!-- directory -->
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/bc_s.png b/doc/third_party/Pluma/html/bc_s.png
deleted file mode 100644 (file)
index 224b29a..0000000
Binary files a/doc/third_party/Pluma/html/bc_s.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/bdwn.png b/doc/third_party/Pluma/html/bdwn.png
deleted file mode 100644 (file)
index 940a0b9..0000000
Binary files a/doc/third_party/Pluma/html/bdwn.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/classes.htm b/doc/third_party/Pluma/html/classes.htm
deleted file mode 100644 (file)
index cb2c15c..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li class="current"><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Class Index</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="qindex"><a class="qindex" href="#letter_D">D</a>&#160;|&#160;<a class="qindex" href="#letter_H">H</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a></div>
-<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
-<tr><td rowspan="2" valign="bottom"><a name="letter_D"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;D&#160;&#160;</div></td></tr></table>
-</td><td rowspan="2" valign="bottom"><a name="letter_H"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;H&#160;&#160;</div></td></tr></table>
-</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="classpluma_1_1Pluma.htm">Pluma</a> (pluma)&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="classpluma_1_1Provider.htm">Provider</a> (pluma)&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="classpluma_1_1DLibrary.htm">DLibrary</a> (pluma)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classpluma_1_1Host.htm">Host</a> (pluma)&#160;&#160;&#160;</td><td valign="top"><a class="el" href="classpluma_1_1PluginManager.htm">PluginManager</a> (pluma)&#160;&#160;&#160;</td><td></td></tr>
-<tr><td></td><td></td><td></td><td></td></tr>
-</table>
-<div class="qindex"><a class="qindex" href="#letter_D">D</a>&#160;|&#160;<a class="qindex" href="#letter_H">H</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a></div>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1DLibrary-members.htm b/doc/third_party/Pluma/html/classpluma_1_1DLibrary-members.htm
deleted file mode 100644 (file)
index 0a21d3f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1DLibrary.htm">DLibrary</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">pluma::DLibrary Member List</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>This is the complete list of members for <a class="el" href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a>, including all inherited members.</p>
-<table class="directory">
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">getSymbol</a>(const std::string &amp;symbol)</td><td class="entry"><a class="el" href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">load</a>(const std::string &amp;path)</td><td class="entry"><a class="el" href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">~DLibrary</a>()</td><td class="entry"><a class="el" href="classpluma_1_1DLibrary.htm">pluma::DLibrary</a></td><td class="entry"></td></tr>
-</table></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1DLibrary.htm b/doc/third_party/Pluma/html/classpluma_1_1DLibrary.htm
deleted file mode 100644 (file)
index 3d34b08..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1DLibrary.htm">DLibrary</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="summary">
-<a href="#pub-methods">Public Member Functions</a> &#124;
-<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
-<a href="classpluma_1_1DLibrary-members.htm">List of all members</a>  </div>
-  <div class="headertitle">
-<div class="title">pluma::DLibrary Class Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Manages a Dynamic Linking Library.  
- <a href="classpluma_1_1DLibrary.htm#details">More...</a></p>
-
-<p><code>#include &lt;<a class="el" href="DLibrary_8hpp_source.htm">DLibrary.hpp</a>&gt;</code></p>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
-Public Member Functions</h2></td></tr>
-<tr class="memitem:a3fa679bc824b36ce61b67716bedd15c7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">~DLibrary</a> ()</td></tr>
-<tr class="memdesc:a3fa679bc824b36ce61b67716bedd15c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a3fa679bc824b36ce61b67716bedd15c7">More...</a><br/></td></tr>
-<tr class="separator:a3fa679bc824b36ce61b67716bedd15c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a57dd3726140cce08957e40cb5b001d84"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">getSymbol</a> (const std::string &amp;symbol)</td></tr>
-<tr class="memdesc:a57dd3726140cce08957e40cb5b001d84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a symbol from the library.  <a href="#a57dd3726140cce08957e40cb5b001d84">More...</a><br/></td></tr>
-<tr class="separator:a57dd3726140cce08957e40cb5b001d84"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
-Static Public Member Functions</h2></td></tr>
-<tr class="memitem:a32400d8e50c0f03cb525ca7500b4516e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classpluma_1_1DLibrary.htm">DLibrary</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">load</a> (const std::string &amp;path)</td></tr>
-<tr class="memdesc:a32400d8e50c0f03cb525ca7500b4516e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a library.  <a href="#a32400d8e50c0f03cb525ca7500b4516e">More...</a><br/></td></tr>
-<tr class="separator:a32400d8e50c0f03cb525ca7500b4516e"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Manages a Dynamic Linking Library. </p>
-
-<p>Definition at line <a class="el" href="DLibrary_8hpp_source.htm#l00049">49</a> of file <a class="el" href="DLibrary_8hpp_source.htm">DLibrary.hpp</a>.</p>
-</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
-<a class="anchor" id="a3fa679bc824b36ce61b67716bedd15c7"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">pluma::DLibrary::~DLibrary </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Destructor. </p>
-<p>Close and free the opened library (if any). </p>
-
-<p>Definition at line <a class="el" href="DLibrary_8cpp_source.htm#l00067">67</a> of file <a class="el" href="DLibrary_8cpp_source.htm">DLibrary.cpp</a>.</p>
-
-</div>
-</div>
-<h2 class="groupheader">Member Function Documentation</h2>
-<a class="anchor" id="a57dd3726140cce08957e40cb5b001d84"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">void * pluma::DLibrary::getSymbol </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>symbol</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Get a symbol from the library. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">symbol</td><td>Symbol that we're looking for.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Pointer to what the symbol refers to, or NULL if the symbol is not found. </dd></dl>
-
-<p>Definition at line <a class="el" href="DLibrary_8cpp_source.htm#l00079">79</a> of file <a class="el" href="DLibrary_8cpp_source.htm">DLibrary.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a32400d8e50c0f03cb525ca7500b4516e"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname"><a class="el" href="classpluma_1_1DLibrary.htm">DLibrary</a> * pluma::DLibrary::load </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>path</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">static</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Load a library. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">path</td><td>Path to the library.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Pointer to the loaded library, or NULL if failed. </dd></dl>
-
-<p>Definition at line <a class="el" href="DLibrary_8cpp_source.htm#l00037">37</a> of file <a class="el" href="DLibrary_8cpp_source.htm">DLibrary.cpp</a>.</p>
-
-</div>
-</div>
-<hr/>The documentation for this class was generated from the following files:<ul>
-<li><a class="el" href="DLibrary_8hpp_source.htm">DLibrary.hpp</a></li>
-<li><a class="el" href="DLibrary_8cpp_source.htm">DLibrary.cpp</a></li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Host-members.htm b/doc/third_party/Pluma/html/classpluma_1_1Host-members.htm
deleted file mode 100644 (file)
index dae8f08..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1Host.htm">Host</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">pluma::Host Member List</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>This is the complete list of members for <a class="el" href="classpluma_1_1Host.htm">pluma::Host</a>, including all inherited members.</p>
-<table class="directory">
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">add</a>(Provider *provider)</td><td class="entry"><a class="el" href="classpluma_1_1Host.htm">pluma::Host</a></td><td class="entry"></td></tr>
-  <tr bgcolor="#f0f0f0"><td class="entry"><b>PluginManager</b> (defined in <a class="el" href="classpluma_1_1Host.htm">pluma::Host</a>)</td><td class="entry"><a class="el" href="classpluma_1_1Host.htm">pluma::Host</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
-  <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Provider</b> (defined in <a class="el" href="classpluma_1_1Host.htm">pluma::Host</a>)</td><td class="entry"><a class="el" href="classpluma_1_1Host.htm">pluma::Host</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
-</table></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Host.htm b/doc/third_party/Pluma/html/classpluma_1_1Host.htm
deleted file mode 100644 (file)
index b5b0096..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1Host.htm">Host</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="summary">
-<a href="#nested-classes">Classes</a> &#124;
-<a href="#pub-methods">Public Member Functions</a> &#124;
-<a href="#friends">Friends</a> &#124;
-<a href="classpluma_1_1Host-members.htm">List of all members</a>  </div>
-  <div class="headertitle">
-<div class="title">pluma::Host Class Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Manages providers.  
- <a href="classpluma_1_1Host.htm#details">More...</a></p>
-
-<p><code>#include &lt;<a class="el" href="Host_8hpp_source.htm">Host.hpp</a>&gt;</code></p>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
-Public Member Functions</h2></td></tr>
-<tr class="memitem:ab673ba94ff56a12cdf2a7a25ebb8cc36"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">add</a> (<a class="el" href="classpluma_1_1Provider.htm">Provider</a> *provider)</td></tr>
-<tr class="memdesc:ab673ba94ff56a12cdf2a7a25ebb8cc36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add provider.  <a href="#ab673ba94ff56a12cdf2a7a25ebb8cc36">More...</a><br/></td></tr>
-<tr class="separator:ab673ba94ff56a12cdf2a7a25ebb8cc36"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
-Friends</h2></td></tr>
-<tr class="memitem:ad0ccd35859b04e162412b22bf5200374"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad0ccd35859b04e162412b22bf5200374"></a>
-class&#160;</td><td class="memItemRight" valign="bottom"><b>PluginManager</b></td></tr>
-<tr class="separator:ad0ccd35859b04e162412b22bf5200374"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a70ab087352a74128b9608cf9e7d24c71"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a70ab087352a74128b9608cf9e7d24c71"></a>
-class&#160;</td><td class="memItemRight" valign="bottom"><b>Provider</b></td></tr>
-<tr class="separator:a70ab087352a74128b9608cf9e7d24c71"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Manages providers. </p>
-
-<p>Definition at line <a class="el" href="Host_8hpp_source.htm#l00044">44</a> of file <a class="el" href="Host_8hpp_source.htm">Host.hpp</a>.</p>
-</div><h2 class="groupheader">Member Function Documentation</h2>
-<a class="anchor" id="ab673ba94ff56a12cdf2a7a25ebb8cc36"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::Host::add </td>
-          <td>(</td>
-          <td class="paramtype"><a class="el" href="classpluma_1_1Provider.htm">Provider</a> *&#160;</td>
-          <td class="paramname"><em>provider</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Add provider. </p>
-<p><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a> type and version are checked. Only known and valid provider types are accepted.</p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">provider</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a> to be added.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the provider is accepted. </dd></dl>
-
-<p>Definition at line <a class="el" href="Host_8cpp_source.htm#l00042">42</a> of file <a class="el" href="Host_8cpp_source.htm">Host.cpp</a>.</p>
-
-</div>
-</div>
-<hr/>The documentation for this class was generated from the following files:<ul>
-<li><a class="el" href="Host_8hpp_source.htm">Host.hpp</a></li>
-<li><a class="el" href="Host_8cpp_source.htm">Host.cpp</a></li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1PluginManager-members.htm b/doc/third_party/Pluma/html/classpluma_1_1PluginManager-members.htm
deleted file mode 100644 (file)
index 93bfd8a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1PluginManager.htm">PluginManager</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">pluma::PluginManager Member List</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>This is the complete list of members for <a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a>, including all inherited members.</p>
-<table class="directory">
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">addProvider</a>(Provider *provider)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">getLoadedPlugins</a>(std::vector&lt; const std::string * &gt; &amp;pluginNames) const </td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">getProviders</a>(const std::string &amp;type) const </td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">isLoaded</a>(const std::string &amp;pluginName) const </td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(const std::string &amp;path)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874">load</a>(const std::string &amp;folder, const std::string &amp;pluginName)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">loadFromFolder</a>(const std::string &amp;folder, bool recursive=false)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">PluginManager</a>()</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">registerType</a>(const std::string &amp;type, unsigned int version, unsigned int lowestVersion)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">unload</a>(const std::string &amp;pluginName)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">unloadAll</a>()</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">~PluginManager</a>()</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-</table></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1PluginManager.htm b/doc/third_party/Pluma/html/classpluma_1_1PluginManager.htm
deleted file mode 100644 (file)
index eec4670..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1PluginManager.htm">PluginManager</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="summary">
-<a href="#pub-methods">Public Member Functions</a> &#124;
-<a href="#pro-methods">Protected Member Functions</a> &#124;
-<a href="classpluma_1_1PluginManager-members.htm">List of all members</a>  </div>
-  <div class="headertitle">
-<div class="title">pluma::PluginManager Class Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Manages loaded plugins.  
- <a href="classpluma_1_1PluginManager.htm#details">More...</a></p>
-
-<p><code>#include &lt;<a class="el" href="PluginManager_8hpp_source.htm">PluginManager.hpp</a>&gt;</code></p>
-<div class="dynheader">
-Inheritance diagram for pluma::PluginManager:</div>
-<div class="dyncontent">
- <div class="center">
-  <img src="classpluma_1_1PluginManager.png" usemap="#pluma::PluginManager_map" alt=""/>
-  <map id="pluma::PluginManager_map" name="pluma::PluginManager_map">
-<area href="classpluma_1_1Pluma.htm" title="Pluma plugins management. " alt="pluma::Pluma" shape="rect" coords="0,56,137,80"/>
-</map>
- </div></div>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
-Public Member Functions</h2></td></tr>
-<tr class="memitem:a4d7a0e1151b75300350834a59db5748b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">~PluginManager</a> ()</td></tr>
-<tr class="memdesc:a4d7a0e1151b75300350834a59db5748b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a4d7a0e1151b75300350834a59db5748b">More...</a><br/></td></tr>
-<tr class="separator:a4d7a0e1151b75300350834a59db5748b"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:aa00400d23efa8a8f94e44dd1c5bf54e6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a> (const std::string &amp;path)</td></tr>
-<tr class="memdesc:aa00400d23efa8a8f94e44dd1c5bf54e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a plugin given it's path.  <a href="#aa00400d23efa8a8f94e44dd1c5bf54e6">More...</a><br/></td></tr>
-<tr class="separator:aa00400d23efa8a8f94e44dd1c5bf54e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a866127044950094bb789260bc15a2874"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874">load</a> (const std::string &amp;folder, const std::string &amp;pluginName)</td></tr>
-<tr class="memdesc:a866127044950094bb789260bc15a2874"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a plugin from a given folder.  <a href="#a866127044950094bb789260bc15a2874">More...</a><br/></td></tr>
-<tr class="separator:a866127044950094bb789260bc15a2874"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a4d892e345288c26dea091d62ee2b03eb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">loadFromFolder</a> (const std::string &amp;folder, bool recursive=false)</td></tr>
-<tr class="memdesc:a4d892e345288c26dea091d62ee2b03eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load all plugins from a given folder.  <a href="#a4d892e345288c26dea091d62ee2b03eb">More...</a><br/></td></tr>
-<tr class="separator:a4d892e345288c26dea091d62ee2b03eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a52f6408d4cf95c6f36b518ab2d3a7745"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">unload</a> (const std::string &amp;pluginName)</td></tr>
-<tr class="memdesc:a52f6408d4cf95c6f36b518ab2d3a7745"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unload a plugin.  <a href="#a52f6408d4cf95c6f36b518ab2d3a7745">More...</a><br/></td></tr>
-<tr class="separator:a52f6408d4cf95c6f36b518ab2d3a7745"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a697a20dc97957e0c2a5dad33f39d93db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">unloadAll</a> ()</td></tr>
-<tr class="memdesc:a697a20dc97957e0c2a5dad33f39d93db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unload all loaded plugins.  <a href="#a697a20dc97957e0c2a5dad33f39d93db">More...</a><br/></td></tr>
-<tr class="separator:a697a20dc97957e0c2a5dad33f39d93db"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:af27f8e89b8e29359495b6398464ebf02"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">addProvider</a> (<a class="el" href="classpluma_1_1Provider.htm">Provider</a> *provider)</td></tr>
-<tr class="memdesc:af27f8e89b8e29359495b6398464ebf02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Directly add a new provider.  <a href="#af27f8e89b8e29359495b6398464ebf02">More...</a><br/></td></tr>
-<tr class="separator:af27f8e89b8e29359495b6398464ebf02"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a187e60d3fe7524774c08eb58ebcb843f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">getLoadedPlugins</a> (std::vector&lt; const std::string * &gt; &amp;pluginNames) const </td></tr>
-<tr class="memdesc:a187e60d3fe7524774c08eb58ebcb843f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the name of all loaded plugins.  <a href="#a187e60d3fe7524774c08eb58ebcb843f">More...</a><br/></td></tr>
-<tr class="separator:a187e60d3fe7524774c08eb58ebcb843f"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:adbd75738cd4d8969608c9da8b58a03c3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">isLoaded</a> (const std::string &amp;pluginName) const </td></tr>
-<tr class="memdesc:adbd75738cd4d8969608c9da8b58a03c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a plug-in is loaded.  <a href="#adbd75738cd4d8969608c9da8b58a03c3">More...</a><br/></td></tr>
-<tr class="separator:adbd75738cd4d8969608c9da8b58a03c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
-Protected Member Functions</h2></td></tr>
-<tr class="memitem:a8378a698812f8f079ff8aea7c1474d67"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">PluginManager</a> ()</td></tr>
-<tr class="memdesc:a8378a698812f8f079ff8aea7c1474d67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#a8378a698812f8f079ff8aea7c1474d67">More...</a><br/></td></tr>
-<tr class="separator:a8378a698812f8f079ff8aea7c1474d67"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ab70b5b6b719bdbd64c27ae2dcb12a64d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">registerType</a> (const std::string &amp;type, unsigned int version, unsigned int lowestVersion)</td></tr>
-<tr class="memdesc:ab70b5b6b719bdbd64c27ae2dcb12a64d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a provider type.  <a href="#ab70b5b6b719bdbd64c27ae2dcb12a64d">More...</a><br/></td></tr>
-<tr class="separator:ab70b5b6b719bdbd64c27ae2dcb12a64d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ad5eab1dcae10122fdfb8d94d7b391e9e"><td class="memItemLeft" align="right" valign="top">const std::list&lt; <a class="el" href="classpluma_1_1Provider.htm">Provider</a> * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">getProviders</a> (const std::string &amp;type) const </td></tr>
-<tr class="memdesc:ad5eab1dcae10122fdfb8d94d7b391e9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get providers of a certain type.  <a href="#ad5eab1dcae10122fdfb8d94d7b391e9e">More...</a><br/></td></tr>
-<tr class="separator:ad5eab1dcae10122fdfb8d94d7b391e9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Manages loaded plugins. </p>
-
-<p>Definition at line <a class="el" href="PluginManager_8hpp_source.htm#l00044">44</a> of file <a class="el" href="PluginManager_8hpp_source.htm">PluginManager.hpp</a>.</p>
-</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
-<a class="anchor" id="a4d7a0e1151b75300350834a59db5748b"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">pluma::PluginManager::~PluginManager </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Destructor. </p>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00043">43</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a8378a698812f8f079ff8aea7c1474d67"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">pluma::PluginManager::PluginManager </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Default constructor. </p>
-<p><a class="el" href="classpluma_1_1PluginManager.htm" title="Manages loaded plugins. ">PluginManager</a> cannot be publicly instantiated. </p>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00037">37</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<h2 class="groupheader">Member Function Documentation</h2>
-<a class="anchor" id="af27f8e89b8e29359495b6398464ebf02"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::addProvider </td>
-          <td>(</td>
-          <td class="paramtype"><a class="el" href="classpluma_1_1Provider.htm">Provider</a> *&#160;</td>
-          <td class="paramname"><em>provider</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Directly add a new provider. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">provider</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a>. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00168">168</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a187e60d3fe7524774c08eb58ebcb843f"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::PluginManager::getLoadedPlugins </td>
-          <td>(</td>
-          <td class="paramtype">std::vector&lt; const std::string * &gt; &amp;&#160;</td>
-          <td class="paramname"><em>pluginNames</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Get the name of all loaded plugins. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">pluginNames</td><td>A vector to fill with the plugins names. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00178">178</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="ad5eab1dcae10122fdfb8d94d7b391e9e"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">const std::list&lt; <a class="el" href="classpluma_1_1Provider.htm">Provider</a> * &gt; * pluma::PluginManager::getProviders </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>type</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Get providers of a certain type. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">type</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a> type.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Pointer to the list of providers of that <em>type</em>, or NULL if <em>type</em> is not registered.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd>Host::getProviders </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00194">194</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="adbd75738cd4d8969608c9da8b58a03c3"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::isLoaded </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>pluginName</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Check if a plug-in is loaded. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">pluginName</td><td>the plug-in tname o check. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00188">188</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="aa00400d23efa8a8f94e44dd1c5bf54e6"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::load </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>path</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Load a plugin given it's path. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">path</td><td>Path for the plugin, including plugin name. File extension may be included, but is discouraged for better cross platform code. If file extension isn't present on the path, <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> will deduce it from the operating system.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the plugin is successfully loaded.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00049">49</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a866127044950094bb789260bc15a2874"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::load </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>folder</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>pluginName</em>&#160;</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>)</td>
-          <td></td><td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Load a plugin from a given folder. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">folder</td><td>The folder path. </td></tr>
-    <tr><td class="paramname">pluginName</td><td>Name of the plugin. File extension may be included, but is discouraged for better cross platform code. If file extension is omitted, <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> will deduce it from the operating system.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the plugin is successfully loaded.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00085">85</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a4d892e345288c26dea091d62ee2b03eb"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">int pluma::PluginManager::loadFromFolder </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>folder</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">bool&#160;</td>
-          <td class="paramname"><em>recursive</em> = <code>false</code>&#160;</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>)</td>
-          <td></td><td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Load all plugins from a given folder. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">folder</td><td>Path for the folder where the plug-ins are. </td></tr>
-    <tr><td class="paramname">recursive</td><td>If true it will search on sub-folders as well</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Number of successfully loaded plug-ins.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00095">95</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="ab70b5b6b719bdbd64c27ae2dcb12a64d"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::PluginManager::registerType </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>type</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">unsigned int&#160;</td>
-          <td class="paramname"><em>version</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">unsigned int&#160;</td>
-          <td class="paramname"><em>lowestVersion</em>&#160;</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>)</td>
-          <td></td><td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Register a provider type. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">type</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a> type. </td></tr>
-    <tr><td class="paramname">version</td><td>Current version of that provider type. </td></tr>
-    <tr><td class="paramname">lowestVersion</td><td>Lowest compatible version of that provider type.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section see"><dt>See Also</dt><dd>Host::registerType </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00162">162</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a52f6408d4cf95c6f36b518ab2d3a7745"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::unload </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>pluginName</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Unload a plugin. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">pluginName</td><td>Name or path of the plugin.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the plugin is successfully unloaded, false if no such plugin exists on the manager.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00109">109</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a697a20dc97957e0c2a5dad33f39d93db"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::PluginManager::unloadAll </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Unload all loaded plugins. </p>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00122">122</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<hr/>The documentation for this class was generated from the following files:<ul>
-<li><a class="el" href="PluginManager_8hpp_source.htm">PluginManager.hpp</a></li>
-<li><a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a></li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1PluginManager.png b/doc/third_party/Pluma/html/classpluma_1_1PluginManager.png
deleted file mode 100644 (file)
index a5fc17e..0000000
Binary files a/doc/third_party/Pluma/html/classpluma_1_1PluginManager.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Pluma-members.htm b/doc/third_party/Pluma/html/classpluma_1_1Pluma-members.htm
deleted file mode 100644 (file)
index 074fc71..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1Pluma.htm">Pluma</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">pluma::Pluma Member List</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>This is the complete list of members for <a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a>, including all inherited members.</p>
-<table class="directory">
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">acceptProviderType</a>()</td><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a></td><td class="entry"></td></tr>
-  <tr bgcolor="#f0f0f0"><td class="entry"><b>acceptProviderType</b>() (defined in <a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a>)</td><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">addProvider</a>(Provider *provider)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">getLoadedPlugins</a>(std::vector&lt; const std::string * &gt; &amp;pluginNames) const </td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">getProviders</a>(std::vector&lt; ProviderType * &gt; &amp;providers)</td><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a></td><td class="entry"></td></tr>
-  <tr bgcolor="#f0f0f0"><td class="entry"><b>getProviders</b>(std::vector&lt; ProviderType * &gt; &amp;providers) (defined in <a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a>)</td><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">pluma::PluginManager::getProviders</a>(const std::string &amp;type) const </td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">isLoaded</a>(const std::string &amp;pluginName) const </td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(const std::string &amp;path)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874">load</a>(const std::string &amp;folder, const std::string &amp;pluginName)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">loadFromFolder</a>(const std::string &amp;folder, bool recursive=false)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">PluginManager</a>()</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">Pluma</a>()</td><td class="entry"><a class="el" href="classpluma_1_1Pluma.htm">pluma::Pluma</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">registerType</a>(const std::string &amp;type, unsigned int version, unsigned int lowestVersion)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">unload</a>(const std::string &amp;pluginName)</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">unloadAll</a>()</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">~PluginManager</a>()</td><td class="entry"><a class="el" href="classpluma_1_1PluginManager.htm">pluma::PluginManager</a></td><td class="entry"></td></tr>
-</table></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Pluma.htm b/doc/third_party/Pluma/html/classpluma_1_1Pluma.htm
deleted file mode 100644 (file)
index 95fc1bd..0000000
+++ /dev/null
@@ -1,650 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1Pluma.htm">Pluma</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="summary">
-<a href="#pub-methods">Public Member Functions</a> &#124;
-<a href="#pro-methods">Protected Member Functions</a> &#124;
-<a href="classpluma_1_1Pluma-members.htm">List of all members</a>  </div>
-  <div class="headertitle">
-<div class="title">pluma::Pluma Class Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p><a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> plugins management.  
- <a href="classpluma_1_1Pluma.htm#details">More...</a></p>
-
-<p><code>#include &lt;<a class="el" href="Pluma_8hpp_source.htm">Pluma.hpp</a>&gt;</code></p>
-<div class="dynheader">
-Inheritance diagram for pluma::Pluma:</div>
-<div class="dyncontent">
- <div class="center">
-  <img src="classpluma_1_1Pluma.png" usemap="#pluma::Pluma_map" alt=""/>
-  <map id="pluma::Pluma_map" name="pluma::Pluma_map">
-<area href="classpluma_1_1PluginManager.htm" title="Manages loaded plugins. " alt="pluma::PluginManager" shape="rect" coords="0,0,137,24"/>
-</map>
- </div></div>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
-Public Member Functions</h2></td></tr>
-<tr class="memitem:adf4e065f5169931f6290f3828b49e7bb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">Pluma</a> ()</td></tr>
-<tr class="memdesc:adf4e065f5169931f6290f3828b49e7bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor.  <a href="#adf4e065f5169931f6290f3828b49e7bb">More...</a><br/></td></tr>
-<tr class="separator:adf4e065f5169931f6290f3828b49e7bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a200c59b0983c7ca53d11b03cf8220bc7"><td class="memTemplParams" colspan="2">template&lt;typename ProviderType &gt; </td></tr>
-<tr class="memitem:a200c59b0983c7ca53d11b03cf8220bc7"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">acceptProviderType</a> ()</td></tr>
-<tr class="memdesc:a200c59b0983c7ca53d11b03cf8220bc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> to accept a certain type of providers.  <a href="#a200c59b0983c7ca53d11b03cf8220bc7">More...</a><br/></td></tr>
-<tr class="separator:a200c59b0983c7ca53d11b03cf8220bc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a49fa0b2b4497885c4e978259be0a7abe"><td class="memTemplParams" colspan="2">template&lt;typename ProviderType &gt; </td></tr>
-<tr class="memitem:a49fa0b2b4497885c4e978259be0a7abe"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">getProviders</a> (std::vector&lt; ProviderType * &gt; &amp;providers)</td></tr>
-<tr class="memdesc:a49fa0b2b4497885c4e978259be0a7abe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the stored providers of a certain type.  <a href="#a49fa0b2b4497885c4e978259be0a7abe">More...</a><br/></td></tr>
-<tr class="separator:a49fa0b2b4497885c4e978259be0a7abe"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a200c59b0983c7ca53d11b03cf8220bc7"><td class="memTemplParams" colspan="2"><a class="anchor" id="a200c59b0983c7ca53d11b03cf8220bc7"></a>
-template&lt;typename ProviderType &gt; </td></tr>
-<tr class="memitem:a200c59b0983c7ca53d11b03cf8220bc7"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><b>acceptProviderType</b> ()</td></tr>
-<tr class="separator:a200c59b0983c7ca53d11b03cf8220bc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a49fa0b2b4497885c4e978259be0a7abe"><td class="memTemplParams" colspan="2"><a class="anchor" id="a49fa0b2b4497885c4e978259be0a7abe"></a>
-template&lt;typename ProviderType &gt; </td></tr>
-<tr class="memitem:a49fa0b2b4497885c4e978259be0a7abe"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><b>getProviders</b> (std::vector&lt; ProviderType * &gt; &amp;providers)</td></tr>
-<tr class="separator:a49fa0b2b4497885c4e978259be0a7abe"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:aa00400d23efa8a8f94e44dd1c5bf54e6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a> (const std::string &amp;path)</td></tr>
-<tr class="memdesc:aa00400d23efa8a8f94e44dd1c5bf54e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a plugin given it's path.  <a href="#aa00400d23efa8a8f94e44dd1c5bf54e6">More...</a><br/></td></tr>
-<tr class="separator:aa00400d23efa8a8f94e44dd1c5bf54e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a866127044950094bb789260bc15a2874"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874">load</a> (const std::string &amp;folder, const std::string &amp;pluginName)</td></tr>
-<tr class="memdesc:a866127044950094bb789260bc15a2874"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a plugin from a given folder.  <a href="#a866127044950094bb789260bc15a2874">More...</a><br/></td></tr>
-<tr class="separator:a866127044950094bb789260bc15a2874"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a4d892e345288c26dea091d62ee2b03eb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">loadFromFolder</a> (const std::string &amp;folder, bool recursive=false)</td></tr>
-<tr class="memdesc:a4d892e345288c26dea091d62ee2b03eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load all plugins from a given folder.  <a href="#a4d892e345288c26dea091d62ee2b03eb">More...</a><br/></td></tr>
-<tr class="separator:a4d892e345288c26dea091d62ee2b03eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a52f6408d4cf95c6f36b518ab2d3a7745"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">unload</a> (const std::string &amp;pluginName)</td></tr>
-<tr class="memdesc:a52f6408d4cf95c6f36b518ab2d3a7745"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unload a plugin.  <a href="#a52f6408d4cf95c6f36b518ab2d3a7745">More...</a><br/></td></tr>
-<tr class="separator:a52f6408d4cf95c6f36b518ab2d3a7745"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a697a20dc97957e0c2a5dad33f39d93db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">unloadAll</a> ()</td></tr>
-<tr class="memdesc:a697a20dc97957e0c2a5dad33f39d93db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unload all loaded plugins.  <a href="#a697a20dc97957e0c2a5dad33f39d93db">More...</a><br/></td></tr>
-<tr class="separator:a697a20dc97957e0c2a5dad33f39d93db"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:af27f8e89b8e29359495b6398464ebf02"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">addProvider</a> (<a class="el" href="classpluma_1_1Provider.htm">Provider</a> *provider)</td></tr>
-<tr class="memdesc:af27f8e89b8e29359495b6398464ebf02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Directly add a new provider.  <a href="#af27f8e89b8e29359495b6398464ebf02">More...</a><br/></td></tr>
-<tr class="separator:af27f8e89b8e29359495b6398464ebf02"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a187e60d3fe7524774c08eb58ebcb843f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">getLoadedPlugins</a> (std::vector&lt; const std::string * &gt; &amp;pluginNames) const </td></tr>
-<tr class="memdesc:a187e60d3fe7524774c08eb58ebcb843f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the name of all loaded plugins.  <a href="#a187e60d3fe7524774c08eb58ebcb843f">More...</a><br/></td></tr>
-<tr class="separator:a187e60d3fe7524774c08eb58ebcb843f"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:adbd75738cd4d8969608c9da8b58a03c3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">isLoaded</a> (const std::string &amp;pluginName) const </td></tr>
-<tr class="memdesc:adbd75738cd4d8969608c9da8b58a03c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a plug-in is loaded.  <a href="#adbd75738cd4d8969608c9da8b58a03c3">More...</a><br/></td></tr>
-<tr class="separator:adbd75738cd4d8969608c9da8b58a03c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
-Protected Member Functions</h2></td></tr>
-<tr class="memitem:ab70b5b6b719bdbd64c27ae2dcb12a64d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">registerType</a> (const std::string &amp;type, unsigned int version, unsigned int lowestVersion)</td></tr>
-<tr class="memdesc:ab70b5b6b719bdbd64c27ae2dcb12a64d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a provider type.  <a href="#ab70b5b6b719bdbd64c27ae2dcb12a64d">More...</a><br/></td></tr>
-<tr class="separator:ab70b5b6b719bdbd64c27ae2dcb12a64d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ad5eab1dcae10122fdfb8d94d7b391e9e"><td class="memItemLeft" align="right" valign="top">const std::list&lt; <a class="el" href="classpluma_1_1Provider.htm">Provider</a> * &gt; *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">getProviders</a> (const std::string &amp;type) const </td></tr>
-<tr class="memdesc:ad5eab1dcae10122fdfb8d94d7b391e9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get providers of a certain type.  <a href="#ad5eab1dcae10122fdfb8d94d7b391e9e">More...</a><br/></td></tr>
-<tr class="separator:ad5eab1dcae10122fdfb8d94d7b391e9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p><a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> plugins management. </p>
-<p><a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> is the main class of <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> library. Allows hosting applications to load/unload dlls in runtime (plugins), and to get providers of shared interface objects.</p>
-<p>Example: </p>
-<div class="fragment"><div class="line"><a class="code" href="classpluma_1_1Pluma.htm">pluma::Pluma</a> pluma;</div>
-<div class="line"><span class="comment">// Tell it to accept providers of the type DeviceProvider</span></div>
-<div class="line">pluma.<a class="code" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">acceptProviderType</a>&lt;DeviceProvider&gt;();</div>
-<div class="line"><span class="comment">// Load some dll</span></div>
-<div class="line">pluma.<a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(<span class="stringliteral">&quot;plugins/standard_devices&quot;</span>);</div>
-<div class="line"><span class="comment">// Get device providers into a vector</span></div>
-<div class="line">std::vector&lt;DeviceProvider*&gt; providers;</div>
-<div class="line">pluma.<a class="code" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">getProviders</a>(providers);</div>
-<div class="line"><span class="comment">// create a Device from the first provider</span></div>
-<div class="line"><span class="keywordflow">if</span> (!providers.empty()){</div>
-<div class="line">    Device* myDevice = providers.first()-&gt;create();</div>
-<div class="line">    <span class="comment">// do something with myDevice</span></div>
-<div class="line">    std::cout &lt;&lt; device-&gt;getDescription() &lt;&lt; std::endl;</div>
-<div class="line">    <span class="comment">// (...)</span></div>
-<div class="line">    <span class="keyword">delete</span> myDevice;</div>
-<div class="line">}</div>
-</div><!-- fragment --><p>It is also possible to add local providers, providers that are defined directly on the host application. That can be useful to provide and use default implementations of certain interfaces, along with plugin implementations. </p>
-
-<p>Definition at line <a class="el" href="Pluma_8hpp_source.htm#l00094">94</a> of file <a class="el" href="Pluma_8hpp_source.htm">Pluma.hpp</a>.</p>
-</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
-<a class="anchor" id="adf4e065f5169931f6290f3828b49e7bb"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">Pluma::Pluma </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Default Constructor. </p>
-
-<p>Definition at line <a class="el" href="Pluma_8inl_source.htm#l00027">27</a> of file <a class="el" href="Pluma_8inl_source.htm">Pluma.inl</a>.</p>
-
-</div>
-</div>
-<h2 class="groupheader">Member Function Documentation</h2>
-<a class="anchor" id="a200c59b0983c7ca53d11b03cf8220bc7"></a>
-<div class="memitem">
-<div class="memproto">
-<div class="memtemplate">
-template&lt;typename ProviderType &gt; </div>
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::Pluma::acceptProviderType </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Tell <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> to accept a certain type of providers. </p>
-<p>A <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> object is able to accept multiple types of providers. When a plugin is loaded, it tries to register it's providers implementations. Those are only accepted by the host application if it's accepting providers of that kind.</p>
-<dl class="tparams"><dt>Template Parameters</dt><dd>
-  <table class="tparams">
-    <tr><td class="paramname">ProviderType</td><td>type of provider. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-</div>
-</div>
-<a class="anchor" id="af27f8e89b8e29359495b6398464ebf02"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::addProvider </td>
-          <td>(</td>
-          <td class="paramtype"><a class="el" href="classpluma_1_1Provider.htm">Provider</a> *&#160;</td>
-          <td class="paramname"><em>provider</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Directly add a new provider. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">provider</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a>. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00168">168</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a187e60d3fe7524774c08eb58ebcb843f"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::PluginManager::getLoadedPlugins </td>
-          <td>(</td>
-          <td class="paramtype">std::vector&lt; const std::string * &gt; &amp;&#160;</td>
-          <td class="paramname"><em>pluginNames</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Get the name of all loaded plugins. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">pluginNames</td><td>A vector to fill with the plugins names. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00178">178</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a49fa0b2b4497885c4e978259be0a7abe"></a>
-<div class="memitem">
-<div class="memproto">
-<div class="memtemplate">
-template&lt;typename ProviderType &gt; </div>
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::Pluma::getProviders </td>
-          <td>(</td>
-          <td class="paramtype">std::vector&lt; ProviderType * &gt; &amp;&#160;</td>
-          <td class="paramname"><em>providers</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Get the stored providers of a certain type. </p>
-<p>Providers are added at the end of the <em>providers</em> vector.</p>
-<dl class="tparams"><dt>Template Parameters</dt><dd>
-  <table class="tparams">
-    <tr><td class="paramname">ProviderType</td><td>type of provider to be returned. </td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramdir">[out]</td><td class="paramname">providers</td><td>Vector to fill with the existing providers. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-</div>
-</div>
-<a class="anchor" id="ad5eab1dcae10122fdfb8d94d7b391e9e"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">const std::list&lt; <a class="el" href="classpluma_1_1Provider.htm">Provider</a> * &gt; * pluma::PluginManager::getProviders </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>type</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Get providers of a certain type. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">type</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a> type.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Pointer to the list of providers of that <em>type</em>, or NULL if <em>type</em> is not registered.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd>Host::getProviders </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00194">194</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="adbd75738cd4d8969608c9da8b58a03c3"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::isLoaded </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>pluginName</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Check if a plug-in is loaded. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">pluginName</td><td>the plug-in tname o check. </td></tr>
-  </table>
-  </dd>
-</dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00188">188</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="aa00400d23efa8a8f94e44dd1c5bf54e6"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::load </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>path</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Load a plugin given it's path. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">path</td><td>Path for the plugin, including plugin name. File extension may be included, but is discouraged for better cross platform code. If file extension isn't present on the path, <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> will deduce it from the operating system.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the plugin is successfully loaded.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00049">49</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a866127044950094bb789260bc15a2874"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::load </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>folder</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>pluginName</em>&#160;</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>)</td>
-          <td></td><td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Load a plugin from a given folder. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">folder</td><td>The folder path. </td></tr>
-    <tr><td class="paramname">pluginName</td><td>Name of the plugin. File extension may be included, but is discouraged for better cross platform code. If file extension is omitted, <a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> will deduce it from the operating system.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the plugin is successfully loaded.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00085">85</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a4d892e345288c26dea091d62ee2b03eb"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">int pluma::PluginManager::loadFromFolder </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>folder</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">bool&#160;</td>
-          <td class="paramname"><em>recursive</em> = <code>false</code>&#160;</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>)</td>
-          <td></td><td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Load all plugins from a given folder. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">folder</td><td>Path for the folder where the plug-ins are. </td></tr>
-    <tr><td class="paramname">recursive</td><td>If true it will search on sub-folders as well</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Number of successfully loaded plug-ins.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00095">95</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="ab70b5b6b719bdbd64c27ae2dcb12a64d"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::PluginManager::registerType </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>type</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">unsigned int&#160;</td>
-          <td class="paramname"><em>version</em>, </td>
-        </tr>
-        <tr>
-          <td class="paramkey"></td>
-          <td></td>
-          <td class="paramtype">unsigned int&#160;</td>
-          <td class="paramname"><em>lowestVersion</em>&#160;</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>)</td>
-          <td></td><td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Register a provider type. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">type</td><td><a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">Provider</a> type. </td></tr>
-    <tr><td class="paramname">version</td><td>Current version of that provider type. </td></tr>
-    <tr><td class="paramname">lowestVersion</td><td>Lowest compatible version of that provider type.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section see"><dt>See Also</dt><dd>Host::registerType </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00162">162</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a52f6408d4cf95c6f36b518ab2d3a7745"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::PluginManager::unload </td>
-          <td>(</td>
-          <td class="paramtype">const std::string &amp;&#160;</td>
-          <td class="paramname"><em>pluginName</em></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Unload a plugin. </p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">pluginName</td><td>Name or path of the plugin.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if the plugin is successfully unloaded, false if no such plugin exists on the manager.</dd></dl>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db" title="Unload all loaded plugins. ">unloadAll</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00109">109</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<a class="anchor" id="a697a20dc97957e0c2a5dad33f39d93db"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">void pluma::PluginManager::unloadAll </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">inherited</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Unload all loaded plugins. </p>
-<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classpluma_1_1PluginManager.htm#a866127044950094bb789260bc15a2874" title="Load a plugin from a given folder. ">load(const std::string&amp;, const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6" title="Load a plugin given it&#39;s path. ">load(const std::string&amp;)</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb" title="Load all plugins from a given folder. ">loadFromFolder</a> </dd>
-<dd>
-<a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745" title="Unload a plugin. ">unload</a> </dd></dl>
-
-<p>Definition at line <a class="el" href="PluginManager_8cpp_source.htm#l00122">122</a> of file <a class="el" href="PluginManager_8cpp_source.htm">PluginManager.cpp</a>.</p>
-
-</div>
-</div>
-<hr/>The documentation for this class was generated from the following files:<ul>
-<li><a class="el" href="Pluma_8hpp_source.htm">Pluma.hpp</a></li>
-<li><a class="el" href="Pluma_8inl_source.htm">Pluma.inl</a></li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Pluma.png b/doc/third_party/Pluma/html/classpluma_1_1Pluma.png
deleted file mode 100644 (file)
index 29983ad..0000000
Binary files a/doc/third_party/Pluma/html/classpluma_1_1Pluma.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Provider-members.htm b/doc/third_party/Pluma/html/classpluma_1_1Provider-members.htm
deleted file mode 100644 (file)
index 7dfdf91..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1Provider.htm">Provider</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">pluma::Provider Member List</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>This is the complete list of members for <a class="el" href="classpluma_1_1Provider.htm">pluma::Provider</a>, including all inherited members.</p>
-<table class="directory">
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1Provider.htm#af8643b65e111e010edff6e7a489265e6">getVersion</a>() const =0</td><td class="entry"><a class="el" href="classpluma_1_1Provider.htm">pluma::Provider</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr>
-  <tr bgcolor="#f0f0f0"><td class="entry"><b>Host</b> (defined in <a class="el" href="classpluma_1_1Provider.htm">pluma::Provider</a>)</td><td class="entry"><a class="el" href="classpluma_1_1Provider.htm">pluma::Provider</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
-  <tr class="even"><td class="entry"><a class="el" href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">isCompatible</a>(const Host &amp;host) const </td><td class="entry"><a class="el" href="classpluma_1_1Provider.htm">pluma::Provider</a></td><td class="entry"></td></tr>
-  <tr><td class="entry"><a class="el" href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">~Provider</a>()</td><td class="entry"><a class="el" href="classpluma_1_1Provider.htm">pluma::Provider</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
-</table></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/classpluma_1_1Provider.htm b/doc/third_party/Pluma/html/classpluma_1_1Provider.htm
deleted file mode 100644 (file)
index ea7b0ee..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-<div id="nav-path" class="navpath">
-  <ul>
-<li class="navelem"><b>pluma</b></li><li class="navelem"><a class="el" href="classpluma_1_1Provider.htm">Provider</a></li>  </ul>
-</div>
-</div><!-- top -->
-<div class="header">
-  <div class="summary">
-<a href="#pub-methods">Public Member Functions</a> &#124;
-<a href="#friends">Friends</a> &#124;
-<a href="classpluma_1_1Provider-members.htm">List of all members</a>  </div>
-  <div class="headertitle">
-<div class="title">pluma::Provider Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Interface to provide applications with objects from plugins.  
- <a href="classpluma_1_1Provider.htm#details">More...</a></p>
-
-<p><code>#include &lt;<a class="el" href="Provider_8hpp_source.htm">Provider.hpp</a>&gt;</code></p>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
-Public Member Functions</h2></td></tr>
-<tr class="memitem:a111a1db902d6372282f8407c9d845c21"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">~Provider</a> ()</td></tr>
-<tr class="memdesc:a111a1db902d6372282f8407c9d845c21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a111a1db902d6372282f8407c9d845c21">More...</a><br/></td></tr>
-<tr class="separator:a111a1db902d6372282f8407c9d845c21"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:af8643b65e111e010edff6e7a489265e6"><td class="memItemLeft" align="right" valign="top">virtual unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1Provider.htm#af8643b65e111e010edff6e7a489265e6">getVersion</a> () const =0</td></tr>
-<tr class="memdesc:af8643b65e111e010edff6e7a489265e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get provider version.  <a href="#af8643b65e111e010edff6e7a489265e6">More...</a><br/></td></tr>
-<tr class="separator:af8643b65e111e010edff6e7a489265e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a192ea5a17a8fe9de1f3ba6572f44f266"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">isCompatible</a> (const <a class="el" href="classpluma_1_1Host.htm">Host</a> &amp;host) const </td></tr>
-<tr class="memdesc:a192ea5a17a8fe9de1f3ba6572f44f266"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check compatibility with host.  <a href="#a192ea5a17a8fe9de1f3ba6572f44f266">More...</a><br/></td></tr>
-<tr class="separator:a192ea5a17a8fe9de1f3ba6572f44f266"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
-Friends</h2></td></tr>
-<tr class="memitem:a912b690126957a1ad90d0c373a4ad4d0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a912b690126957a1ad90d0c373a4ad4d0"></a>
-class&#160;</td><td class="memItemRight" valign="bottom"><b>Host</b></td></tr>
-<tr class="separator:a912b690126957a1ad90d0c373a4ad4d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Interface to provide applications with objects from plugins. </p>
-<p>The plugin specific implementations are unknown at the host side, only their shared interfaces are known. Then, host app needs a generic way of create interface objects. That's what provider classes are for. It is the factory design pattern (<a href="http://www.oodesign.com/factory-pattern.html">http://www.oodesign.com/factory-pattern.html</a>)</p>
-<p>Shared interfaces define their provider types (by inheriting from <a class="el" href="classpluma_1_1Provider.htm" title="Interface to provide applications with objects from plugins. ">pluma::Provider</a>). Hosts then use those tipes to get objects from the plugins. Plugins derive the shared interface providers so that they can provide host with specific implementations of the shared interface. Those specific providers are given to the host through a connect function.</p>
-<p>Example: A host app uses objects of type Device. A certain plugin defines a Keyboard, witch is a Device. The <a class="el" href="classpluma_1_1Host.htm" title="Manages providers. ">Host</a> will use DeviceProviders to create objects of type Device. The plugin will provide host specifically with a KeyboardProvider. Other plugins may provide host with other derived DeviceProvider types.</p>
-<p>Device hpp (shared): </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"><span class="keyword">class </span>Device{</div>
-<div class="line"><span class="keyword">public</span>:</div>
-<div class="line">    <span class="keyword">virtual</span> std::string getDescription() <span class="keyword">const</span> = 0;</div>
-<div class="line">};</div>
-<div class="line"><span class="comment">// create DevicedProvider class</span></div>
-<div class="line">PLUMA_PROVIDER_HEADER(Device);</div>
-</div><!-- fragment --><p>Device cpp (shared): </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;Device.hpp&quot;</span></div>
-<div class="line">generate DevicedProvider with version 6, and compatible with at least v.3</div>
-<div class="line">PLUMA_PROVIDER_SOURCE(Device, 6, 3);</div>
-</div><!-- fragment --><p><br/>
- Keyboard code on the plugin side: </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"><span class="preprocessor">#include &quot;Device.hpp&quot;</span></div>
-<div class="line"></div>
-<div class="line"><span class="keyword">class </span>Keyboard: <span class="keyword">public</span> Device{</div>
-<div class="line"><span class="keyword">public</span>:</div>
-<div class="line">    std::string getDescription()<span class="keyword"> const</span>{</div>
-<div class="line">        <span class="keywordflow">return</span> <span class="stringliteral">&quot;keyboard&quot;</span>;</div>
-<div class="line">    }</div>
-<div class="line">};</div>
-<div class="line"></div>
-<div class="line"><span class="comment">// create KeyboardProvider, it implements DeviceProvider</span></div>
-<div class="line">PLUMA_INHERIT_PROVIDER(Keyboard, Device);</div>
-</div><!-- fragment --><p>plugin connector: </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Connector.hpp&gt;</span></div>
-<div class="line"><span class="preprocessor">#include &quot;Keyboard.hpp&quot;</span></div>
-<div class="line"></div>
-<div class="line">PLUMA_CONNECTOR</div>
-<div class="line"><span class="keywordtype">bool</span> connect(<a class="code" href="classpluma_1_1Host.htm">pluma::Host</a>&amp; host){</div>
-<div class="line">    <span class="comment">// add a keyboard provider to host</span></div>
-<div class="line">    host.<a class="code" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">add</a>( <span class="keyword">new</span> KeyboardProvider() );</div>
-<div class="line">    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line">}</div>
-</div><!-- fragment --><p><a class="el" href="classpluma_1_1Host.htm" title="Manages providers. ">Host</a> application code: </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"></div>
-<div class="line"><span class="preprocessor">#include &quot;Device.hpp&quot;</span></div>
-<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
-<div class="line"><span class="preprocessor">#include &lt;vector&gt;</span></div>
-<div class="line"></div>
-<div class="line"><span class="keywordtype">int</span> main(){</div>
-<div class="line"></div>
-<div class="line">    <a class="code" href="classpluma_1_1Pluma.htm">pluma::Pluma</a> plugins;</div>
-<div class="line">    <span class="comment">// Tell plugins manager to accept providers of the type DeviceProvider</span></div>
-<div class="line">    plugins.<a class="code" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">acceptProviderType</a>&lt;DeviceProvider&gt;();</div>
-<div class="line">    <span class="comment">// Load library &quot;standard_devices&quot; from folder &quot;plugins&quot;</span></div>
-<div class="line">    plugins.<a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(<span class="stringliteral">&quot;plugins&quot;</span>, <span class="stringliteral">&quot;standard_devices&quot;</span>);</div>
-<div class="line"></div>
-<div class="line">    <span class="comment">// Get device providers into a vector</span></div>
-<div class="line">    std::vector&lt;DeviceProvider*&gt; providers;</div>
-<div class="line">    plugins.<a class="code" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">getProviders</a>(providers);</div>
-<div class="line"></div>
-<div class="line">    <span class="comment">// create a Device from the first provider</span></div>
-<div class="line">    <span class="keywordflow">if</span> (!providers.empty()){</div>
-<div class="line">        Device* myDevice = providers.first()-&gt;create();</div>
-<div class="line">        <span class="comment">// do something with myDevice</span></div>
-<div class="line">        std::cout &lt;&lt; device-&gt;getDescription() &lt;&lt; std::endl;</div>
-<div class="line">        <span class="comment">// and delete it in the end</span></div>
-<div class="line">        <span class="keyword">delete</span> myDevice;</div>
-<div class="line">    }</div>
-<div class="line">    <span class="keywordflow">return</span> 0;</div>
-<div class="line">}</div>
-</div><!-- fragment --> 
-<p>Definition at line <a class="el" href="Provider_8hpp_source.htm#l00042">42</a> of file <a class="el" href="Provider_8hpp_source.htm">Provider.hpp</a>.</p>
-</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
-<a class="anchor" id="a111a1db902d6372282f8407c9d845c21"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">pluma::Provider::~Provider </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td></td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Destructor. </p>
-
-<p>Definition at line <a class="el" href="Provider_8cpp_source.htm#l00036">36</a> of file <a class="el" href="Provider_8cpp_source.htm">Provider.cpp</a>.</p>
-
-</div>
-</div>
-<h2 class="groupheader">Member Function Documentation</h2>
-<a class="anchor" id="af8643b65e111e010edff6e7a489265e6"></a>
-<div class="memitem">
-<div class="memproto">
-<table class="mlabels">
-  <tr>
-  <td class="mlabels-left">
-      <table class="memname">
-        <tr>
-          <td class="memname">virtual unsigned int pluma::Provider::getVersion </td>
-          <td>(</td>
-          <td class="paramname"></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-  </td>
-  <td class="mlabels-right">
-<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
-  </tr>
-</table>
-</div><div class="memdoc">
-
-<p>Get provider version. </p>
-<dl class="section return"><dt>Returns</dt><dd>Version number. </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="a192ea5a17a8fe9de1f3ba6572f44f266"></a>
-<div class="memitem">
-<div class="memproto">
-      <table class="memname">
-        <tr>
-          <td class="memname">bool pluma::Provider::isCompatible </td>
-          <td>(</td>
-          <td class="paramtype">const <a class="el" href="classpluma_1_1Host.htm">Host</a> &amp;&#160;</td>
-          <td class="paramname"><em>host</em></td><td>)</td>
-          <td> const</td>
-        </tr>
-      </table>
-</div><div class="memdoc">
-
-<p>Check compatibility with host. </p>
-<p>The same provider may be compiled with different versions on host side and on plugins side. This function checks if a plugin provider is compatible with the current version of the same provider type on the host side.</p>
-<dl class="params"><dt>Parameters</dt><dd>
-  <table class="params">
-    <tr><td class="paramname">host</td><td><a class="el" href="classpluma_1_1Host.htm" title="Manages providers. ">Host</a>, proxy of host application.</td></tr>
-  </table>
-  </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>True if it's compatible with <em>host</em>. </dd></dl>
-
-<p>Definition at line <a class="el" href="Provider_8cpp_source.htm#l00042">42</a> of file <a class="el" href="Provider_8cpp_source.htm">Provider.cpp</a>.</p>
-
-</div>
-</div>
-<hr/>The documentation for this class was generated from the following files:<ul>
-<li><a class="el" href="Provider_8hpp_source.htm">Provider.hpp</a></li>
-<li><a class="el" href="Provider_8cpp_source.htm">Provider.cpp</a></li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/closed.png b/doc/third_party/Pluma/html/closed.png
deleted file mode 100644 (file)
index 98cc2c9..0000000
Binary files a/doc/third_party/Pluma/html/closed.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/doxygen.css b/doc/third_party/Pluma/html/doxygen.css
deleted file mode 100644 (file)
index 3f2e69f..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-div#logo
-{
-    margin-bottom : 1em;
-    background    : url("./logo-bg.jpg") repeat-x;
-}
-
-div#logo a
-{
-    display : block;
-}
-
-p#footer
-{
-    text-decoration : overline;
-    color           : #606060;
-    padding-top     : 1em;
-    text-align      : center;
-    font-size       : smaller;
-}
-
-p#footer a
-{
-    color           : #007298;
-    text-decoration : none;
-}
-
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
-       font-family: Geneva, Arial, Helvetica, sans-serif;
-}
-BODY,TD {
-       font-size: 90%;
-}
-H1 {
-    text-align    : center;
-    margin-top    : 0px;
-    color         : #2090B0;
-    font-size     : 160%;
-}
-H2 {
-       font-size: 120%;
-}
-H3 {
-       font-size: 100%;
-}
-CAPTION { font-weight: bold }
-DIV.qindex {
-       width: 100%;
-       background-color: #E0FFE0;
-       border: 1px dotted #808080;
-       text-align: center;
-       margin: 2px;
-       padding: 2px;
-       line-height: 140%;
-}
-DIV.nav {
-       width: 100%;
-       background-color: #e8eef2;
-       border: 1px solid #84b0c7;
-       text-align: center;
-       margin: 2px;
-       padding: 2px;
-       line-height: 140%;
-}
-DIV.navtab {
-       background-color: #e8eef2;
-       border: 1px solid #84b0c7;
-       text-align: center;
-       margin: 2px;
-       margin-right: 15px;
-       padding: 2px;
-}
-TD.navtab {
-       font-size: 70%;
-}
-A.qindex {
-       text-decoration: none;
-       font-weight: bold;
-}
-A.qindex:visited {
-       text-decoration: none;
-       font-weight: bold;
-}
-A.qindex:hover {
-       text-decoration: none;
-       background-color: #ddddff;
-}
-A.qindexHL {
-       text-decoration: none;
-       font-weight: bold;
-       background-color: #6666cc;
-       color: #ffffff;
-       border: 1px double #9295C2;
-}
-A.qindexHL:hover {
-       text-decoration: none;
-       background-color: #6666cc;
-       color: #ffffff;
-}
-A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
-A.el { text-decoration: none; font-weight: bold }
-A.elRef { font-weight: bold }
-A.code:link { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;}
-A.code:visited { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;}
-A.codeRef:link { font-weight: normal; color: #0000FF}
-A.codeRef:visited { font-weight: normal; color: #0000FF}
-/*A:hover { text-decoration: none; background-color: #f2f2ff }*/
-DL.el { margin-left: -1cm }
-.fragment {
-       font-family: monospace, fixed;
-       font-size: 95%;
-}
-PRE.fragment {
-       border: 1px solid #CCCCCC;
-       background-color: #f5f5f5;
-       margin-top: 4px;
-       margin-bottom: 4px;
-       margin-left: 2px;
-       margin-right: 8px;
-       padding-left: 6px;
-       padding-right: 6px;
-       padding-top: 4px;
-       padding-bottom: 4px;
-}
-DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
-
-DIV.groupHeader {
-       margin-left: 16px;
-       margin-top: 12px;
-       margin-bottom: 6px;
-       font-weight: bold;
-}
-DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
-BODY {
-       background: white;
-       color: black;
-       margin-right: 20px;
-       margin-left: 20px;
-}
-TD.indexkey {
-       background-color: #e8eef2;
-       font-weight: bold;
-       padding-right  : 10px;
-       padding-top    : 2px;
-       padding-left   : 10px;
-       padding-bottom : 2px;
-       margin-left    : 0px;
-       margin-right   : 0px;
-       margin-top     : 2px;
-       margin-bottom  : 2px;
-       border: 1px solid #CCCCCC;
-}
-TD.indexvalue {
-       background-color: #e8eef2;
-       font-style: italic;
-       padding-right  : 10px;
-       padding-top    : 2px;
-       padding-left   : 10px;
-       padding-bottom : 2px;
-       margin-left    : 0px;
-       margin-right   : 0px;
-       margin-top     : 2px;
-       margin-bottom  : 2px;
-       border: 1px solid #CCCCCC;
-}
-TR.memlist {
-   background-color: #f0f0f0; 
-}
-P.formulaDsp { text-align: center; }
-IMG.formulaDsp { }
-IMG.formulaInl { vertical-align: middle; }
-SPAN.keyword       { color: #0000FF }
-SPAN.keywordtype   { color: #0000FF }
-SPAN.keywordflow   { color: #0000FF }
-SPAN.comment       { color: #008000 }
-SPAN.preprocessor  { color: #008080 }
-SPAN.stringliteral { color: #008080 }
-SPAN.charliteral   { color: #008080 }
-.mdescLeft {
-       padding: 0px 8px 4px 8px;
-       font-size: 80%;
-       font-style: italic;
-       background-color: #FAFAFA;
-       border-top: 1px none #E0E0E0;
-       border-right: 1px none #E0E0E0;
-       border-bottom: 1px none #E0E0E0;
-       border-left: 1px none #E0E0E0;
-       margin: 0px;
-}
-.mdescRight {
-       padding: 0px 8px 4px 8px;
-       font-size: 80%;
-       font-style: italic;
-       background-color: #FAFAFA;
-       border-top: 1px none #E0E0E0;
-       border-right: 1px none #E0E0E0;
-       border-bottom: 1px none #E0E0E0;
-       border-left: 1px none #E0E0E0;
-       margin: 0px;
-}
-.memItemLeft {
-       padding: 1px 0px 0px 8px;
-       margin: 4px;
-       border-top-width: 1px;
-       border-right-width: 1px;
-       border-bottom-width: 1px;
-       border-left-width: 1px;
-       border-top-color: #E0E0E0;
-       border-right-color: #E0E0E0;
-       border-bottom-color: #E0E0E0;
-       border-left-color: #E0E0E0;
-       border-top-style: solid;
-       border-right-style: none;
-       border-bottom-style: none;
-       border-left-style: none;
-       background-color: #FAFAFA;
-       font-size: 80%;
-}
-.memItemRight {
-       padding: 1px 8px 0px 8px;
-       margin: 4px;
-       border-top-width: 1px;
-       border-right-width: 1px;
-       border-bottom-width: 1px;
-       border-left-width: 1px;
-       border-top-color: #E0E0E0;
-       border-right-color: #E0E0E0;
-       border-bottom-color: #E0E0E0;
-       border-left-color: #E0E0E0;
-       border-top-style: solid;
-       border-right-style: none;
-       border-bottom-style: none;
-       border-left-style: none;
-       background-color: #FAFAFA;
-       font-size: 80%;
-}
-.memTemplItemLeft {
-       padding: 1px 0px 0px 8px;
-       margin: 4px;
-       border-top-width: 1px;
-       border-right-width: 1px;
-       border-bottom-width: 1px;
-       border-left-width: 1px;
-       border-top-color: #E0E0E0;
-       border-right-color: #E0E0E0;
-       border-bottom-color: #E0E0E0;
-       border-left-color: #E0E0E0;
-       border-top-style: none;
-       border-right-style: none;
-       border-bottom-style: none;
-       border-left-style: none;
-       background-color: #FAFAFA;
-       font-size: 80%;
-}
-.memTemplItemRight {
-       padding: 1px 8px 0px 8px;
-       margin: 4px;
-       border-top-width: 1px;
-       border-right-width: 1px;
-       border-bottom-width: 1px;
-       border-left-width: 1px;
-       border-top-color: #E0E0E0;
-       border-right-color: #E0E0E0;
-       border-bottom-color: #E0E0E0;
-       border-left-color: #E0E0E0;
-       border-top-style: none;
-       border-right-style: none;
-       border-bottom-style: none;
-       border-left-style: none;
-       background-color: #FAFAFA;
-       font-size: 80%;
-}
-.memTemplParams {
-       padding: 1px 0px 0px 8px;
-       margin: 4px;
-       border-top-width: 1px;
-       border-right-width: 1px;
-       border-bottom-width: 1px;
-       border-left-width: 1px;
-       border-top-color: #E0E0E0;
-       border-right-color: #E0E0E0;
-       border-bottom-color: #E0E0E0;
-       border-left-color: #E0E0E0;
-       border-top-style: solid;
-       border-right-style: none;
-       border-bottom-style: none;
-       border-left-style: none;
-       color: #606060;
-       background-color: #FAFAFA;
-       font-size: 80%;
-}
-.search     { color: #003399;
-              font-weight: bold;
-}
-FORM.search {
-              margin-bottom: 0px;
-              margin-top: 0px;
-}
-INPUT.search { font-size: 75%;
-               color: #000080;
-               font-weight: normal;
-               background-color: #e8eef2;
-}
-TD.tiny      { font-size: 75%;
-}
-a {
-       color: #2090B0;
-}
-a:visited {
-       color: #2090B0;
-}
-.dirtab { padding: 4px;
-          border-collapse: collapse;
-          border: 1px solid #84b0c7;
-}
-TH.dirtab { background: #e8eef2;
-            font-weight: bold;
-}
-HR { height: 1px;
-     border: none;
-     border-top: 1px solid black;
-}
-
-/* Style for detailed member documentation */
-.memtemplate {
-  font-size: 80%;
-  color: #606060;
-  font-weight: normal;
-} 
-.memnav { 
-  background-color: #e8eef2;
-  border: 1px solid #84b0c7;
-  text-align: center;
-  margin: 2px;
-  margin-right: 15px;
-  padding: 2px;
-}
-.memitem {
-  /*padding: 4px;*/
-  background-color: #F0FFF0;
-  border-width: 1px;
-  border-style: solid;
-  border-color: #808080;
-  /*-moz-border-radius: 8px 8px 8px 8px;*/
-}
-.memname {
-  white-space: nowrap;
-  font-weight: bold;
-}
-.memdoc{
-  padding-left: 10px;
-}
-.memproto {
-  background-color: #D0FFD0;
-  width: 100%;
-  border-bottom-width: 1px;
-  border-bottom-style: dotted;
-  border-bottom-color: #808080;
-  font-weight: bold;
-  /*-moz-border-radius: 8px 8px 8px 8px;*/
-}
-.paramkey {
-  text-align: right;
-}
-.paramtype {
-  white-space: nowrap;
-}
-.paramname {
-  color: #602020;
-  font-style: italic;
-  white-space: nowrap;
-}
-/* End Styling for detailed member documentation */
-
-/* for the tree view */
-.ftvtree {
-       font-family: sans-serif;
-       margin:0.5em;
-}
-.directory { font-size: 9pt; font-weight: bold; }
-.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }
-.directory > h3 { margin-top: 0; }
-.directory p { margin: 0px; white-space: nowrap; }
-.directory div { display: none; margin: 0px; }
-.directory img { vertical-align: -30%; }
diff --git a/doc/third_party/Pluma/html/doxygen.png b/doc/third_party/Pluma/html/doxygen.png
deleted file mode 100644 (file)
index 3ff17d8..0000000
Binary files a/doc/third_party/Pluma/html/doxygen.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/dynsections.js b/doc/third_party/Pluma/html/dynsections.js
deleted file mode 100644 (file)
index 2f15470..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-function toggleVisibility(linkObj)
-{
- var base = $(linkObj).attr('id');
- var summary = $('#'+base+'-summary');
- var content = $('#'+base+'-content');
- var trigger = $('#'+base+'-trigger');
- var src=$(trigger).attr('src');
- if (content.is(':visible')===true) {
-   content.hide();
-   summary.show();
-   $(linkObj).addClass('closed').removeClass('opened');
-   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
- } else {
-   content.show();
-   summary.hide();
-   $(linkObj).removeClass('closed').addClass('opened');
-   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
- } 
- return false;
-}
-
-function updateStripes()
-{
-  $('table.directory tr').
-       removeClass('even').filter(':visible:even').addClass('even');
-}
-function toggleLevel(level)
-{
-  $('table.directory tr').each(function(){ 
-    var l = this.id.split('_').length-1;
-    var i = $('#img'+this.id.substring(3));
-    var a = $('#arr'+this.id.substring(3));
-    if (l<level+1) {
-      i.attr('src','ftv2folderopen.png');
-      a.attr('src','ftv2mnode.png');
-      $(this).show();
-    } else if (l==level+1) {
-      i.attr('src','ftv2folderclosed.png');
-      a.attr('src','ftv2pnode.png');
-      $(this).show();
-    } else {
-      $(this).hide();
-    }
-  });
-  updateStripes();
-}
-
-function toggleFolder(id)
-{
-  //The clicked row
-  var currentRow = $('#row_'+id);
-  var currentRowImages = currentRow.find("img");
-
-  //All rows after the clicked row
-  var rows = currentRow.nextAll("tr");
-
-  //Only match elements AFTER this one (can't hide elements before)
-  var childRows = rows.filter(function() {
-    var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
-    return this.id.match(re);
-  });
-
-  //First row is visible we are HIDING
-  if (childRows.filter(':first').is(':visible')===true) {
-    currentRowImages.filter("[id^=arr]").attr('src', 'ftv2pnode.png');
-    currentRowImages.filter("[id^=img]").attr('src', 'ftv2folderclosed.png');
-    rows.filter("[id^=row_"+id+"]").hide();
-  } else { //We are SHOWING
-    //All sub images
-    var childImages = childRows.find("img");
-    var childImg = childImages.filter("[id^=img]");
-    var childArr = childImages.filter("[id^=arr]");
-
-    currentRow.find("[id^=arr]").attr('src', 'ftv2mnode.png'); //open row
-    currentRow.find("[id^=img]").attr('src', 'ftv2folderopen.png'); //open row
-    childImg.attr('src','ftv2folderclosed.png'); //children closed
-    childArr.attr('src','ftv2pnode.png'); //children closed
-    childRows.show(); //show all children
-  }
-  updateStripes();
-}
-
-
-function toggleInherit(id)
-{
-  var rows = $('tr.inherit.'+id);
-  var img = $('tr.inherit_header.'+id+' img');
-  var src = $(img).attr('src');
-  if (rows.filter(':first').is(':visible')===true) {
-    rows.css('display','none');
-    $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
-  } else {
-    rows.css('display','table-row'); // using show() causes jump in firefox
-    $(img).attr('src',src.substring(0,src.length-10)+'open.png');
-  }
-}
-
-
-$(document).ready(function() {
-  $('.code,.codeRef').each(function() {
-    $(this).data('powertip',$('#'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());
-    $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });
-  });
-});
diff --git a/doc/third_party/Pluma/html/files.htm b/doc/third_party/Pluma/html/files.htm
deleted file mode 100644 (file)
index e614b0b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li class="current"><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li class="current"><a href="files.htm"><span>File&#160;List</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">File List</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
-<table class="directory">
-<tr id="row_0_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Config_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Config.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_1_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Connector_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Connector.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_2_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Dir_8cpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Dir.cpp</b></td><td class="desc"></td></tr>
-<tr id="row_3_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Dir_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Dir.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_4_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="DLibrary_8cpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>DLibrary.cpp</b></td><td class="desc"></td></tr>
-<tr id="row_5_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="DLibrary_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>DLibrary.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_6_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Doxygen_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Doxygen.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_7_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Host_8cpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Host.cpp</b></td><td class="desc"></td></tr>
-<tr id="row_8_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Host_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Host.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_9_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="PluginManager_8cpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>PluginManager.cpp</b></td><td class="desc"></td></tr>
-<tr id="row_10_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="PluginManager_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>PluginManager.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_11_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Pluma_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Pluma.hpp</b></td><td class="desc"></td></tr>
-<tr id="row_12_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Pluma_8inl_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Pluma.inl</b></td><td class="desc"></td></tr>
-<tr id="row_13_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="Provider_8cpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Provider.cpp</b></td><td class="desc"></td></tr>
-<tr id="row_14_" class="even"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a href="Provider_8hpp_source.htm"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>Provider.hpp</b></td><td class="desc"></td></tr>
-</table>
-</div><!-- directory -->
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/ftv2blank.png b/doc/third_party/Pluma/html/ftv2blank.png
deleted file mode 100644 (file)
index 63c605b..0000000
Binary files a/doc/third_party/Pluma/html/ftv2blank.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2cl.png b/doc/third_party/Pluma/html/ftv2cl.png
deleted file mode 100644 (file)
index 132f657..0000000
Binary files a/doc/third_party/Pluma/html/ftv2cl.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2doc.png b/doc/third_party/Pluma/html/ftv2doc.png
deleted file mode 100644 (file)
index 17edabf..0000000
Binary files a/doc/third_party/Pluma/html/ftv2doc.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2folderclosed.png b/doc/third_party/Pluma/html/ftv2folderclosed.png
deleted file mode 100644 (file)
index bb8ab35..0000000
Binary files a/doc/third_party/Pluma/html/ftv2folderclosed.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2folderopen.png b/doc/third_party/Pluma/html/ftv2folderopen.png
deleted file mode 100644 (file)
index d6c7f67..0000000
Binary files a/doc/third_party/Pluma/html/ftv2folderopen.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2lastnode.png b/doc/third_party/Pluma/html/ftv2lastnode.png
deleted file mode 100644 (file)
index 63c605b..0000000
Binary files a/doc/third_party/Pluma/html/ftv2lastnode.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2link.png b/doc/third_party/Pluma/html/ftv2link.png
deleted file mode 100644 (file)
index 17edabf..0000000
Binary files a/doc/third_party/Pluma/html/ftv2link.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2mlastnode.png b/doc/third_party/Pluma/html/ftv2mlastnode.png
deleted file mode 100644 (file)
index 0b63f6d..0000000
Binary files a/doc/third_party/Pluma/html/ftv2mlastnode.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2mnode.png b/doc/third_party/Pluma/html/ftv2mnode.png
deleted file mode 100644 (file)
index 0b63f6d..0000000
Binary files a/doc/third_party/Pluma/html/ftv2mnode.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2mo.png b/doc/third_party/Pluma/html/ftv2mo.png
deleted file mode 100644 (file)
index 4bfb80f..0000000
Binary files a/doc/third_party/Pluma/html/ftv2mo.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2node.png b/doc/third_party/Pluma/html/ftv2node.png
deleted file mode 100644 (file)
index 63c605b..0000000
Binary files a/doc/third_party/Pluma/html/ftv2node.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2ns.png b/doc/third_party/Pluma/html/ftv2ns.png
deleted file mode 100644 (file)
index 72e3d71..0000000
Binary files a/doc/third_party/Pluma/html/ftv2ns.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2plastnode.png b/doc/third_party/Pluma/html/ftv2plastnode.png
deleted file mode 100644 (file)
index c6ee22f..0000000
Binary files a/doc/third_party/Pluma/html/ftv2plastnode.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2pnode.png b/doc/third_party/Pluma/html/ftv2pnode.png
deleted file mode 100644 (file)
index c6ee22f..0000000
Binary files a/doc/third_party/Pluma/html/ftv2pnode.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2splitbar.png b/doc/third_party/Pluma/html/ftv2splitbar.png
deleted file mode 100644 (file)
index fe895f2..0000000
Binary files a/doc/third_party/Pluma/html/ftv2splitbar.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/ftv2vertline.png b/doc/third_party/Pluma/html/ftv2vertline.png
deleted file mode 100644 (file)
index 63c605b..0000000
Binary files a/doc/third_party/Pluma/html/ftv2vertline.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/functions.htm b/doc/third_party/Pluma/html/functions.htm
deleted file mode 100644 (file)
index cdc44a7..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li class="current"><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow3" class="tabs2">
-    <ul class="tablist">
-      <li class="current"><a href="functions.htm"><span>All</span></a></li>
-      <li><a href="functions_func.htm"><span>Functions</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="contents">
-<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div><ul>
-<li>acceptProviderType()
-: <a class="el" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">pluma::Pluma</a>
-</li>
-<li>add()
-: <a class="el" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">pluma::Host</a>
-</li>
-<li>addProvider()
-: <a class="el" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">pluma::PluginManager</a>
-</li>
-<li>getLoadedPlugins()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">pluma::PluginManager</a>
-</li>
-<li>getProviders()
-: <a class="el" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">pluma::PluginManager</a>
-, <a class="el" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">pluma::Pluma</a>
-</li>
-<li>getSymbol()
-: <a class="el" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">pluma::DLibrary</a>
-</li>
-<li>getVersion()
-: <a class="el" href="classpluma_1_1Provider.htm#af8643b65e111e010edff6e7a489265e6">pluma::Provider</a>
-</li>
-<li>isCompatible()
-: <a class="el" href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">pluma::Provider</a>
-</li>
-<li>isLoaded()
-: <a class="el" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">pluma::PluginManager</a>
-</li>
-<li>load()
-: <a class="el" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">pluma::DLibrary</a>
-, <a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">pluma::PluginManager</a>
-</li>
-<li>loadFromFolder()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">pluma::PluginManager</a>
-</li>
-<li>PluginManager()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">pluma::PluginManager</a>
-</li>
-<li>Pluma()
-: <a class="el" href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">pluma::Pluma</a>
-</li>
-<li>registerType()
-: <a class="el" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">pluma::PluginManager</a>
-</li>
-<li>unload()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">pluma::PluginManager</a>
-</li>
-<li>unloadAll()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">pluma::PluginManager</a>
-</li>
-<li>~DLibrary()
-: <a class="el" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">pluma::DLibrary</a>
-</li>
-<li>~PluginManager()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">pluma::PluginManager</a>
-</li>
-<li>~Provider()
-: <a class="el" href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">pluma::Provider</a>
-</li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/functions_func.htm b/doc/third_party/Pluma/html/functions_func.htm
deleted file mode 100644 (file)
index 64622da..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li class="current"><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow3" class="tabs2">
-    <ul class="tablist">
-      <li><a href="functions.htm"><span>All</span></a></li>
-      <li class="current"><a href="functions_func.htm"><span>Functions</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="contents">
-&#160;<ul>
-<li>acceptProviderType()
-: <a class="el" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">pluma::Pluma</a>
-</li>
-<li>add()
-: <a class="el" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">pluma::Host</a>
-</li>
-<li>addProvider()
-: <a class="el" href="classpluma_1_1PluginManager.htm#af27f8e89b8e29359495b6398464ebf02">pluma::PluginManager</a>
-</li>
-<li>getLoadedPlugins()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a187e60d3fe7524774c08eb58ebcb843f">pluma::PluginManager</a>
-</li>
-<li>getProviders()
-: <a class="el" href="classpluma_1_1PluginManager.htm#ad5eab1dcae10122fdfb8d94d7b391e9e">pluma::PluginManager</a>
-, <a class="el" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">pluma::Pluma</a>
-</li>
-<li>getSymbol()
-: <a class="el" href="classpluma_1_1DLibrary.htm#a57dd3726140cce08957e40cb5b001d84">pluma::DLibrary</a>
-</li>
-<li>getVersion()
-: <a class="el" href="classpluma_1_1Provider.htm#af8643b65e111e010edff6e7a489265e6">pluma::Provider</a>
-</li>
-<li>isCompatible()
-: <a class="el" href="classpluma_1_1Provider.htm#a192ea5a17a8fe9de1f3ba6572f44f266">pluma::Provider</a>
-</li>
-<li>isLoaded()
-: <a class="el" href="classpluma_1_1PluginManager.htm#adbd75738cd4d8969608c9da8b58a03c3">pluma::PluginManager</a>
-</li>
-<li>load()
-: <a class="el" href="classpluma_1_1DLibrary.htm#a32400d8e50c0f03cb525ca7500b4516e">pluma::DLibrary</a>
-, <a class="el" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">pluma::PluginManager</a>
-</li>
-<li>loadFromFolder()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a4d892e345288c26dea091d62ee2b03eb">pluma::PluginManager</a>
-</li>
-<li>PluginManager()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a8378a698812f8f079ff8aea7c1474d67">pluma::PluginManager</a>
-</li>
-<li>Pluma()
-: <a class="el" href="classpluma_1_1Pluma.htm#adf4e065f5169931f6290f3828b49e7bb">pluma::Pluma</a>
-</li>
-<li>registerType()
-: <a class="el" href="classpluma_1_1PluginManager.htm#ab70b5b6b719bdbd64c27ae2dcb12a64d">pluma::PluginManager</a>
-</li>
-<li>unload()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a52f6408d4cf95c6f36b518ab2d3a7745">pluma::PluginManager</a>
-</li>
-<li>unloadAll()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a697a20dc97957e0c2a5dad33f39d93db">pluma::PluginManager</a>
-</li>
-<li>~DLibrary()
-: <a class="el" href="classpluma_1_1DLibrary.htm#a3fa679bc824b36ce61b67716bedd15c7">pluma::DLibrary</a>
-</li>
-<li>~PluginManager()
-: <a class="el" href="classpluma_1_1PluginManager.htm#a4d7a0e1151b75300350834a59db5748b">pluma::PluginManager</a>
-</li>
-<li>~Provider()
-: <a class="el" href="classpluma_1_1Provider.htm#a111a1db902d6372282f8407c9d845c21">pluma::Provider</a>
-</li>
-</ul>
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/hierarchy.htm b/doc/third_party/Pluma/html/hierarchy.htm
deleted file mode 100644 (file)
index 297a965..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-  <div id="navrow2" class="tabs2">
-    <ul class="tablist">
-      <li><a href="annotated.htm"><span>Class&#160;List</span></a></li>
-      <li><a href="classes.htm"><span>Class&#160;Index</span></a></li>
-      <li class="current"><a href="hierarchy.htm"><span>Class&#160;Hierarchy</span></a></li>
-      <li><a href="functions.htm"><span>Class&#160;Members</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Class Hierarchy</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock">This inheritance list is sorted roughly, but not completely, alphabetically:</div><div class="directory">
-<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
-<tr id="row_0_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1DLibrary.htm" target="_self">pluma::DLibrary</a></td><td class="desc">Manages a Dynamic Linking Library </td></tr>
-<tr id="row_1_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1Host.htm" target="_self">pluma::Host</a></td><td class="desc">Manages providers </td></tr>
-<tr id="row_2_" class="even"><td class="entry"><img id="arr_2_" src="ftv2mnode.png" alt="o" width="16" height="22" onclick="toggleFolder('2_')"/><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1PluginManager.htm" target="_self">pluma::PluginManager</a></td><td class="desc">Manages loaded plugins </td></tr>
-<tr id="row_2_0_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1Pluma.htm" target="_self">pluma::Pluma</a></td><td class="desc"><a class="el" href="classpluma_1_1Pluma.htm" title="Pluma plugins management. ">Pluma</a> plugins management </td></tr>
-<tr id="row_3_" class="even"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="classpluma_1_1Provider.htm" target="_self">pluma::Provider</a></td><td class="desc">Interface to provide applications with objects from plugins </td></tr>
-</table>
-</div><!-- directory -->
-</div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/index.htm b/doc/third_party/Pluma/html/index.htm
deleted file mode 100644 (file)
index df4076e..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-    <head>
-        <title>Pluma - Plug-in Management Framework</title>
-        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-        <link href="doxygen.css" rel="stylesheet" type="text/css" />
-        <link href="tabs.css" rel="stylesheet" type="text/css" />
-    </head>
-    <body>
-        <div id="logo">
-            <img src="./logo.png" title="Pluma home" alt="Pluma logo" />
-        </div>
-<!-- Generated by Doxygen 1.8.6 -->
-  <div id="navrow1" class="tabs">
-    <ul class="tablist">
-      <li class="current"><a href="index.htm"><span>Main&#160;Page</span></a></li>
-      <li><a href="annotated.htm"><span>Classes</span></a></li>
-      <li><a href="files.htm"><span>Files</span></a></li>
-    </ul>
-  </div>
-</div><!-- top -->
-<div class="header">
-  <div class="headertitle">
-<div class="title">Pluma Documentation</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><h1><a class="anchor" id="welcome"></a>
-Welcome</h1>
-<p>Welcome to Pluma documentation. Here you will find a detailed view of all Pluma <a href="./annotated.htm">classes</a>.<br/>
- If you are looking for support, you can visit the official website at <a href="http://pluma-framework.sourceforge.net/">http://pluma-framework.sourceforge.net/</a>.<br/>
-<br/>
-</p>
-<p>CSS based on <a href="http://www.sfml-dev.org/documentation/1.6/">SFML1.6 documentation</a><br/>
-</p>
-<h1><a class="anchor" id="example"></a>
-Short Example</h1>
-<p>A short example to demonstrate Pluma usage:<br/>
- A host application define a Device interface. A certain plugin defines a Keyboard, witch is a Device. The host will use DeviceProviders to create objects of type Device. The plugin will provide host specifically with a KeyboardProvider.<br/>
-</p>
-<p>Device hpp (shared): </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"><span class="keyword">class </span>Device{</div>
-<div class="line"><span class="keyword">public</span>:</div>
-<div class="line">    <span class="keyword">virtual</span> std::string getDescription() <span class="keyword">const</span> = 0;</div>
-<div class="line">};</div>
-<div class="line"><span class="comment">// create DevicedProvider class</span></div>
-<div class="line">PLUMA_PROVIDER_HEADER(Device);</div>
-</div><!-- fragment --><p>Device cpp (shared): </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;Device.hpp&quot;</span></div>
-<div class="line">generate DevicedProvider with version 6, and compatible with at least v.3</div>
-<div class="line">PLUMA_PROVIDER_SOURCE(Device, 6, 3);</div>
-</div><!-- fragment --><p><br/>
- Keyboard code on the plugin side: </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"><span class="preprocessor">#include &quot;Device.hpp&quot;</span></div>
-<div class="line"></div>
-<div class="line"><span class="keyword">class </span>Keyboard: <span class="keyword">public</span> Device{</div>
-<div class="line"><span class="keyword">public</span>:</div>
-<div class="line">    std::string getDescription()<span class="keyword"> const</span>{</div>
-<div class="line">        <span class="keywordflow">return</span> <span class="stringliteral">&quot;keyboard&quot;</span>;</div>
-<div class="line">    }</div>
-<div class="line">};</div>
-<div class="line"></div>
-<div class="line"><span class="comment">// create KeyboardProvider, it implements DeviceProvider</span></div>
-<div class="line">PLUMA_INHERIT_PROVIDER(Keyboard, Device);</div>
-</div><!-- fragment --><p>plugin connector: </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Connector.hpp&gt;</span></div>
-<div class="line"><span class="preprocessor">#include &quot;Keyboard.hpp&quot;</span></div>
-<div class="line"></div>
-<div class="line">PLUMA_CONNECTOR</div>
-<div class="line"><span class="keywordtype">bool</span> connect(<a class="code" href="classpluma_1_1Host.htm">pluma::Host</a>&amp; host){</div>
-<div class="line">    <span class="comment">// add a keyboard provider to host</span></div>
-<div class="line">    host.<a class="code" href="classpluma_1_1Host.htm#ab673ba94ff56a12cdf2a7a25ebb8cc36">add</a>( <span class="keyword">new</span> KeyboardProvider() );</div>
-<div class="line">    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
-<div class="line">}</div>
-</div><!-- fragment --><p>Host application code: </p>
-<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Pluma/Pluma.hpp&gt;</span></div>
-<div class="line"></div>
-<div class="line"><span class="preprocessor">#include &quot;Device.hpp&quot;</span></div>
-<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
-<div class="line"><span class="preprocessor">#include &lt;vector&gt;</span></div>
-<div class="line"></div>
-<div class="line"><span class="keywordtype">int</span> main(){</div>
-<div class="line"></div>
-<div class="line">    <a class="code" href="classpluma_1_1Pluma.htm">pluma::Pluma</a> plugins;</div>
-<div class="line">    <span class="comment">// Tell plugins manager to accept providers of the type DeviceProvider</span></div>
-<div class="line">    plugins.<a class="code" href="classpluma_1_1Pluma.htm#a200c59b0983c7ca53d11b03cf8220bc7">acceptProviderType</a>&lt;DeviceProvider&gt;();</div>
-<div class="line">    <span class="comment">// Load library &quot;standard_devices&quot; from folder &quot;plugins&quot;</span></div>
-<div class="line">    plugins.<a class="code" href="classpluma_1_1PluginManager.htm#aa00400d23efa8a8f94e44dd1c5bf54e6">load</a>(<span class="stringliteral">&quot;plugins&quot;</span>, <span class="stringliteral">&quot;standard_devices&quot;</span>);</div>
-<div class="line"></div>
-<div class="line">    <span class="comment">// Get device providers into a vector</span></div>
-<div class="line">    std::vector&lt;DeviceProvider*&gt; providers;</div>
-<div class="line">    plugins.<a class="code" href="classpluma_1_1Pluma.htm#a49fa0b2b4497885c4e978259be0a7abe">getProviders</a>(providers);</div>
-<div class="line"></div>
-<div class="line">    <span class="comment">// create a Device from the first provider</span></div>
-<div class="line">    <span class="keywordflow">if</span> (!providers.empty()){</div>
-<div class="line">        Device* myDevice = providers.first()-&gt;create();</div>
-<div class="line">        <span class="comment">// do something with myDevice</span></div>
-<div class="line">        std::cout &lt;&lt; device-&gt;getDescription() &lt;&lt; std::endl;</div>
-<div class="line">        <span class="comment">// and delete it in the end</span></div>
-<div class="line">        <span class="keyword">delete</span> myDevice;</div>
-<div class="line">    }</div>
-<div class="line">    <span class="keywordflow">return</span> 0;</div>
-<div class="line">}</div>
-</div><!-- fragment --> </div></div><!-- contents -->
-
-        <p id="footer">
-            &nbsp;::&nbsp; Copyright &copy; 2011 Gil Costa, all rights reserved &nbsp;::&nbsp;
-            Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.7.4</a> &nbsp;::&nbsp;
-        </p>
-    </body>
-</html>
diff --git a/doc/third_party/Pluma/html/logo.png b/doc/third_party/Pluma/html/logo.png
deleted file mode 100644 (file)
index f3d74cd..0000000
Binary files a/doc/third_party/Pluma/html/logo.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/nav_f.png b/doc/third_party/Pluma/html/nav_f.png
deleted file mode 100644 (file)
index 72a58a5..0000000
Binary files a/doc/third_party/Pluma/html/nav_f.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/nav_g.png b/doc/third_party/Pluma/html/nav_g.png
deleted file mode 100644 (file)
index 2093a23..0000000
Binary files a/doc/third_party/Pluma/html/nav_g.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/nav_h.png b/doc/third_party/Pluma/html/nav_h.png
deleted file mode 100644 (file)
index 33389b1..0000000
Binary files a/doc/third_party/Pluma/html/nav_h.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/open.png b/doc/third_party/Pluma/html/open.png
deleted file mode 100644 (file)
index 30f75c7..0000000
Binary files a/doc/third_party/Pluma/html/open.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/sync_off.png b/doc/third_party/Pluma/html/sync_off.png
deleted file mode 100644 (file)
index 3b443fc..0000000
Binary files a/doc/third_party/Pluma/html/sync_off.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/sync_on.png b/doc/third_party/Pluma/html/sync_on.png
deleted file mode 100644 (file)
index e08320f..0000000
Binary files a/doc/third_party/Pluma/html/sync_on.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/tab_a.png b/doc/third_party/Pluma/html/tab_a.png
deleted file mode 100644 (file)
index 3b725c4..0000000
Binary files a/doc/third_party/Pluma/html/tab_a.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/tab_b.png b/doc/third_party/Pluma/html/tab_b.png
deleted file mode 100644 (file)
index e2b4a86..0000000
Binary files a/doc/third_party/Pluma/html/tab_b.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/tab_h.png b/doc/third_party/Pluma/html/tab_h.png
deleted file mode 100644 (file)
index fd5cb70..0000000
Binary files a/doc/third_party/Pluma/html/tab_h.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/tab_s.png b/doc/third_party/Pluma/html/tab_s.png
deleted file mode 100644 (file)
index ab478c9..0000000
Binary files a/doc/third_party/Pluma/html/tab_s.png and /dev/null differ
diff --git a/doc/third_party/Pluma/html/tabs.css b/doc/third_party/Pluma/html/tabs.css
deleted file mode 100644 (file)
index 9cf578f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-.tabs, .tabs2, .tabs3 {
-    background-image: url('tab_b.png');
-    width: 100%;
-    z-index: 101;
-    font-size: 13px;
-    font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
-}
-
-.tabs2 {
-    font-size: 10px;
-}
-.tabs3 {
-    font-size: 9px;
-}
-
-.tablist {
-    margin: 0;
-    padding: 0;
-    display: table;
-}
-
-.tablist li {
-    float: left;
-    display: table-cell;
-    background-image: url('tab_b.png');
-    line-height: 36px;
-    list-style: none;
-}
-
-.tablist a {
-    display: block;
-    padding: 0 20px;
-    font-weight: bold;
-    background-image:url('tab_s.png');
-    background-repeat:no-repeat;
-    background-position:right;
-    color: #283A5D;
-    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
-    text-decoration: none;
-    outline: none;
-}
-
-.tabs3 .tablist a {
-    padding: 0 10px;
-}
-
-.tablist a:hover {
-    background-image: url('tab_h.png');
-    background-repeat:repeat-x;
-    color: #fff;
-    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
-    text-decoration: none;
-}
-
-.tablist li.current a {
-    background-image: url('tab_a.png');
-    background-repeat:repeat-x;
-    color: #fff;
-    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
-}
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c1d958e
--- /dev/null
@@ -0,0 +1,14 @@
+SUBDIRS(
+  ItkVtkGlue
+  third_party
+  cpExtensions
+  cpPlugins_ITKInstances
+  cpPlugins
+  )
+IF(USE_QT4)
+  SUBDIRS(
+    cpPipelineEditor
+    )
+ENDIF(USE_QT4)
+
+## eof - $RCSfile$
diff --git a/lib/ItkVtkGlue/CMakeLists.txt b/lib/ItkVtkGlue/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4b26944
--- /dev/null
@@ -0,0 +1 @@
+## eof - $RCSfile$
diff --git a/lib/ItkVtkGlue/itkImageToVTKImageFilter.h b/lib/ItkVtkGlue/itkImageToVTKImageFilter.h
new file mode 100644 (file)
index 0000000..9390eb8
--- /dev/null
@@ -0,0 +1,111 @@
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+#ifndef itkImageToVTKImageFilter_h
+#define itkImageToVTKImageFilter_h
+
+#include "itkVTKImageExport.h"
+#include "vtkImageImport.h"
+#include "vtkImageData.h"
+
+namespace itk
+{
+
+/** \class ImageToVTKImageFilter
+ * \brief Converts an ITK image into a VTK image and plugs a
+ *  itk data pipeline to a VTK datapipeline.
+ *
+ *  This class puts together an itkVTKImageExporter and a vtkImageImporter.
+ *  It takes care of the details related to the connection of ITK and VTK
+ *  pipelines. The User will perceive this filter as an adaptor to which
+ *  an itk::Image can be plugged as input and a vtkImage is produced as
+ *  output.
+ *
+ * \ingroup   ITKVtkGlue
+ *
+ * \wiki
+ * \wikiexample{IO/ImageToVTKImageFilter,Display an ITK image}
+ * \wikiexample{IO/itkVtkImageConvertDICOM,Uses a custom user matrix to align the image with DICOM physical space}
+ * \endwiki
+ */
+template <typename TInputImage >
+class ImageToVTKImageFilter : public ProcessObject
+{
+public:
+  /** Standard class typedefs. */
+  typedef ImageToVTKImageFilter     Self;
+  typedef ProcessObject             Superclass;
+  typedef SmartPointer<Self>        Pointer;
+  typedef SmartPointer<const Self>  ConstPointer;
+
+  /** Method for creation through the object factory. */
+  itkNewMacro(Self);
+
+  /** Run-time type information (and related methods). */
+  itkTypeMacro(ImageToVTKImageFilter, ProcessObject);
+
+  /** Some typedefs. */
+  typedef TInputImage                            InputImageType;
+  typedef typename InputImageType::ConstPointer  InputImagePointer;
+
+  typedef VTKImageExport< InputImageType>        ExporterFilterType;
+  typedef typename ExporterFilterType::Pointer   ExporterFilterPointer;
+
+  /** Get the output in the form of a vtkImage.
+      This call is delegated to the internal vtkImageImporter filter  */
+  vtkImageData *  GetOutput() const;
+
+  /** Set the input in the form of an itk::Image */
+  using Superclass::SetInput;
+  void SetInput( const InputImageType * );
+  InputImageType * GetInput();
+
+  /** Return the internal VTK image importer filter.
+      This is intended to facilitate users the access
+      to methods in the importer */
+  vtkImageImport * GetImporter() const;
+
+  /** Return the internal ITK image exporter filter.
+      This is intended to facilitate users the access
+      to methods in the exporter */
+  ExporterFilterType * GetExporter() const;
+
+  /** This call delegates the update to the importer */
+  virtual void Update() ITK_OVERRIDE;
+
+  /** This call delegates the update to the importer */
+  virtual void UpdateLargestPossibleRegion() ITK_OVERRIDE;
+
+protected:
+  ImageToVTKImageFilter();
+  virtual ~ImageToVTKImageFilter();
+
+private:
+  ImageToVTKImageFilter(const Self&) ITK_DELETE_FUNCTION;
+  void operator=(const Self&) ITK_DELETE_FUNCTION;
+
+  ExporterFilterPointer       m_Exporter;
+  vtkImageImport *            m_Importer;
+};
+
+} // end namespace itk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "itkImageToVTKImageFilter.hxx"
+#endif
+
+#endif
diff --git a/lib/ItkVtkGlue/itkImageToVTKImageFilter.hxx b/lib/ItkVtkGlue/itkImageToVTKImageFilter.hxx
new file mode 100644 (file)
index 0000000..e134b3f
--- /dev/null
@@ -0,0 +1,141 @@
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+#ifndef itkImageToVTKImageFilter_hxx
+#define itkImageToVTKImageFilter_hxx
+
+#include "itkImageToVTKImageFilter.h"
+
+namespace itk
+{
+
+/**
+ * Constructor
+ */
+template <typename TInputImage>
+ImageToVTKImageFilter<TInputImage>
+::ImageToVTKImageFilter()
+{
+  m_Importer = vtkImageImport::New();
+  m_Exporter = ExporterFilterType::New();
+
+  m_Importer->SetUpdateInformationCallback(m_Exporter->GetUpdateInformationCallback());
+  m_Importer->SetPipelineModifiedCallback(m_Exporter->GetPipelineModifiedCallback());
+  m_Importer->SetWholeExtentCallback(m_Exporter->GetWholeExtentCallback());
+  m_Importer->SetSpacingCallback(m_Exporter->GetSpacingCallback());
+  m_Importer->SetOriginCallback(m_Exporter->GetOriginCallback());
+  m_Importer->SetScalarTypeCallback(m_Exporter->GetScalarTypeCallback());
+  m_Importer->SetNumberOfComponentsCallback(m_Exporter->GetNumberOfComponentsCallback());
+  m_Importer->SetPropagateUpdateExtentCallback(m_Exporter->GetPropagateUpdateExtentCallback());
+  m_Importer->SetUpdateDataCallback(m_Exporter->GetUpdateDataCallback());
+  m_Importer->SetDataExtentCallback(m_Exporter->GetDataExtentCallback());
+  m_Importer->SetBufferPointerCallback(m_Exporter->GetBufferPointerCallback());
+  m_Importer->SetCallbackUserData(m_Exporter->GetCallbackUserData());
+
+}
+
+/**
+ * Destructor
+ */
+template <typename TInputImage>
+ImageToVTKImageFilter<TInputImage>
+::~ImageToVTKImageFilter()
+{
+  if( m_Importer )
+    {
+    m_Importer->Delete();
+    m_Importer = 0;
+    }
+}
+
+/**
+ * Set an itk::Image as input
+ */
+template <typename TInputImage>
+void
+ImageToVTKImageFilter<TInputImage>
+::SetInput( const InputImageType * inputImage )
+{
+  m_Exporter->SetInput( inputImage );
+}
+
+template <typename TInputImage>
+typename ImageToVTKImageFilter<TInputImage>::InputImageType *
+ImageToVTKImageFilter<TInputImage>
+::GetInput()
+{
+  return m_Exporter->GetInput();
+}
+
+/**
+ * Get a vtkImage as output
+ */
+template <typename TInputImage>
+vtkImageData *
+ImageToVTKImageFilter<TInputImage>
+::GetOutput() const
+{
+  return m_Importer->GetOutput();
+}
+
+/**
+ * Get the importer filter
+ */
+template <typename TInputImage>
+vtkImageImport *
+ImageToVTKImageFilter<TInputImage>
+::GetImporter() const
+{
+  return m_Importer;
+}
+
+/**
+ * Get the exporter filter
+ */
+template <typename TInputImage>
+typename ImageToVTKImageFilter<TInputImage>::ExporterFilterType *
+ImageToVTKImageFilter<TInputImage>
+::GetExporter() const
+{
+  return m_Exporter.GetPointer();
+}
+
+/**
+ * Delegate the Update to the importer
+ */
+template <typename TInputImage>
+void
+ImageToVTKImageFilter<TInputImage>
+::Update()
+{
+  m_Importer->Update();
+}
+
+/**
+ * Delegate the UpdateLargestPossibleRegion to the importer
+ */
+template <typename TInputImage>
+void
+ImageToVTKImageFilter<TInputImage>
+::UpdateLargestPossibleRegion()
+{
+  m_Importer->UpdateWholeExtent();
+}
+
+} // end namespace itk
+
+#endif
diff --git a/lib/ItkVtkGlue/itkVTKImageToImageFilter.h b/lib/ItkVtkGlue/itkVTKImageToImageFilter.h
new file mode 100644 (file)
index 0000000..b4427c8
--- /dev/null
@@ -0,0 +1,100 @@
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
+#ifndef itkVTKImageToImageFilter_h
+#define itkVTKImageToImageFilter_h
+
+#include "itkVTKImageImport.h"
+#include "vtkImageExport.h"
+#include "vtkImageData.h"
+#include "vtkSmartPointer.h"
+
+#ifndef vtkFloatingPointType
+#define vtkFloatingPointType float
+#endif
+
+namespace itk
+{
+
+/** \class VTKImageToImageFilter
+ * \brief Converts a VTK image into an ITK image and plugs a
+ *  VTK data pipeline to an ITK datapipeline.
+ *
+ *  This class puts together an itk::VTKImageImport and a vtk::ImageExport.
+ *  It takes care of the details related to the connection of ITK and VTK
+ *  pipelines. The User will perceive this filter as an adaptor to which
+ *  a vtkImageData can be plugged as input and an itk::Image is produced as
+ *  output.
+ *
+ * \ingroup ITKVtkGlue
+ */
+template <typename TOutputImage >
+class VTKImageToImageFilter : public VTKImageImport< TOutputImage >
+{
+public:
+  /** Standard class typedefs. */
+  typedef VTKImageToImageFilter             Self;
+  typedef VTKImageImport< TOutputImage >    Superclass;
+  typedef SmartPointer<Self>                Pointer;
+  typedef SmartPointer<const Self>          ConstPointer;
+
+  /** Method for creation through the object factory. */
+  itkNewMacro(Self);
+
+  /** Run-time type information (and related methods). */
+  itkTypeMacro(VTKImageToImageFilter, VTKImageImport);
+
+  /** Some typedefs. */
+  typedef TOutputImage                              OutputImageType;
+  typedef typename    OutputImageType::ConstPointer OutputImagePointer;
+
+  /** Set the input in the form of a vtkImageData */
+  void SetInput( vtkImageData * );
+  using Superclass::SetInput;
+
+  /** Return the internal VTK image exporter filter.
+      This is intended to facilitate users the access
+      to methods in the exporter */
+  vtkImageExport * GetExporter() const;
+
+  /** Return the internal ITK image importer filter.
+      This is intended to facilitate users the access
+      to methods in the importer.
+      */
+  const Superclass * GetImporter() const;
+
+protected:
+  VTKImageToImageFilter();
+  virtual ~VTKImageToImageFilter();
+
+private:
+  VTKImageToImageFilter(const Self&) ITK_DELETE_FUNCTION;
+  void operator=(const Self&) ITK_DELETE_FUNCTION;
+
+  typedef vtkSmartPointer<vtkImageExport> ImageExportPointer;
+  ImageExportPointer m_Exporter;
+
+};
+
+} // end namespace itk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "itkVTKImageToImageFilter.hxx"
+#endif
+
+#endif
diff --git a/lib/ItkVtkGlue/itkVTKImageToImageFilter.hxx b/lib/ItkVtkGlue/itkVTKImageToImageFilter.hxx
new file mode 100644 (file)
index 0000000..334b02b
--- /dev/null
@@ -0,0 +1,107 @@
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
+#ifndef itkVTKImageToImageFilter_hxx
+#define itkVTKImageToImageFilter_hxx
+
+#include "itkVTKImageToImageFilter.h"
+
+#include "vtkVersion.h"
+
+namespace itk
+{
+
+/**
+ * Constructor
+ */
+template <typename TOutputImage>
+VTKImageToImageFilter<TOutputImage>
+::VTKImageToImageFilter()
+{
+
+  m_Exporter = vtkImageExport::New();
+
+  this->SetUpdateInformationCallback( m_Exporter->GetUpdateInformationCallback());
+  this->SetPipelineModifiedCallback( m_Exporter->GetPipelineModifiedCallback());
+  this->SetWholeExtentCallback( m_Exporter->GetWholeExtentCallback());
+  this->SetSpacingCallback( m_Exporter->GetSpacingCallback());
+  this->SetOriginCallback( m_Exporter->GetOriginCallback());
+  this->SetScalarTypeCallback( m_Exporter->GetScalarTypeCallback());
+  this->SetNumberOfComponentsCallback( m_Exporter->GetNumberOfComponentsCallback());
+  this->SetPropagateUpdateExtentCallback( m_Exporter->GetPropagateUpdateExtentCallback());
+  this->SetUpdateDataCallback( m_Exporter->GetUpdateDataCallback());
+  this->SetDataExtentCallback( m_Exporter->GetDataExtentCallback());
+  this->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());
+  this->SetCallbackUserData( m_Exporter->GetCallbackUserData());
+
+}
+
+/**
+ * Destructor
+ */
+template <typename TOutputImage>
+VTKImageToImageFilter<TOutputImage>
+::~VTKImageToImageFilter()
+{
+  if( m_Exporter )
+    {
+    m_Exporter->Delete();
+    m_Exporter = 0;
+    }
+}
+
+/**
+ * Set a vtkImageData as input
+ */
+template <typename TOutputImage>
+void
+VTKImageToImageFilter<TOutputImage>
+::SetInput( vtkImageData * inputImage )
+{
+#if VTK_MAJOR_VERSION <= 5
+  m_Exporter->SetInput( inputImage );
+#else
+  m_Exporter->SetInputData( inputImage );
+#endif
+}
+
+/**
+ * Get the exporter filter
+ */
+template <typename TOutputImage>
+vtkImageExport *
+VTKImageToImageFilter<TOutputImage>
+::GetExporter() const
+{
+  return m_Exporter;
+}
+
+/**
+ * Get the importer filter
+ */
+template <typename TOutputImage>
+const typename VTKImageToImageFilter<TOutputImage>::Superclass *
+VTKImageToImageFilter<TOutputImage>
+::GetImporter() const
+{
+  return this;
+}
+
+} // end namespace itk
+
+#endif
diff --git a/lib/cpExtensions/Algorithms/BezierCurveFunction.h b/lib/cpExtensions/Algorithms/BezierCurveFunction.h
new file mode 100644 (file)
index 0000000..2deba45
--- /dev/null
@@ -0,0 +1,76 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
+#define __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
+
+#include <vector>
+#include <itkFunctionBase.h>
+#include <itkMatrix.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     * Uses the De Casteljau's algorithm.
+     */
+    template< class V >
+    class BezierCurveFunction
+      : public itk::FunctionBase< typename V::ValueType, V >
+    {
+    public:
+      typedef BezierCurveFunction                           Self;
+      typedef itk::FunctionBase< typename V::ValueType, V > Superclass;
+      typedef itk::SmartPointer< Self >                     Pointer;
+      typedef itk::SmartPointer< const Self >               ConstPointer;
+
+      typedef V                     TVector;
+      typedef typename V::ValueType TScalar;
+
+      typedef
+      itk::Matrix< TScalar, TVector::Dimension, TVector::Dimension >
+      TFrame;
+      typedef std::vector< TVector > TVectorsContainer;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( BezierCurveFunction, itkFunctionBase );
+
+    public:
+      virtual void AddPoint( const TVector& v );
+      virtual unsigned int GetNumberOfPoints( ) const;
+
+      virtual TVector Evaluate( const TScalar& u ) const;
+      virtual TFrame EvaluateFrenetFrame( const TScalar& u ) const;
+      virtual TScalar EvaluateLength( ) const;
+
+    protected:
+      BezierCurveFunction( );
+      virtual ~BezierCurveFunction( ) { }
+
+      void _UpdateDerivative( ) const;
+
+    private:
+      // Purposely not implemented
+      BezierCurveFunction( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      TVectorsContainer m_Vectors;
+      mutable Pointer   m_Derivative;
+      mutable bool      m_DerivativeUpdated;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/BezierCurveFunction.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/BezierCurveFunction.hxx b/lib/cpExtensions/Algorithms/BezierCurveFunction.hxx
new file mode 100644 (file)
index 0000000..684360f
--- /dev/null
@@ -0,0 +1,155 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__HXX__
+
+// -------------------------------------------------------------------------
+template< class V >
+void cpExtensions::Algorithms::BezierCurveFunction< V >::
+AddPoint( const TVector& v )
+{
+  this->m_Vectors.push_back( v );
+  this->m_DerivativeUpdated = false;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class V >
+unsigned int cpExtensions::Algorithms::BezierCurveFunction< V >::
+GetNumberOfPoints( ) const
+{
+  return( this->m_Vectors.size( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class V >
+typename cpExtensions::Algorithms::BezierCurveFunction< V >::
+TVector cpExtensions::Algorithms::BezierCurveFunction< V >::
+Evaluate( const TScalar& u ) const
+{
+  TVectorsContainer Q = this->m_Vectors;
+  unsigned int n = Q.size( );
+  TScalar _1u = TScalar( 1 ) - u;
+
+  for( unsigned int k = 1; k < n; k++ )
+  {
+    // CM Fixed a bug appearing under Windows : changed the stopping
+    // condition from <= to <. Otherwise, on the last step, an element out
+    // of the range of vector Q is accessed (Q[ i + 1 ])...
+    for( unsigned int i = 0; i < n - k; i++ )
+      Q[ i ] = ( Q[ i ] * _1u ) + ( Q[ i + 1 ] * u );
+
+  } // rof
+  return( Q[ 0 ] );
+}
+
+// -------------------------------------------------------------------------
+template< class V >
+typename cpExtensions::Algorithms::BezierCurveFunction< V >::
+TFrame cpExtensions::Algorithms::BezierCurveFunction< V >::
+EvaluateFrenetFrame( const TScalar& u ) const
+{
+  TFrame fr;
+  fr.Fill( TScalar( 0 ) );
+  if( TVector::Dimension == 2 )
+  {
+    this->_UpdateDerivative( );
+    this->m_Derivative->_UpdateDerivative( );
+
+    TVector vT = this->m_Derivative->Evaluate( u );
+    TScalar nvT = vT.GetNorm( );
+    if( TScalar( 0 ) < nvT )
+      vT /= nvT;
+
+    fr[ 0 ][ 0 ] = vT[ 0 ];
+    fr[ 1 ][ 0 ] = vT[ 1 ];
+
+    fr[ 0 ][ 1 ] = -vT[ 1 ];
+    fr[ 1 ][ 1 ] =  vT[ 0 ];
+  }
+  else if( TVector::Dimension == 3 )
+  {
+    this->_UpdateDerivative( );
+    this->m_Derivative->_UpdateDerivative( );
+    TVector vT = this->m_Derivative->Evaluate( u );
+    TScalar nvT = vT.GetNorm( );
+    if( nvT > TScalar( 0 ) )
+    {
+      vT /= nvT;
+      TVector vN = this->m_Derivative->m_Derivative->Evaluate( u );
+      TScalar nvN = vN.GetNorm( );
+      if( nvT > TScalar( 0 ) )
+      {
+        vN /= nvN;
+        TVector vB;
+        vB[ 0 ] = ( vT[ 1 ] * vN[ 2 ] ) - ( vT[ 2 ] * vN[ 1 ] );
+        vB[ 1 ] = ( vT[ 2 ] * vN[ 0 ] ) - ( vT[ 0 ] * vN[ 2 ] );
+        vB[ 2 ] = ( vT[ 0 ] * vN[ 1 ] ) - ( vT[ 1 ] * vN[ 0 ] );
+
+        for( unsigned int d = 0; d < 3; d++ )
+        {
+          fr[ d ][ 0 ] = vT[ d ];
+          fr[ d ][ 1 ] = vN[ d ];
+          fr[ d ][ 2 ] = vB[ d ];
+
+        } // rof
+      }
+      else
+        std::cerr << "ERROR normal" << std::endl;
+    }
+    else
+      std::cerr << "ERROR tangent" << std::endl;
+
+  } // fi
+  return( fr );
+}
+
+// -------------------------------------------------------------------------
+template< class V >
+typename cpExtensions::Algorithms::BezierCurveFunction< V >::
+TScalar cpExtensions::Algorithms::BezierCurveFunction< V >::
+EvaluateLength( ) const
+{
+  unsigned int n = this->GetNumberOfPoints( ) << 1;
+  TScalar d = TScalar( 0 );
+  TVector v0 = this->Evaluate( 0 );
+  for( unsigned int i = 1; i < n; i++ )
+  {
+    TVector v1 = this->Evaluate( TScalar( i ) / TScalar( n - 1 ) );
+    d += ( v1 - v0 ).GetNorm( );
+    v0 = v1;
+
+  } // rof
+  return( d );
+}
+
+// -------------------------------------------------------------------------
+template< class V >
+cpExtensions::Algorithms::BezierCurveFunction< V >::
+BezierCurveFunction( )
+  : Superclass( ),
+    m_DerivativeUpdated( false )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class V >
+void cpExtensions::Algorithms::BezierCurveFunction< V >::
+_UpdateDerivative( ) const
+{
+  if( this->m_DerivativeUpdated )
+    return;
+
+  this->m_Derivative = Self::New( );
+  unsigned int n = this->m_Vectors.size( ) - 1;
+  for( unsigned int i = 0; i < n; i++ )
+    this->m_Derivative->AddPoint(
+      TScalar( n ) * ( this->m_Vectors[ i + 1 ] - this->m_Vectors[ i ] )
+      );
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/GradientFunctionBase.h b/lib/cpExtensions/Algorithms/GradientFunctionBase.h
new file mode 100644 (file)
index 0000000..0472cc4
--- /dev/null
@@ -0,0 +1,84 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__GRADIENTFUNCTIONBASE__H__
+#define __CPEXTENSIONS__ALGORITHMS__GRADIENTFUNCTIONBASE__H__
+
+#include <map>
+#include <itkImageFunction.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class G >
+    class GradientFunctionBase
+      : public itk::ImageFunction< G, typename G::PixelType::ValueType, typename G::PixelType::ValueType >
+    {
+    public:
+      // Types from input arguments
+      typedef G                           TGradient;
+      typedef typename G::PixelType       TVector;
+      typedef typename TVector::ValueType TScalar;
+      itkStaticConstMacro( Dimension, unsigned int, G::ImageDimension );
+
+      // Standard itk types
+      typedef GradientFunctionBase                      Self;
+      typedef itk::ImageFunction< G, TScalar, TScalar > Superclass;
+      typedef itk::SmartPointer< Self >                 Pointer;
+      typedef itk::SmartPointer< const Self >           ConstPointer;
+
+      // Types from base itk::ImageFunction
+      typedef typename Superclass::InputType           TInput;
+      typedef typename Superclass::OutputType          TOutput;
+      typedef typename Superclass::PointType           TPoint;
+      typedef typename Superclass::ContinuousIndexType TContIndex;
+      typedef typename Superclass::IndexType           TIndex;
+
+      // Sparse buffer
+      typedef std::map< TIndex, TOutput, typename TIndex::LexicographicCompare > TBuffer;
+
+    public:
+      itkTypeMacro( GradientFunctionBase, itkImageFunction );
+
+      itkBooleanMacro( BufferResults );
+      itkGetConstMacro( BufferResults, bool );
+      itkSetMacro( BufferResults, bool );
+
+    public:
+      virtual void ResetBuffer( );
+
+      virtual TOutput Evaluate( const TPoint& p ) const;
+      virtual TOutput EvaluateAtIndex( const TIndex& i ) const;
+      virtual TOutput EvaluateAtContinuousIndex( const TContIndex& i ) const;
+
+    protected:
+      GradientFunctionBase( );
+      virtual ~GradientFunctionBase( );
+
+      virtual TOutput _Evaluate( const TIndex& i ) const = 0;
+
+    private:
+      // Purposely not implemented.
+      GradientFunctionBase( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      mutable TBuffer m_Buffer;
+      bool m_BufferResults;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/GradientFunctionBase.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__GRADIENTFUNCTIONBASE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/GradientFunctionBase.hxx b/lib/cpExtensions/Algorithms/GradientFunctionBase.hxx
new file mode 100644 (file)
index 0000000..cc0bac3
--- /dev/null
@@ -0,0 +1,82 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__GRADIENTFUNCTIONBASE__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__GRADIENTFUNCTIONBASE__HXX__
+
+// -------------------------------------------------------------------------
+template< class G >
+void cpExtensions::Algorithms::GradientFunctionBase< G >::
+ResetBuffer( )
+{
+  this->m_Buffer.clear( );
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+typename cpExtensions::Algorithms::GradientFunctionBase< G >::
+TOutput cpExtensions::Algorithms::GradientFunctionBase< G >::
+Evaluate( const TPoint& p ) const
+{
+  TIndex i;
+  this->GetInputImage( )->TransformPhysicalPointToIndex( p, i );
+  return( this->EvaluateAtIndex( i ) );
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+typename cpExtensions::Algorithms::GradientFunctionBase< G >::
+TOutput cpExtensions::Algorithms::GradientFunctionBase< G >::
+EvaluateAtIndex( const TIndex& i ) const
+{
+  TOutput res = TOutput( 0 );
+  bool computed = false;
+  if( this->m_BufferResults )
+  {
+    typename TBuffer::const_iterator bIt = this->m_Buffer.find( i );
+    computed = ( bIt != this->m_Buffer.end( ) );
+    res = ( computed )? bIt->second: res;
+
+  } // fi
+
+  if( !computed )
+    res = this->_Evaluate( i );
+
+  if( this->m_BufferResults )
+    this->m_Buffer[ i ] = res;
+  return( res );
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+typename cpExtensions::Algorithms::GradientFunctionBase< G >::
+TOutput cpExtensions::Algorithms::GradientFunctionBase< G >::
+EvaluateAtContinuousIndex( const TContIndex& i ) const
+{
+  TPoint p;
+  this->GetInputImage( )->TransformContinuousIndexToPhysicalPoint( i, p );
+  return( this->Evaluate( p ) );
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+cpExtensions::Algorithms::GradientFunctionBase< G >::
+GradientFunctionBase( )
+  : Superclass( ),
+    m_BufferResults( false )
+{
+  this->m_Buffer.clear( );
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+cpExtensions::Algorithms::GradientFunctionBase< G >::
+~GradientFunctionBase( )
+{
+  this->m_Buffer.clear( );
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__GRADIENTFUNCTIONBASE__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/GulsunTekMedialness.h b/lib/cpExtensions/Algorithms/GulsunTekMedialness.h
new file mode 100644 (file)
index 0000000..2fdf61c
--- /dev/null
@@ -0,0 +1,85 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__H__
+#define __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__H__
+
+#include <vector>
+#include <cpExtensions/Algorithms/GradientFunctionBase.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class G >
+    class GulsunTekMedialness
+      : public GradientFunctionBase< G >
+    {
+    public:
+      // Standard itk types
+      typedef GulsunTekMedialness             Self;
+      typedef GradientFunctionBase< G >       Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      // Types from superclass
+      typedef typename Superclass::TGradient  TGradient;
+      typedef typename Superclass::TVector    TVector;
+      typedef typename Superclass::TScalar    TScalar;
+      typedef typename Superclass::TInput     TInput;
+      typedef typename Superclass::TOutput    TOutput;
+      typedef typename Superclass::TPoint     TPoint;
+      typedef typename Superclass::TContIndex TContIndex;
+      typedef typename Superclass::TIndex     TIndex;
+      typedef typename Superclass::TBuffer    TBuffer;
+
+      typedef typename TIndex::OffsetType TOffset;
+      typedef std::vector< double >       TProfile;
+      typedef std::vector< TOffset >      TOffsets;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( GulsunTekMedialness, GradientFunctionBase );
+
+      itkGetConstMacro( MinRadius, double );
+      itkGetConstMacro( MaxRadius, double );
+      itkGetConstMacro( ProfileSampling, unsigned int );
+      itkGetConstMacro( RadialSampling, unsigned int );
+
+      itkSetMacro( MinRadius, double );
+      itkSetMacro( MaxRadius, double );
+      itkSetMacro( ProfileSampling, unsigned int );
+      itkSetMacro( RadialSampling, unsigned int );
+
+    protected:
+      GulsunTekMedialness( );
+      virtual ~GulsunTekMedialness( );
+
+      virtual TOutput _Evaluate( const TIndex& i ) const;
+
+    private:
+      // Purposely not implemented.
+      GulsunTekMedialness( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      double       m_MinRadius;
+      double       m_MaxRadius;
+      unsigned int m_ProfileSampling;
+      unsigned int m_RadialSampling;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/GulsunTekMedialness.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/GulsunTekMedialness.hxx b/lib/cpExtensions/Algorithms/GulsunTekMedialness.hxx
new file mode 100644 (file)
index 0000000..01a278b
--- /dev/null
@@ -0,0 +1,197 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__HXX__
+
+#include <cmath>
+#include <vnl/vnl_math.h>
+
+
+#include <queue>
+#include <map>
+#include <set>
+
+
+
+
+// -------------------------------------------------------------------------
+template< class G >
+cpExtensions::Algorithms::GulsunTekMedialness< G >::
+GulsunTekMedialness( )
+  : Superclass( ),
+    m_MinRadius( double( 0 ) ),
+    m_MaxRadius( double( 1 ) ),
+    m_ProfileSampling( 4 ),
+    m_RadialSampling( 10 )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+cpExtensions::Algorithms::GulsunTekMedialness< G >::
+~GulsunTekMedialness( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class G >
+typename cpExtensions::Algorithms::GulsunTekMedialness< G >::
+TOutput cpExtensions::Algorithms::GulsunTekMedialness< G >::
+_Evaluate( const TIndex& i ) const
+{
+  const G* gradient = this->GetInputImage( );
+  typename G::RegionType region = gradient->GetRequestedRegion( );
+  typename G::PointType i_P;
+  gradient->TransformIndexToPhysicalPoint( i, i_P );
+
+  std::queue< TIndex > q;
+  std::set< TIndex, typename TIndex::LexicographicCompare > m;
+  std::map< TOffset, std::vector< TIndex >, typename TOffset::LexicographicCompare > profiles;
+  q.push( i );
+
+  while( !q.empty( ) )
+  {
+    // Get next node
+    TIndex node = q.front( );
+    q.pop( );
+    if( m.find( node ) != m.end( ) )
+      continue;
+    m.insert( node );
+
+    // Get neighborhood
+    for( unsigned int d = 0; d < Self::Dimension; d++ )
+    {
+      for( int off = -1; off <= 1; off += 2 )
+      {
+        TIndex neighbor = node;
+        neighbor[ d ] += off;
+        if( region.IsInside( neighbor ) )
+        {
+          typename G::PointType neighbor_P;
+          gradient->TransformIndexToPhysicalPoint( neighbor, neighbor_P );
+          if( double( i_P.EuclideanDistanceTo( neighbor_P ) ) > this->m_MaxRadius )
+            continue;
+
+          // Normalize offset in terms of a l1 (manhattan) distance
+          TOffset offset = neighbor - i;
+          // std::cout << "Offset: " << offset << std::endl;
+
+          /*
+            int max_off = 0;
+            for( unsigned int o = 0; o < Self::Dimension; ++o )
+            max_off += std::abs( offset[ o ] );
+            if( max_off == 0 )
+            continue;
+            bool normalized = true;
+            TOffset normalized_offset;
+            for( unsigned int o = 0; o < Self::Dimension && normalized; ++o )
+            {
+            if( offset[ o ] % max_off == 0 )
+            normalized_offset[ o ] = offset[ o ] / max_off;
+            else
+            normalized = false;
+
+            } // rof
+            if( !normalized )
+            normalized_offset = offset;
+            std::cout << "offset: " << normalized_offset << std::endl;
+
+            // Update profiles
+            profiles[ normalized_offset ].push_back( neighbor );
+          */
+
+          // Update queue
+          q.push( neighbor );
+
+        } // fi
+
+      } // rof
+
+    } // rof
+
+  } // elihw
+  // std::cout << "HOLA: " << profiles.size( ) << std::endl;
+
+
+  return( TOutput( 0 ) );
+  /* TODO
+     const G* in = this->GetInputImage( );
+     double pi2n =
+     double( 2 ) * double( vnl_math::pi ) /
+     double( this->m_ProfileSampling );
+     double rOff = this->m_MaxRadius / double( this->m_RadialSampling - 1 );
+     double optR = double( 0 );
+     TPoint pnt;
+     in->TransformIndexToPhysicalPoint( i, pnt );
+
+     // Main loop
+     for( unsigned int cx = 0; cx < Self::Dimension - 1; cx++ )
+     {
+     for( unsigned int cy = cx + 1; cy < Self::Dimension; cy++ )
+     {
+     TProfile maxProfile( this->m_RadialSampling, double( 0 ) );
+     for( unsigned int p = 0; p < this->m_ProfileSampling; p++ )
+     {
+     double a = pi2n * double( p );
+
+     // Direction of this profile
+     TVector dir;
+     dir.Fill( TScalar( 0 ) );
+     dir[ cx ] = TScalar( std::cos( a ) );
+     dir[ cy ] = TScalar( std::sin( a ) );
+
+     double maxrise = double( 0 );
+     double maxfall = double( -1 );
+     TProfile profile;
+     for( unsigned int r = 0; r < this->m_RadialSampling; r++ )
+     {
+     double radius = double( r ) * rOff;
+     TIndex idx;
+     if(
+     in->TransformPhysicalPointToIndex( pnt + ( dir * radius ), idx )
+     )
+     {
+     TVector g = in->GetPixel( idx );
+     double b = double( g.GetNorm( ) );
+     if( double( g * dir ) < double( 0 ) )
+     b *= double( -1 );
+     maxrise = ( b > maxrise )? b: maxrise;
+     if( radius >= this->m_MinRadius )
+     maxfall = ( b < maxfall )? b: maxfall;
+     profile.push_back( -b - maxrise );
+     }
+     else
+     profile.push_back( double( 0 ) );
+
+     } // rof
+
+     for( unsigned int r = 0; r < this->m_RadialSampling; r++ )
+     {
+     double E = profile[ r ] / -maxfall;
+     E = ( E < double( 0 ) )? double( 0 ): E;
+     E = ( E > double( 1 ) )? double( 1 ): E;
+     maxProfile[ r ] += E;
+
+     } // rof
+
+     } // rof
+
+     for( unsigned int r = 0; r < this->m_RadialSampling; r++ )
+     {
+     double E = maxProfile[ r ] / double( this->m_RadialSampling );
+     optR = ( E > optR )? E: optR;
+
+     } // rof
+
+     } // rof
+
+     } // rof
+     return( TScalar( optR ) );
+  */
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__GULSUNTEKMEDIALNESS__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/ImageFunctionFilter.h b/lib/cpExtensions/Algorithms/ImageFunctionFilter.h
new file mode 100644 (file)
index 0000000..39007a5
--- /dev/null
@@ -0,0 +1,106 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__
+
+#include <itkImageToImageFilter.h>
+#include <itkImageScanlineConstIterator.h>
+#include <itkImageScanlineIterator.h>
+#include <itkProgressReporter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O, class F >
+    class ImageFunctionFilter
+      : public itk::ImageToImageFilter< I, O >
+    {
+    public:
+      typedef ImageFunctionFilter             Self;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+      typedef F TFunction;
+
+      typedef typename O::RegionType TRegion;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( ImageFunctionFilter, itkImageToImageFilter );
+
+      itkGetObjectMacro( Function, F );
+      itkSetObjectMacro( Function, F );
+
+    protected:
+      ImageFunctionFilter( )
+        : Superclass( )
+        {
+        }
+      virtual ~ImageFunctionFilter( )
+        {
+        }
+
+      virtual void ThreadedGenerateData(
+        const TRegion& region,
+        itk::ThreadIdType threadId
+        )
+        {
+          const typename TRegion::SizeType& regionSize = region.GetSize( );
+          if( regionSize[ 0 ] == 0 )
+            return;
+          const I* in = this->GetInput( );
+          O* out = this->GetOutput( 0 );
+
+          const size_t nLines = region.GetNumberOfPixels( ) / regionSize[ 0 ];
+          itk::ProgressReporter progress( this, threadId, nLines );
+
+          // Define the iterators
+          itk::ImageScanlineConstIterator< I > inIt( in, region );
+          itk::ImageScanlineIterator< O > outIt( out, region );
+
+          inIt.GoToBegin( );
+          outIt.GoToBegin( );
+          while( !inIt.IsAtEnd( ) )
+          {
+            while( !inIt.IsAtEndOfLine( ) )
+            {
+              outIt.Set( this->m_Function->EvaluateAtIndex( inIt.GetIndex( ) ) );
+              ++inIt;
+              ++outIt;
+
+            } // elihw
+            inIt.NextLine( );
+            outIt.NextLine( );
+            progress.CompletedPixel( );
+
+          } // elihw
+        }
+
+    private:
+      // Purposely not implemented.
+      ImageFunctionFilter( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      typename F::Pointer m_Function;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+// TODO: #include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTIONFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/ImageFunctorFilter.h b/lib/cpExtensions/Algorithms/ImageFunctorFilter.h
new file mode 100644 (file)
index 0000000..d8a7eca
--- /dev/null
@@ -0,0 +1,102 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTORFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTORFILTER__H__
+
+#include <itkImageToImageFilter.h>
+#include <itkImageScanlineConstIterator.h>
+#include <itkImageScanlineIterator.h>
+#include <itkProgressReporter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O, class F >
+    class ImageFunctorFilter
+      : public itk::ImageToImageFilter< I, O >
+    {
+    public:
+      typedef ImageFunctorFilter             Self;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+      typedef F TFunctor;
+
+      typedef typename O::RegionType TRegion;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( ImageFunctorFilter, itkImageToImageFilter );
+
+      itkGetMacro( Functor, F );
+      itkGetConstMacro( Functor, F );
+
+    protected:
+      ImageFunctorFilter( )
+        : Superclass( )
+        {
+        }
+      virtual ~ImageFunctorFilter( )
+        {
+        }
+
+      virtual void ThreadedGenerateData(
+        const TRegion& region,
+        itk::ThreadIdType threadId
+        )
+        {
+          const typename TRegion::SizeType& regionSize = region.GetSize( );
+          if( regionSize[ 0 ] == 0 )
+            return;
+          const I* in = this->GetInput( );
+          O* out = this->GetOutput( 0 );
+
+          const size_t nLines = region.GetNumberOfPixels( ) / regionSize[ 0 ];
+          itk::ProgressReporter progress( this, threadId, nLines );
+
+          // Define the iterators
+          itk::ImageScanlineConstIterator< I > inIt( in, region );
+          itk::ImageScanlineIterator< O > outIt( out, region );
+
+          inIt.GoToBegin( );
+          outIt.GoToBegin( );
+          while( !inIt.IsAtEnd( ) )
+          {
+            while( !inIt.IsAtEndOfLine( ) )
+            {
+              outIt.Set( this->m_Functor( inIt.Get( ) ) );
+              ++inIt;
+              ++outIt;
+
+            } // elihw
+            inIt.NextLine( );
+            outIt.NextLine( );
+            progress.CompletedPixel( );
+
+          } // elihw
+        }
+
+    private:
+      // Purposely not implemented.
+      ImageFunctorFilter( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      F m_Functor;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__ALGORITHMS__IMAGEFUNCTORFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/InertiaMedialness.h b/lib/cpExtensions/Algorithms/InertiaMedialness.h
new file mode 100644 (file)
index 0000000..e385513
--- /dev/null
@@ -0,0 +1,215 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__INERTIAMEDIALNESS__H__
+#define __CPEXTENSIONS__ALGORITHMS__INERTIAMEDIALNESS__H__
+
+#include <map>
+#include <itkImageFunction.h>
+
+#include <cpExtensions/Algorithms/InertiaTensorFunction.h>
+#include <itkImageRegionConstIteratorWithIndex.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class S = float >
+    class InertiaMedialness
+      : public itk::ImageFunction< I, S, S >
+    {
+    public:
+      // Standard itk types
+      typedef InertiaMedialness               Self;
+      typedef itk::ImageFunction< I, S, S >   Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      // Types from base itk::ImageFunction
+      typedef typename Superclass::InputType           TInput;
+      typedef typename Superclass::OutputType          TOutput;
+      typedef typename Superclass::PointType           TPoint;
+      typedef typename Superclass::ContinuousIndexType TContIndex;
+      typedef typename Superclass::IndexType           TIndex;
+      typedef typename TIndex::OffsetType              TOffset;
+
+      // Sparse buffer
+      typedef std::map< TIndex, TOutput, typename TIndex::LexicographicCompare > TBuffer;
+
+      typedef InertiaTensorFunction< S, I::ImageDimension > TInertia;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( InertiaMedialness, itkImageFunction );
+
+      itkBooleanMacro( BufferResults );
+      itkGetConstMacro( BufferResults, bool );
+      itkGetConstMacro( MaxRadius, double );
+
+      itkSetMacro( BufferResults, bool );
+      itkSetMacro( MaxRadius, double );
+
+    public:
+      virtual void ResetBuffer( )
+        {
+          this->m_Buffer.clear( );
+        }
+
+      virtual TOutput Evaluate( const TPoint& p ) const
+        {
+          TIndex i;
+          this->GetInputImage( )->TransformPhysicalPointToIndex( p, i );
+          return( this->EvaluateAtIndex( i ) );
+        }
+
+      virtual TOutput EvaluateAtIndex( const TIndex& i ) const
+        {
+          TOutput res = TOutput( 0 );
+          bool computed = false;
+          if( this->m_BufferResults )
+          {
+            typename TBuffer::const_iterator bIt = this->m_Buffer.find( i );
+            computed = ( bIt != this->m_Buffer.end( ) );
+            res = ( computed )? bIt->second: res;
+
+          } // fi
+
+          if( !computed )
+            res = this->_Evaluate( i );
+
+          if( this->m_BufferResults )
+            this->m_Buffer[ i ] = res;
+          return( res );
+        }
+
+      virtual TOutput EvaluateAtContinuousIndex( const TContIndex& i ) const
+        {
+          TPoint p;
+          this->GetInputImage( )->TransformContinuousIndexToPhysicalPoint( i, p );
+          return( this->Evaluate( p ) );
+        }
+
+    protected:
+      InertiaMedialness( )
+        : Superclass( ),
+          m_BufferResults( false ),
+          m_MaxRadius( double( 1 ) )
+        {
+          this->m_Buffer.clear( );
+        }
+
+      virtual ~InertiaMedialness( )
+        {
+          this->m_Buffer.clear( );
+        }
+
+      virtual TOutput _Evaluate( const TIndex& idx ) const
+        {
+          const I* image = this->GetInputImage( );
+
+          typename I::PointType p_i;
+          image->TransformIndexToPhysicalPoint( idx, p_i );
+
+          typename I::PointType max_p, min_p;
+          for( unsigned int d = 0; d < I::ImageDimension; ++d )
+          {
+            max_p[ d ] = p_i[ d ] + this->m_MaxRadius;
+            min_p[ d ] = p_i[ d ] - this->m_MaxRadius;
+
+          } // rof
+          TIndex max_i, min_i;
+          image->TransformPhysicalPointToIndex( max_p, max_i );
+          image->TransformPhysicalPointToIndex( min_p, min_i );
+
+          typename I::RegionType in_region = image->GetRequestedRegion( );
+          TIndex in_index = in_region.GetIndex( );
+          TIndex in_last = in_index + in_region.GetSize( );
+          typename I::SizeType size;
+          for( unsigned int d = 0; d < I::ImageDimension; ++d )
+          {
+            if( min_i[ d ] < in_index[ d ] ) min_i[ d ] = in_index[ d ];
+            if( max_i[ d ] < in_index[ d ] ) max_i[ d ] = in_index[ d ];
+            if( min_i[ d ] >= in_last[ d ] ) min_i[ d ] = in_last[ d ];
+            if( max_i[ d ] >= in_last[ d ] ) max_i[ d ] = in_last[ d ];
+
+            size[ d ] = max_i[ d ] - min_i[ d ];
+
+          } // rof
+
+          typename I::RegionType region;
+          region.SetIndex( min_i );
+          region.SetSize( size );
+
+          std::vector< typename TInertia::Pointer > inertias;
+          itk::ImageRegionConstIteratorWithIndex< I > it( image, region );
+          for( it.GoToBegin( ); !it.IsAtEnd( ); ++it )
+          {
+            TOffset off = it.GetIndex( ) - idx;
+            unsigned long l1dist = std::abs( off[ 0 ] );
+            for( unsigned int d = 1; d < I::ImageDimension; ++d )
+              l1dist = ( std::abs( off[ d ] ) > l1dist )? std::abs( off[ d ] ): l1dist;
+
+            typename TInertia::TPoint i_pnt;
+            image->TransformIndexToPhysicalPoint( it.GetIndex( ), i_pnt );
+
+            for( unsigned long l = 0; l < l1dist; ++l )
+            {
+              if( inertias.size( ) <= l )
+                inertias.push_back( TInertia::New( ) );
+              inertias[ l ]->AddMass( i_pnt.GetVectorFromOrigin( ), S( it.Get( ) ) );
+
+              /* TODO
+                 typename TInertias::iterator inIt = inertias.find( l );
+                 if( inIt == inertias.end( ) )
+                 inIt = inertias.insert( std::pair< unsigned long, typename TInertia::Pointer >( l, TInertia::New( ) ) ).first;
+              */
+
+            } // rof
+
+          } // rof
+
+          if( inertias.size( ) > 0 )
+          {
+            S res = S( 0 );
+            for( unsigned int l = 0; l < inertias.size( ); ++l )
+            {
+              typename TInertia::TVector pv, r;
+              typename TInertia::TMatrix pm;
+              inertias[ l ]->GetEigenAnalysis( pm, pv, r );
+              S v = pv.GetNorm( );
+              if( l == 0 || v > res )
+                res = v;
+
+            } // rof
+            return( res );
+          }
+          else
+            return( TOutput( 0 ) );
+        }
+
+    private:
+      // Purposely not implemented.
+      InertiaMedialness( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      mutable TBuffer m_Buffer;
+      bool m_BufferResults;
+
+      double m_MaxRadius;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+// TODO: #include <cpExtensions/Algorithms/InertiaMedialness.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__INERTIAMEDIALNESS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/InertiaTensorFunction.h b/lib/cpExtensions/Algorithms/InertiaTensorFunction.h
new file mode 100644 (file)
index 0000000..ecb341d
--- /dev/null
@@ -0,0 +1,180 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__INERTIATENSORFUNCTION__H__
+#define __CPEXTENSIONS__ALGORITHMS__INERTIATENSORFUNCTION__H__
+
+#include <itkObject.h>
+
+#include <itkObject.h>
+#include <itkObjectFactory.h>
+#include <itkMatrix.h>
+#include <itkPoint.h>
+
+
+#include <cmath>
+#include <itkSymmetricEigenAnalysis.h>
+
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class S, unsigned int D >
+    class InertiaTensorFunction
+      : public itk::Object
+    {
+    public:
+      // Standard itk types
+      typedef InertiaTensorFunction           Self;
+      typedef itk::Object                     Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef S                           TScalar;
+      typedef itk::Matrix< S, D, D >      TMatrix;
+      typedef itk::Point< S, D >          TPoint;
+      typedef typename TPoint::VectorType TVector;
+
+    protected:
+      typedef TMatrix _TInternalMatrix;
+      typedef itk::Matrix< S, D, 1 > _TInternalVector;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( InertiaTensorFunction, itkObject );
+
+    public:
+      inline void Reset( )
+        {
+          this->m_M = S( 0 );
+          this->m_MPP = S( 0 );
+          this->m_MP.Fill( S( 0 ) );
+          this->m_MPPT.Fill( S( 0 ) );
+          this->Modified( );
+        }
+      inline void AddMass( const TPoint& pnt, const S& mass = S( 1 ) )
+        {
+          this->AddMass( pnt.GetVectorFromOrigin( ), mass );
+        }
+      inline void AddMass( const S* data, const S& mass = S( 1 ) )
+        {
+          this->AddMass( TVector( data ), mass );
+        }
+      inline void AddMass( const TVector& vec, const S& mass = S( 1 ) )
+        {
+          this->m_M += mass;
+          this->m_MPP += mass * ( vec * vec );
+
+          _TInternalVector mp;
+          for( unsigned int d = 0; d < D; ++d )
+          {
+            this->m_MP[ d ][ 0 ] += mass * vec[ d ];
+            mp[ d ][ 0 ] = vec[ d ];
+
+          } // rof
+          this->m_MPPT +=
+            _TInternalMatrix( mp.GetVnlMatrix( ) * mp.GetTranspose( ) ) *
+            mass;
+        }
+
+      inline S GetMass( ) const
+        {
+          return( this->m_M );
+        }
+
+      inline TMatrix GetInertia( ) const
+        {
+          TMatrix I;
+          if( S( 0 ) < this->m_M )
+          {
+            I.SetIdentity( );
+            I *= this->m_MPP - ( ( this->m_MP.GetTranspose( ) * this->m_MP.GetVnlMatrix( ) )[ 0 ][ 0 ] / this->m_M );
+            I -= this->m_MPPT;
+            I += TMatrix( this->m_MP.GetVnlMatrix( ) * this->m_MP.GetTranspose( ) ) / this->m_M;
+          }
+          else
+            I.Fill( S( 0 ) );
+          return( I );
+        }
+
+      inline TVector GetCenterOfGravity( ) const
+        {
+          TVector cog;
+          if( S( 0 ) < this->m_M )
+          {
+            for( unsigned int d = 0; d < D; ++d )
+              cog[ d ] = this->m_MP[ d ][ 0 ] / this->m_M;
+          }
+          else
+            cog.Fill( S( 0 ) );
+          return( cog );
+        }
+
+      inline void GetEigenAnalysis( TMatrix& pm, TVector& pv, TVector& r ) const
+        {
+          TMatrix I = this->GetInertia( );
+
+          itk::SymmetricEigenAnalysis< TMatrix, TVector, TMatrix > eigen;
+          eigen.SetDimension( D );
+          eigen.SetOrderEigenMagnitudes( true );
+          eigen.SetOrderEigenValues( 1 );
+          eigen.ComputeEigenValuesAndVectors( I, pv, pm );
+          pm = TMatrix( pm.GetTranspose( ) );
+          S det = vnl_determinant( pm.GetVnlMatrix( ) );
+          for( unsigned int d = 0; d < D; ++d )
+            pm[ d ][ D - 1 ] *= det;
+
+          if( D == 2 )
+          {
+            S coeff = S( 4 ) / this->m_M;
+            r[ 0 ] = std::sqrt( std::fabs( coeff * pv[ 1 ] ) );
+            r[ 1 ] = std::sqrt( std::fabs( coeff * pv[ 0 ] ) );
+          }
+          else if( D == 3 )
+          {
+            S coeff = S( 2.5 ) / this->m_M;
+            r[ 0 ] = std::sqrt( std::fabs( coeff * ( pv[ 1 ] + pv[ 2 ] - pv[ 0 ] ) ) );
+            r[ 1 ] = std::sqrt( std::fabs( coeff * ( pv[ 0 ] + pv[ 2 ] - pv[ 1 ] ) ) );
+            r[ 2 ] = std::sqrt( std::fabs( coeff * ( pv[ 0 ] + pv[ 1 ] - pv[ 2 ] ) ) );
+          }
+          else
+            r.Fill( S( 0 ) );
+        }
+
+    protected:
+      InertiaTensorFunction( )
+        : Superclass( )
+        {
+          this->Reset( );
+        }
+      virtual ~InertiaTensorFunction( )
+        {
+        }
+
+    private:
+      // Purposely not implemented.
+      InertiaTensorFunction( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      S m_M;
+      S m_MPP;
+      _TInternalVector m_MP;
+      _TInternalMatrix m_MPPT;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+// #include <cpExtensions/Algorithms/InertiaTensorFunction.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__INERTIATENSORFUNCTION__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/IsoImageSlicer.h b/lib/cpExtensions/Algorithms/IsoImageSlicer.h
new file mode 100644 (file)
index 0000000..19410c3
--- /dev/null
@@ -0,0 +1,184 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__
+#define __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__
+
+#include <itkAffineTransform.h>
+#include <itkExtractImageFilter.h>
+#include <itkImage.h>
+#include <itkImageToImageFilter.h>
+#include <itkInterpolateImageFunction.h>
+#include <itkResampleImageFilter.h>
+#include <itkVectorResampleImageFilter.h>
+#include <itkVectorInterpolateImageFunction.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class R, class I >
+    class BaseImageSlicer
+      : public itk::ImageToImageFilter< typename R::InputImageType, itk::Image< typename R::InputImageType::PixelType, R::ImageDimension - 1 > >
+    {
+    public:
+      // Basic types
+      typedef BaseImageSlicer            Self;
+      typedef R                          TSlicer;
+      typedef I                          TInterpolateFunction;
+      typedef typename R::InputImageType TImage;
+      typedef typename I::CoordRepType   TScalar;
+      typedef typename TImage::PixelType TPixel;
+      enum
+      {
+        Dim      = TImage::ImageDimension,
+        SliceDim = TImage::ImageDimension - 1
+      };
+      typedef itk::Image< TPixel, Self::SliceDim > TSliceImage;
+
+      // itk types
+      typedef itk::ImageToImageFilter< TImage, TSliceImage > Superclass;
+      typedef itk::SmartPointer< Self >                      Pointer;
+      typedef itk::SmartPointer< const Self >                ConstPointer;
+
+      // Internal filters
+      typedef itk::ExtractImageFilter< TImage, TSliceImage > TCollapsor;
+
+      // Various types
+      typedef typename TImage::IndexType   TIndex;
+      typedef typename TImage::RegionType  TRegion;
+      typedef typename TImage::SizeType    TSize;
+      typedef typename TImage::SpacingType TSpacing;
+      typedef typename TSpacing::ValueType TSpacingValue;
+
+      typedef itk::AffineTransform< TScalar, Self::Dim > TTransform;
+      typedef typename TTransform::MatrixType            TMatrix;
+      typedef typename TTransform::OffsetType            TVector;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( BaseImageSlicer, itkImageToImageFilter );
+
+      itkBooleanMacro( SizeFromMaximum );
+      itkBooleanMacro( SizeFromMinimum );
+      itkBooleanMacro( SpacingFromMaximum );
+      itkBooleanMacro( SpacingFromMinimum );
+
+      itkGetConstObjectMacro( Transform, TTransform );
+      itkGetConstMacro( DefaultValue, TPixel );
+      itkGetConstMacro( Size, TVector );
+      itkGetConstMacro( SizeFromMaximum, bool );
+      itkGetConstMacro( SizeFromMinimum, bool );
+      itkGetConstMacro( Spacing, TSpacingValue );
+      itkGetConstMacro( SpacingFromMaximum, bool );
+      itkGetConstMacro( SpacingFromMinimum, bool );
+
+      itkSetObjectMacro( Transform, TTransform );
+      itkSetMacro( Size, TVector );
+      itkSetMacro( DefaultValue, TPixel );
+      itkSetMacro( SizeFromMaximum, bool );
+      itkSetMacro( SizeFromMinimum, bool );
+      itkSetMacro( Spacing, TSpacingValue );
+      itkSetMacro( SpacingFromMaximum, bool );
+      itkSetMacro( SpacingFromMinimum, bool );
+
+    public:
+      virtual unsigned long GetMTime( ) const;
+
+      const TInterpolateFunction* GetInterpolator( ) const;
+      const TMatrix& GetRotation( ) const;
+      const TVector& GetTranslation( ) const;
+
+      void SetInterpolator( TInterpolateFunction* f );
+
+      template< class M >
+        void SetRotation( const M& r );
+
+      template< class V >
+        void SetTranslation( const V& t );
+      void SetSize( TScalar s );
+
+    protected:
+      BaseImageSlicer( );
+      virtual ~BaseImageSlicer( );
+
+      virtual void GenerateOutputInformation( ); // TODO { }
+      virtual void GenerateInputRequestedRegion( );
+      virtual void GenerateData( );
+
+    private:
+      // Purposely not implemented
+      BaseImageSlicer( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      typename TSlicer::Pointer    m_Slicer;
+      typename TCollapsor::Pointer m_Collapsor;
+      typename TTransform::Pointer m_Transform;
+
+      TPixel m_DefaultValue;
+
+      TVector m_Size;
+      bool    m_SizeFromMaximum;
+      bool    m_SizeFromMinimum;
+
+      TSpacingValue m_Spacing;
+      bool          m_SpacingFromMaximum;
+      bool          m_SpacingFromMinimum;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+// -------------------------------------------------------------------------
+#define CPPLUGINS_DEFINE_ISOIMAGESLICER( name, R, F )                   \
+  template< class I, class S = double >                                 \
+  class name                                                            \
+    : public BaseImageSlicer< R< I, I, S >, F< I, S > >                 \
+  {                                                                     \
+  public:                                                               \
+    typedef BaseImageSlicer< R< I, I, S >, F< I, S > > Superclass;      \
+    typedef name                                       Self;            \
+    typedef itk::SmartPointer< Self >                  Pointer;         \
+    typedef itk::SmartPointer< const Self >            ConstPointer;    \
+  public:                                                               \
+    itkNewMacro( Self );                                                \
+    itkTypeMacro( name, BaseSlicer );                                   \
+  protected:                                                            \
+    name( ) : Superclass( ) { }                                         \
+    virtual ~name( ) { }                                                \
+  private:                                                              \
+    name( const Self& );                                                \
+    void operator=( const Self& );                                      \
+  };
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    CPPLUGINS_DEFINE_ISOIMAGESLICER(
+      IsoImageSlicer,
+      itk::ResampleImageFilter,
+      itk::InterpolateImageFunction
+      );
+    CPPLUGINS_DEFINE_ISOIMAGESLICER(
+      VectorIsoImageSlicer,
+      itk::VectorResampleImageFilter,
+      itk::VectorInterpolateImageFunction
+      );
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/IsoImageSlicer.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/IsoImageSlicer.hxx b/lib/cpExtensions/Algorithms/IsoImageSlicer.hxx
new file mode 100644 (file)
index 0000000..041d874
--- /dev/null
@@ -0,0 +1,234 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__HXX__
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+unsigned long cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GetMTime( ) const
+{
+  unsigned long t = this->Superclass::GetMTime( );
+  unsigned long sT = this->m_Slicer->GetMTime( );
+  unsigned long cT = this->m_Collapsor->GetMTime( );
+  unsigned long tT = this->m_Transform->GetMTime( );
+  t = ( sT > t )? sT: t;
+  t = ( cT > t )? cT: t;
+  t = ( tT > t )? tT: t;
+  return( t );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+const typename cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+TInterpolateFunction*
+cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GetInterpolator( ) const
+{
+  return( this->m_Slicer->GetInterpolator( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+const typename cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+TMatrix& cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GetRotation( ) const
+{
+  return( this->m_Transform->GetMatrix( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+const typename cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+TVector& cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GetTranslation( ) const
+{
+  return( this->m_Transform->GetOffset( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+SetInterpolator( TInterpolateFunction* f )
+{
+  this->m_Slicer->SetInterpolator( f );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+template< class M >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+SetRotation( const M& r )
+{
+  TMatrix rotation;
+  for( unsigned int i = 0; i < Self::Dim; ++i )
+    for( unsigned int j = 0; j < Self::Dim; ++j )
+      rotation[ i ][ j ] = r[ i ][ j ];
+  this->m_Transform->SetMatrix( rotation );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+template< class V >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+SetTranslation( const V& t )
+{
+  TVector off;
+  for( unsigned int i = 0; i < Self::Dim; ++i )
+    off[ i ] = t[ i ];
+  this->m_Transform->SetOffset( off );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+SetSize( TScalar s )
+{
+  this->m_Size.Fill( s );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+BaseImageSlicer( )
+  : Superclass( ),
+    m_SizeFromMaximum( false ),
+    m_SizeFromMinimum( false ),
+    m_Spacing( TSpacingValue( 1 ) ),
+    m_SpacingFromMaximum( false ),
+    m_SpacingFromMinimum( false )
+{
+  this->m_Size.Fill( TScalar( 1 ) );
+
+  // Slicer
+  this->m_Slicer = TSlicer::New( );
+
+  TIndex idx;
+  idx.Fill( 0 );
+  this->m_Slicer->SetOutputStartIndex( idx );
+
+  // Dimension collapsor
+  this->m_Collapsor = TCollapsor::New( );
+  this->m_Collapsor->SetInput( this->m_Slicer->GetOutput( ) );
+  this->m_Collapsor->SetDirectionCollapseToIdentity( );
+
+  this->m_Transform = TTransform::New( );
+  this->m_Transform->SetIdentity( );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+~BaseImageSlicer( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GenerateOutputInformation( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GenerateInputRequestedRegion( )
+{
+  TImage* input = const_cast< TImage* >( this->GetInput( ) );
+  if( input != NULL )
+    input->SetRequestedRegionToLargestPossibleRegion( );
+}
+
+// -------------------------------------------------------------------------
+template< class R, class I >
+void cpExtensions::Algorithms::BaseImageSlicer< R, I >::
+GenerateData( )
+{
+  const TImage* input = this->GetInput( );
+
+  // Spacing
+  TSpacing spac;
+  if( this->m_SpacingFromMaximum || this->m_SpacingFromMinimum )
+  {
+    spac = input->GetSpacing( );
+    TSpacingValue minIso = spac[ 0 ];
+    TSpacingValue maxIso = spac[ 0 ];
+    for( unsigned int i = 1; i < Self::Dim; i++ )
+    {
+      minIso = ( spac[ i ] < minIso )? spac[ i ]: minIso;
+      maxIso = ( spac[ i ] > maxIso )? spac[ i ]: maxIso;
+
+    } // rof
+    this->m_Spacing = ( this->m_SpacingFromMinimum )? minIso: maxIso;
+
+  } // fi
+  spac.Fill( this->m_Spacing );
+
+  // Size and origin
+  if( this->m_SizeFromMaximum || this->m_SizeFromMinimum )
+  {
+    TSize iSize = input->GetRequestedRegion( ).GetSize( );
+    TSpacing iSpac = input->GetSpacing( );
+    TScalar minSize = TScalar( iSize[ 0 ] ) * TScalar( iSpac[ 0 ] );
+    TScalar maxSize = minSize;
+    for( unsigned int i = 1; i < Self::Dim; i++ )
+    {
+      TScalar v = TScalar( iSize[ i ] ) * TScalar( iSpac[ i ] );
+      minSize = ( v < minSize )? v: minSize;
+      maxSize = ( v > maxSize )? v: maxSize;
+
+    } // rof
+    if( this->m_SizeFromMaximum )
+      this->m_Size.Fill( maxSize );
+    else
+      this->m_Size.Fill( minSize );
+
+  } // fi
+
+  TSize size;
+  typename TSlicer::OriginPointType origin;
+  size[ 0 ] = 1;
+  origin[ 0 ] = 0;
+  for( unsigned int i = 1; i < Self::Dim; i++ )
+  {
+    double s = double( this->m_Size[ i ] ) / double( spac[ i ] );
+    size[ i ] = ( unsigned int )( s );
+    origin[ i ] = -( 0.5 * this->m_Size[ i ] );
+
+  } // rof
+
+  // Prepare slicer
+  this->m_Slicer->SetInput( input );
+  this->m_Slicer->SetTransform( this->m_Transform );
+  this->m_Slicer->SetOutputSpacing( spac );
+  this->m_Slicer->SetOutputOrigin( origin );
+  this->m_Slicer->SetSize( size );
+  this->m_Slicer->SetDefaultPixelValue( this->m_DefaultValue );
+
+  // Slice!
+  // Note: UpdateLargestPossibleRegion( ) is used since we need the
+  // output regions to be updated at each filter call.
+  this->m_Slicer->UpdateLargestPossibleRegion( );
+
+  // Collapse result
+  TRegion region = this->m_Slicer->GetOutput( )->GetRequestedRegion( );
+  TSize regionSize = region.GetSize( );
+  regionSize[ 0 ] = 0;
+  region.SetSize( regionSize );
+  this->m_Collapsor->SetExtractionRegion( region );
+
+  this->m_Collapsor->GraftOutput( this->GetOutput( ) );
+  this->m_Collapsor->UpdateLargestPossibleRegion( );
+  this->GraftOutput( this->m_Collapsor->GetOutput( ) );
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__ISOIMAGESLICER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/IterativeGaussianModelEstimator.h b/lib/cpExtensions/Algorithms/IterativeGaussianModelEstimator.h
new file mode 100644 (file)
index 0000000..5cf7332
--- /dev/null
@@ -0,0 +1,111 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
+#define __CPEXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
+
+#include <vector>
+#include <itkConceptChecking.h>
+#include <itkObject.h>
+#include <vnl/vnl_matrix.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class S, unsigned int D >
+    class IterativeGaussianModelEstimator
+      : public itk::Object
+    {
+    public:
+      typedef IterativeGaussianModelEstimator Self;
+      typedef itk::Object                     Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef S TScalar;
+      itkStaticConstMacro( Dimension, unsigned int, D );
+
+      // Begin concept checking
+#ifdef ITK_USE_CONCEPT_CHECKING
+      itkConceptMacro(
+        ScalarTypeHasFloatResolution,
+        ( itk::Concept::IsFloatingPoint< S > )
+        );
+#endif
+      // End concept checking
+
+      typedef vnl_matrix< S >        TMatrix;
+      typedef std::vector< TMatrix > TMatrices;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( IterativeGaussianModelEstimator, itkObject );
+
+    public:
+      unsigned long GetNumberOfSamples( ) const
+        { return( ( unsigned long )( this->m_N ) ); }
+      const TMatrix& GetMu( ) const
+        { return( this->m_M ); }
+      const TMatrix& GetOmega( ) const
+        { return( this->m_O ); }
+
+      void SetNumberOfSamples( unsigned long n );
+      void SetMu( const TMatrix& m );
+      void SetOmega( const TMatrix& O );
+
+      bool SaveModelToFile( const std::string& filename ) const;
+      bool LoadModelFromFile( const std::string& filename );
+
+      template< class V >
+      S Probability( const V& sample ) const;
+
+      S Probability( const S& s_x, const S& s_y, ... ) const;
+
+      template< class V, class M >
+      void GetModel( V& m, M& E ) const;
+
+      void Clear( );
+
+      template< class V >
+      void AddSample( const V& sample );
+
+      void AddSample( const S& s_x, const S& s_y, ... );
+
+    protected:
+      IterativeGaussianModelEstimator( );
+      virtual ~IterativeGaussianModelEstimator( );
+
+    protected:
+      void _UpdateModel( ) const;
+
+    private:
+      // Purposely not implemented
+      IterativeGaussianModelEstimator( const Self& other );
+      void operator=( const Self& other );
+
+    protected:
+      S m_N;
+      TMatrix m_M;
+      TMatrix m_O;
+
+      mutable bool m_Updated;
+      mutable TMatrix m_Cov;
+      mutable TMatrix m_Inv;
+      mutable S m_Norm;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/IterativeGaussianModelEstimator.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/IterativeGaussianModelEstimator.hxx b/lib/cpExtensions/Algorithms/IterativeGaussianModelEstimator.hxx
new file mode 100644 (file)
index 0000000..c6e3cb8
--- /dev/null
@@ -0,0 +1,291 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__HXX__
+
+#include <cmath>
+#include <cstdarg>
+#include <fstream>
+#include <vnl/vnl_math.h>
+#include <vnl/vnl_inverse.h>
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+SetNumberOfSamples( unsigned long n )
+{
+  this->m_N = S( n );
+  this->m_Updated = false;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+SetMu( const TMatrix& m )
+{
+  if( m.rows( ) == D && m.columns( ) == 1 )
+  {
+    this->m_M = m;
+    this->m_Updated = false;
+    this->Modified( );
+  }
+  else
+  {
+    itkExceptionMacro(
+      << "Input Mu matrix is not a " << D << "x1 matrix"
+      );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+SetOmega( const TMatrix& O )
+{
+  if( O.rows( ) == D && O.columns( ) == D )
+  {
+    this->m_O = O;
+    this->m_Updated = false;
+    this->Modified( );
+  }
+  else
+  {
+    itkExceptionMacro(
+      << "Input Omega matrix is not a " << D << "x" << D << " matrix"
+      );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+bool cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+SaveModelToFile( const std::string& filename ) const
+{
+  std::ofstream out( filename.c_str( ) );
+  if( out )
+  {
+    out << this->m_N << std::endl;
+    out << this->m_M << std::endl;
+    out << this->m_O << std::endl;
+    out.close( );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+bool cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+LoadModelFromFile( const std::string& filename )
+{
+  std::ifstream in( filename.c_str( ) );
+  if( in )
+  {
+    this->Clear( );
+    in >> this->m_N;
+    for( unsigned int i = 0; i < D; ++i )
+      in >> this->m_M[ i ][ 0 ];
+    for( unsigned int j = 0; j < D; ++j )
+      for( unsigned int i = 0; i < D; ++i )
+        in >> this->m_O[ i ][ j ];
+    in.close( );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+template< class V >
+S cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+Probability( const V& sample ) const
+{
+  if( !this->m_Updated )
+    this->_UpdateModel( );
+
+  TMatrix c( D, 1 );
+  for( unsigned int d = 0; d < D; ++d )
+    c[ d ][ 0 ] = S( sample[ d ] ) - this->m_M[ d ][ 0 ];
+  if( S( 0 ) < this->m_Norm )
+  {
+    // Covariance is NOT null
+    double v = double( ( c.transpose( ) * ( this->m_Inv * c ) )[ 0 ][ 0 ] );
+    v /= double( 2 );
+
+    return( S( std::exp( -v ) ) );
+  }
+  else
+  {
+    // Covariance is null
+    S n = S( 0 );
+    for( unsigned int d = 0; d < D; ++d )
+      n += c[ d ][ 0 ] * c[ d ][ 0 ];
+    bool equal = ( double( n ) < double( 1e-10 ) );
+    return( ( equal )? S( 1 ): S( 0 ) );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+S cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+Probability( const S& s_x, const S& s_y, ... ) const
+{
+  static S sample[ D ];
+
+  std::va_list args_lst;
+  va_start( args_lst, s_y );
+  sample[ 0 ] = s_x;
+  sample[ 1 ] = s_y;
+  for( unsigned int d = 2; d < D; ++d )
+    sample[ d ] = S( va_arg( args_lst, double ) );
+  va_end( args_lst );
+  return( this->Probability( sample ) );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+template< class V, class M >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+GetModel( V& m, M& E ) const
+{
+  if( !this->m_Updated )
+    this->_UpdateModel( );
+  for( unsigned int i = 0; i < D; ++i )
+  {
+    m[ i ] = double( this->m_M[ i ][ 0 ] );
+    for( unsigned int j = 0; j < D; ++j )
+      E[ i ][ j ] = double( this->m_Cov[ i ][ j ] );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+Clear( )
+{
+  this->m_N = S( 0 );
+  this->m_M.set_size( D, 1 );
+  this->m_O.set_size( D, D );
+  this->m_M.fill( S( 0 ) );
+  this->m_O.fill( S( 0 ) );
+  this->m_Updated = false;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+template< class V >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+AddSample( const V& sample )
+{
+  TMatrix s( D, 1 );
+  for( unsigned int d = 0; d < D; ++d )
+    s[ d ][ 0 ] = S( sample[ d ] );
+
+  // Update mean
+  S coeff = this->m_N;
+  this->m_N += S( 1 );
+  coeff /= this->m_N;
+  this->m_M = ( this->m_M * coeff ) + ( s / this->m_N );
+
+  // Update omega operand
+  if( this->m_N == 1 )
+    this->m_O  = s * s.transpose( );
+  else if( this->m_N == 2 )
+    this->m_O += s * s.transpose( );
+  else
+  {
+    S inv = S( 1 ) / ( this->m_N - S( 1 ) );
+    this->m_O  = this->m_O * ( this->m_N - S( 2 ) ) * inv;
+    this->m_O += ( s * s.transpose( ) ) * inv;
+
+  } // fi
+
+  this->m_Updated = false;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+AddSample( const S& s_x, const S& s_y, ... )
+{
+  static S sample[ D ];
+
+  std::va_list args_lst;
+  va_start( args_lst, s_y );
+  sample[ 0 ] = s_x;
+  if( D > 1 )
+  {
+    sample[ 1 ] = s_y;
+    for( unsigned int d = 2; d < D; ++d )
+      sample[ d ] = S( va_arg( args_lst, double ) );
+    va_end( args_lst );
+
+  } // fi
+  this->AddSample( sample );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+IterativeGaussianModelEstimator( )
+  : Superclass( )
+{
+  this->Clear( );
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+~IterativeGaussianModelEstimator( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class S, unsigned int D >
+void cpExtensions::Algorithms::IterativeGaussianModelEstimator< S, D >::
+_UpdateModel( ) const
+{
+  static const double _2piD =
+    std::pow( double( 2 ) * double( vnl_math::pi ), D );
+
+  // Update covariance
+  this->m_Cov =
+    this->m_O -
+    (
+      ( this->m_M * this->m_M.transpose( ) ) *
+      ( this->m_N / ( this->m_N - S( 1 ) ) )
+      );
+
+  // Compute inverse and determinant
+  S det = vnl_determinant( this->m_Cov );
+  if( !( det > S( 0 ) ) )
+  {
+    this->m_Inv.set_size( D, D );
+    this->m_Inv.fill( S( 0 ) );
+    this->m_Norm = S( 0 );
+  }
+  else
+  {
+    this->m_Inv = vnl_inverse( this->m_Cov );
+    this->m_Norm = S( 1 ) / S( std::sqrt( _2piD * double( det ) ) );
+
+  } // fi
+
+  // Object now is updated
+  this->m_Updated = true;
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanConstantFilter.cxx b/lib/cpExtensions/Algorithms/KalmanConstantFilter.cxx
new file mode 100644 (file)
index 0000000..0fd5d6c
--- /dev/null
@@ -0,0 +1,49 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#include <cpExtensions/Algorithms/KalmanConstantFilter.h>
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanConstantFilter< T >::
+Configure( unsigned int m )
+{
+  this->Superclass::Configure( m, 1, m );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanConstantFilter< T >::
+Initialize( )
+{
+  this->Superclass::Initialize( );
+
+  this->m_A.set_identity( );
+  this->m_B.fill( TScalar( 0 ) );
+  this->m_H.set_identity( );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+cpExtensions::Algorithms::KalmanConstantFilter< T >::
+KalmanConstantFilter( )
+  : Superclass( )
+{
+  this->Configure( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+cpExtensions::Algorithms::KalmanConstantFilter< T >::
+~KalmanConstantFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+// Explicit instantiations
+
+template class cpExtensions::Algorithms::KalmanConstantFilter< float >;
+template class cpExtensions::Algorithms::KalmanConstantFilter< double >;
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanConstantFilter.h b/lib/cpExtensions/Algorithms/KalmanConstantFilter.h
new file mode 100644 (file)
index 0000000..860a8f3
--- /dev/null
@@ -0,0 +1,56 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__KALMANCONSTANTFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__KALMANCONSTANTFILTER__H__
+
+#include <cpExtensions/Algorithms/KalmanFilter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< typename T >
+    class cpExtensions_EXPORT KalmanConstantFilter
+      : public KalmanFilter< T >
+    {
+    public:
+      typedef KalmanConstantFilter            Self;
+      typedef KalmanFilter< T >               Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef typename Superclass::TScalar TScalar;
+      typedef typename Superclass::TMatrix TMatrix;
+      typedef typename Superclass::TVector TVector;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( KalmanConstantFilter, KalmanFilter );
+
+    public:
+      void Configure( unsigned int m );
+
+      // Iteration methods
+      virtual void Initialize( );
+
+    protected:
+      KalmanConstantFilter( );
+      virtual ~KalmanConstantFilter( );
+
+    private:
+      // Purposely not implemented.
+      KalmanConstantFilter( const Self& );
+      void operator=( const Self& );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__ALGORITHMS__KALMANCONSTANTFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanFilter.cxx b/lib/cpExtensions/Algorithms/KalmanFilter.cxx
new file mode 100644 (file)
index 0000000..add2041
--- /dev/null
@@ -0,0 +1,137 @@
+#include <cpExtensions/Algorithms/KalmanFilter.h>
+
+#include <cstdlib>
+#include <vnl/algo/vnl_matrix_inverse.h>
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanFilter< T >::
+Configure( unsigned int s, unsigned int i, unsigned int m )
+{
+  this->m_StateSize   = s;
+  this->m_InputSize   = i;
+  this->m_MeasureSize = m;
+
+  // Matrices
+  this->m_A.set_size( s, s );
+  this->m_B.set_size( s, i );
+  this->m_H.set_size( m, s );
+  this->m_Id.set_size( s, s );
+  this->m_Q.set_size( s, s );
+  this->m_R.set_size( m, m );
+  this->m_P0.set_size( s, s );
+  this->m_K.set_size( s, m );
+  this->m_Pm.set_size( s, s );
+  this->m_Pp.set_size( s, s );
+
+  // Vectors
+  this->m_x0.set_size( s );
+  this->m_u.set_size( i );
+  this->m_m.set_size( m );
+  this->m_xm.set_size( s );
+  this->m_xp.set_size( s );
+
+  // Static values
+  this->m_Id.set_identity( );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanFilter< T >::
+Initialize( )
+{
+  // Set all to the first iteration
+  this->m_I = 0;
+  this->m_Step = Self::StFilt;
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanFilter< T >::
+Predict( )
+{
+  if( this->m_Step == Self::StFilt )
+  {
+    if( this->m_I == 0 )
+    {
+      this->m_xp = this->m_x0;
+      this->m_Pp = this->m_P0;
+
+    } // fi
+
+    // Project the state
+    this->m_xm = ( this->m_A * this->m_xp ) + ( this->m_B * this->m_u );
+
+    // Project the error
+    this->m_Pm  = this->m_A * this->m_Pp * this->m_A.transpose( );
+    this->m_Pm += this->m_Q;
+
+    this->m_Step = Self::StPred;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanFilter< T >::
+Innovate( )
+{
+  typedef vnl_matrix_inverse< T > _TInv;
+
+  if( this->m_Step == Self::StPred )
+  {
+    // Kalman gain
+    this->m_K  = this->m_Pm * this->m_H.transpose( );
+    this->m_K *=
+      _TInv(
+        ( this->m_H * this->m_Pm * this->m_H.transpose( ) ) + this->m_R
+        );
+
+    this->m_Step = Self::StInno;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanFilter< T >::
+Filtrate( )
+{
+  if( this->m_Step == Self::StInno )
+  {
+    // A posteriori state
+    this->m_xp  = this->m_xm;
+    this->m_xp += this->m_K * ( this->m_m - ( this->m_H * this->m_xm ) );
+
+    // A posteriori error
+    this->m_Pp = ( this->m_Id - ( this->m_K * this->m_H ) ) * this->m_Pm;
+
+    this->m_Step = Self::StFilt;
+    this->m_I++;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+cpExtensions::Algorithms::KalmanFilter< T >::
+KalmanFilter( )
+  : Superclass( )
+{
+  this->Configure( 1, 1, 1 );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+cpExtensions::Algorithms::KalmanFilter< T >::
+~KalmanFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+// Explicit instantiations
+
+template class cpExtensions::Algorithms::KalmanFilter< float >;
+template class cpExtensions::Algorithms::KalmanFilter< double >;
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanFilter.h b/lib/cpExtensions/Algorithms/KalmanFilter.h
new file mode 100644 (file)
index 0000000..bd0c17a
--- /dev/null
@@ -0,0 +1,215 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <itkObject.h>
+#include <itkObjectFactory.h>
+#include <vnl/vnl_matrix.h>
+#include <vnl/vnl_vector.h>
+
+// -------------------------------------------------------------------------
+#define kalmanGetSetMacro( type, name )         \
+  itkGetConstMacro( name, type );               \
+  itkSetMacro( name, type );
+
+// -------------------------------------------------------------------------
+#define kalmanGetMatrixMacro( var, name )       \
+  virtual const TMatrix& Get##name( ) const     \
+  { return( this->m_##var ); }
+
+// -------------------------------------------------------------------------
+#define kalmanSetMatrixMacro( var, name )       \
+  virtual void Set##name( const TMatrix& m )    \
+  { this->Set##var( m ); }
+
+// -------------------------------------------------------------------------
+#define kalmanGetSetMatrixMacro( var, name )    \
+  kalmanGetMatrixMacro( var, name );            \
+  kalmanSetMatrixMacro( var, name );
+
+// -------------------------------------------------------------------------
+#define kalmanGetVectorMacro( var, name )       \
+  virtual const TVector& Get##name( ) const     \
+  { return( this->m_##var ); }
+
+// -------------------------------------------------------------------------
+#define kalmanSetVectorMacro( var, name )       \
+  virtual void Set##name( const TVector& v )    \
+  { this->Set##var( v ); }
+
+// -------------------------------------------------------------------------
+#define kalmanGetSetVectorMacro( var, name )    \
+  kalmanGetVectorMacro( var, name );            \
+  kalmanSetVectorMacro( var, name );
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     * Abstract class implementing the classical kalman filter. See
+     * http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf
+     * for a description of this algorithm.
+     */
+    template< typename T >
+    class cpExtensions_EXPORT KalmanFilter
+      : public itk::Object
+    {
+    public:
+      typedef KalmanFilter                    Self;
+      typedef itk::Object                     Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      // Template parameters types
+      typedef T TScalar;
+
+      // VNL types
+      typedef vnl_matrix< TScalar > TMatrix;
+      typedef vnl_vector< TScalar > TVector;
+
+      //  stage identificators
+      enum
+      {
+        StPred,
+        StInno,
+        StFilt
+      };
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( KalmanFilter, itkObject );
+
+      // Values
+      itkGetConstMacro( StateSize, unsigned int );
+      itkGetConstMacro( InputSize, unsigned int );
+      itkGetConstMacro( MeasureSize, unsigned int );
+
+      // Matrices
+      kalmanGetSetMacro( TMatrix, A );
+      kalmanGetSetMacro( TMatrix, B );
+      kalmanGetSetMacro( TMatrix, H );
+      kalmanGetSetMacro( TMatrix, Q );
+      kalmanGetSetMacro( TMatrix, R );
+      kalmanGetSetMacro( TMatrix, P0 );
+      kalmanGetSetMacro( TMatrix, K );
+      kalmanGetSetMacro( TMatrix, Pm );
+      kalmanGetSetMacro( TMatrix, Pp );
+
+      // Vectors
+      kalmanGetSetMacro( TVector, x0 );
+      kalmanGetSetMacro( TVector, u );
+      kalmanGetSetMacro( TVector, m );
+      kalmanGetSetMacro( TVector, xm );
+      kalmanGetSetMacro( TVector, xp );
+
+      // Human-readable matrices
+      kalmanGetSetMatrixMacro( A, TransitionMatrix );
+      kalmanGetSetMatrixMacro( B, InputControlMatrix );
+      kalmanGetSetMatrixMacro( H, MeasureMatrix );
+      kalmanGetSetMatrixMacro( Q, ProcessNoise );
+      kalmanGetSetMatrixMacro( R, MeasureNoise );
+      kalmanGetSetMatrixMacro( P0, InitialNoise );
+      kalmanGetSetMatrixMacro( K, Gain );
+      kalmanGetSetMatrixMacro( Pm, APrioriNoise );
+      kalmanGetSetMatrixMacro( Pp, APosterioriNoise );
+
+      // Human-readable vectors
+      kalmanGetSetVectorMacro( x0, InitialState );
+      kalmanGetSetVectorMacro( u, Input );
+      kalmanGetSetVectorMacro( m, Measure );
+      kalmanGetSetVectorMacro( xm, APrioriState );
+      kalmanGetSetVectorMacro( xp, APosterioriState );
+
+    public:
+
+      void Configure( unsigned int s, unsigned int i, unsigned int m );
+
+      // Iteration methods
+      virtual void Initialize( );
+      virtual void Predict( );
+      virtual void Innovate( );
+      virtual void Filtrate( );
+      virtual void OneStep( )
+        {
+          this->Predict( );
+          this->Innovate( );
+          this->Filtrate( );
+        }
+      virtual void NSteps( unsigned int n )
+        {
+          for( unsigned int i = 0; i < n; i++ )
+            this->OneStep( );
+        }
+      unsigned int CurrentIteration( ) const
+        { return( this->m_I ); }
+      unsigned char CurrentStep( ) const
+        { return( this->m_Step ); }
+
+    protected:
+      KalmanFilter( );
+      virtual ~KalmanFilter( );
+
+    private:
+      // Purposely not implemented
+      KalmanFilter( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      // Filter dimensions
+      unsigned int m_StateSize;
+      unsigned int m_InputSize;
+      unsigned int m_MeasureSize;
+
+      // Transition matrices
+      TMatrix m_A;  // Transition
+      TMatrix m_B;  // Input control
+      TMatrix m_H;  // Measure
+      TMatrix m_Id; // Identity matrix
+
+      // Noise matrices
+      TMatrix m_Q; // Process noise covariance
+      TMatrix m_R; // Measure noise covariance
+
+      // Initial values
+      TVector m_x0; // Initial state
+      TMatrix m_P0; // Initial error covariance
+
+      // Loop vectors
+      TVector m_u;  // Last real input
+      TVector m_m;  // Last real measure
+      TVector m_xm; // A priori state
+      TVector m_xp; // A posteriori state
+
+      // Loop matrices
+      TMatrix m_K; // kalman gain
+      TMatrix m_Pm; // A priori error
+      TMatrix m_Pp; // A posteriori error
+
+      // Loop values
+      unsigned int  m_I;    // Current iteration
+      unsigned char m_Step; // Current step within current iteration
+
+      // -------------------------------------------------------------------
+      // Classic kronecker product operator
+      // -------------------------------------------------------------------
+      template< class M >
+      static void Kronecker( M& AkB, const M& A, const M& B );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/KalmanFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanFilter.hxx b/lib/cpExtensions/Algorithms/KalmanFilter.hxx
new file mode 100644 (file)
index 0000000..e81cae2
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__HXX__
+
+// -------------------------------------------------------------------------
+template< typename T >
+template< class M >
+void cpExtensions::Algorithms::KalmanFilter< T >::
+Kronecker( M& AkB, const M& A, const M& B )
+{
+  unsigned int m = A.rows( ); unsigned int n = A.cols( );
+  unsigned int p = B.rows( ); unsigned int q = B.cols( );
+  AkB.set_size( m * p, n * q );
+
+  for( unsigned int i = 1; i <= m; ++i )
+  {
+    for( unsigned int j = 1; j <= n; ++j )
+    {
+      for( unsigned int k = 1; k <= p; ++k )
+      {
+        for( unsigned int l = 1; l <= q; ++l )
+        {
+          unsigned int al = ( ( p * ( i - 1 ) ) + k ) - 1;
+          unsigned int be = ( ( q * ( j - 1 ) ) + l ) - 1;
+          AkB[ al ][ be ] = A[ i - 1 ][ j - 1 ] * B[ k - 1 ][ l - 1 ];
+
+        } // rof
+
+      } // rof
+
+    } // rof
+
+  } // rof
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanVelocityFilter.cxx b/lib/cpExtensions/Algorithms/KalmanVelocityFilter.cxx
new file mode 100644 (file)
index 0000000..a725e16
--- /dev/null
@@ -0,0 +1,90 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#include <cpExtensions/Algorithms/KalmanVelocityFilter.h>
+#include <cmath>
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+Configure( unsigned int m )
+{
+  this->Superclass::Configure( m << 1, 1, m );
+
+  this->m_TimeOffset.set_size( 2, 2 );
+  this->SetTimeOffset( TScalar( 1 ) );
+
+  this->m_Sigma.set_size( this->m_MeasureSize, this->m_MeasureSize );
+  this->m_Sigma.set_identity( );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+typename cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+TScalar cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+GetTimeOffset( ) const
+{
+  return( TScalar( std::sqrt( double( this->m_TimeOffset[ 1 ][ 1 ] ) ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+SetTimeOffset( TScalar t )
+{
+  TScalar t2 = t * t;
+  TScalar t3 = t2 * t;
+  TScalar t4 = t3 * t;
+  this->m_TimeOffset[ 0 ][ 0 ] = t4 / TScalar( 4 );
+  this->m_TimeOffset[ 1 ][ 1 ] = t2;
+
+  this->m_TimeOffset[ 0 ][ 1 ] = t3 / TScalar( 2 );
+  this->m_TimeOffset[ 1 ][ 0 ] = this->m_TimeOffset[ 0 ][ 1 ];
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+void cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+Initialize( )
+{
+  this->Superclass::Initialize( );
+
+  Self::Kronecker( this->m_Q, this->m_Sigma, this->m_TimeOffset );
+
+  this->m_A.set_identity( );
+  this->m_B.fill( TScalar( 0 ) );
+  this->m_H.fill( TScalar( 0 ) );
+
+  TScalar tOff = this->GetTimeOffset( );
+  for( unsigned int i = 0; i < this->m_MeasureSize; i++ )
+  {
+    this->m_A[ i ][ this->m_MeasureSize + i ] = tOff;
+    this->m_H[ i ][ i ] = TScalar( 1 );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+KalmanVelocityFilter( )
+  : Superclass( )
+{
+  this->Configure( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< typename T >
+cpExtensions::Algorithms::KalmanVelocityFilter< T >::
+~KalmanVelocityFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+// Explicit instantiations
+
+template class cpExtensions::Algorithms::KalmanVelocityFilter< float >;
+template class cpExtensions::Algorithms::KalmanVelocityFilter< double >;
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/KalmanVelocityFilter.h b/lib/cpExtensions/Algorithms/KalmanVelocityFilter.h
new file mode 100644 (file)
index 0000000..2055420
--- /dev/null
@@ -0,0 +1,66 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__KALMANVELOCITYFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__KALMANVELOCITYFILTER__H__
+
+#include <cpExtensions/Algorithms/KalmanFilter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< typename T >
+    class cpExtensions_EXPORT KalmanVelocityFilter
+      : public KalmanFilter< T >
+    {
+    public:
+      typedef KalmanVelocityFilter            Self;
+      typedef KalmanFilter< T >               Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef typename Superclass::TScalar TScalar;
+      typedef typename Superclass::TMatrix TMatrix;
+      typedef typename Superclass::TVector TVector;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( KalmanVelocityFilter, KalmanFilter );
+
+      kalmanGetSetMacro( TMatrix, Sigma );
+      kalmanGetSetMatrixMacro( Sigma, AccelerationNoise );
+
+    public:
+      void Configure( unsigned int m );
+
+      TScalar GetTimeOffset( ) const;
+      void SetTimeOffset( TScalar t );
+
+      /// Iteration methods
+        virtual void Initialize( );
+
+    protected:
+        KalmanVelocityFilter( );
+        virtual ~KalmanVelocityFilter( );
+
+    private:
+        // Purposely not implemented.
+        KalmanVelocityFilter( const Self& );
+        void operator=( const Self& );
+
+    protected:
+        TMatrix m_TimeOffset;
+        TMatrix m_Sigma;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__ALGORITHMS__KALMANVELOCITYFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/LightCompensationFilter.h b/lib/cpExtensions/Algorithms/LightCompensationFilter.h
new file mode 100644 (file)
index 0000000..a3c28ff
--- /dev/null
@@ -0,0 +1,65 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__H__
+
+#include <itkInPlaceImageFilter.h>
+#include <cpExtensions/Algorithms/ParallelImageMean.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I >
+    class LightCompensationFilter
+      : public itk::InPlaceImageFilter< I, I >
+    {
+    public:
+      typedef LightCompensationFilter         Self;
+      typedef itk::InPlaceImageFilter< I, I > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TImage;
+      typedef typename I::RegionType TRegion;
+
+      typedef cpExtensions::Algorithms::ParallelImageMean< I > TMeanCalculator;
+      typedef typename TMeanCalculator::TMean TMean;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( LightCompensationFilter, itkInPlaceImageFilter );
+
+      itkGetConstMacro( Mean, TMean );
+
+    protected:
+      LightCompensationFilter( );
+      virtual ~LightCompensationFilter( );
+
+    private:
+      virtual void BeforeThreadedGenerateData( );
+      virtual void ThreadedGenerateData(
+        const TRegion& region, itk::ThreadIdType id
+        );
+      virtual void AfterThreadedGenerateData( );
+
+    protected:
+      TMean m_Mean;
+      TMean m_Coefficient;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/LightCompensationFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/LightCompensationFilter.hxx b/lib/cpExtensions/Algorithms/LightCompensationFilter.hxx
new file mode 100644 (file)
index 0000000..f75ffcd
--- /dev/null
@@ -0,0 +1,96 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__HXX__
+
+#include <itkImageRegionIterator.h>
+#include <itkImageRegionConstIterator.h>
+#include <itkNumericTraits.h>
+
+// -------------------------------------------------------------------------
+template< class I >
+cpExtensions::Algorithms::LightCompensationFilter< I >::
+LightCompensationFilter( )
+  : Superclass( )
+{
+  this->SetNumberOfRequiredInputs( 1 );
+  this->InPlaceOff( );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+cpExtensions::Algorithms::LightCompensationFilter< I >::
+~LightCompensationFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+void cpExtensions::Algorithms::LightCompensationFilter< I >::
+BeforeThreadedGenerateData( )
+{
+  this->Superclass::BeforeThreadedGenerateData( );
+
+  I* input = const_cast< I* >( this->GetInput( ) );
+
+  typename TMeanCalculator::Pointer mc = TMeanCalculator::New( );
+  mc->Execute( input, input->GetRequestedRegion( ) );
+  this->m_Mean = mc->GetMean( );
+
+  double gm = this->m_Mean[ 0 ] + this->m_Mean[ 1 ] + this->m_Mean[ 2 ];
+  gm /= double( 3 );
+  this->m_Coefficient = this->m_Mean;
+  this->m_Coefficient.Fill( gm );
+  this->m_Coefficient[ 0 ] /= this->m_Mean[ 0 ];
+  this->m_Coefficient[ 1 ] /= this->m_Mean[ 1 ];
+  this->m_Coefficient[ 2 ] /= this->m_Mean[ 2 ];
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+void cpExtensions::Algorithms::LightCompensationFilter< I >::
+ThreadedGenerateData( const TRegion& region, itk::ThreadIdType id )
+{
+  typedef itk::NumericTraits< typename I::PixelType > _TPixelTraits;
+  typedef typename _TPixelTraits::ValueType           _TPixelChannel;
+  typedef itk::NumericTraits< _TPixelChannel >        _TChannelTraits;
+  static const double max_value = double( _TChannelTraits::max( ) );
+
+  itk::ImageRegionConstIterator< I > iIt( this->GetInput( ), region );
+  itk::ImageRegionIterator< I > oIt( this->GetOutput( ), region );
+
+  iIt.GoToBegin( );
+  oIt.GoToBegin( );
+  for( ; !iIt.IsAtEnd( ); ++iIt, ++oIt )
+  {
+    double r = double( iIt.Get( )[ 0 ] ) * this->m_Coefficient[ 0 ];
+    double g = double( iIt.Get( )[ 1 ] ) * this->m_Coefficient[ 1 ];
+    double b = double( iIt.Get( )[ 2 ] ) * this->m_Coefficient[ 2 ];
+
+    if( r > max_value ) r = max_value;
+    if( g > max_value ) g = max_value;
+    if( b > max_value ) b = max_value;
+
+    typename I::PixelType pix;
+    pix.SetRed( _TPixelChannel( r ) );
+    pix.SetGreen( _TPixelChannel( g ) );
+    pix.SetBlue( _TPixelChannel( b ) );
+
+    oIt.Set( pix );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+void cpExtensions::Algorithms::LightCompensationFilter< I >::
+AfterThreadedGenerateData( )
+{
+  this->Superclass::AfterThreadedGenerateData( );
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__LIGHTCOMPENSATIONFILTER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/MacheteImageFilter.h b/lib/cpExtensions/Algorithms/MacheteImageFilter.h
new file mode 100644 (file)
index 0000000..d9d3c32
--- /dev/null
@@ -0,0 +1,72 @@
+// -------------------------------------------------------------------------
+// @author Jose Luis Guzman (cycopepe@gmail.com)
+// -------------------------------------------------------------------------
+
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <itkImageToImageFilter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    template< class I, class O>
+    class MacheteImageFilter :public itk::ImageToImageFilter < I, O >
+    {
+    public:
+      /** Standard class typedefs. */
+      typedef MacheteImageFilter             Self;
+
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >        Pointer;
+
+      /** Method for creation through the object factory. */
+      itkNewMacro(Self);
+
+      /** Run-time type information (and related methods). */
+      itkTypeMacro(MacheteImageFilter, ImageToImageFilter);
+      
+      typedef typename I::PixelType           RadiusType;
+      //typedef typename I::SizeValueType      RadiusValueType;
+      
+      itkGetConstReferenceMacro(Radius, RadiusType);
+
+      
+      void SetRadius(const RadiusType & rad);
+      //void SetRadius(const RadiusValueType & rad);
+
+      void SetPoint(itk::Point<double, 3> & point);
+      void SetPoint(const double & x, const double & y, const double & z);
+
+    protected:
+      MacheteImageFilter(){}
+      ~MacheteImageFilter(){}
+
+      /** Does the real work. */
+      virtual void GenerateData();
+
+      RadiusType m_Radius;
+      itk::Point<double, 3> point;
+
+    private:
+      MacheteImageFilter(const Self &); //purposely not implemented
+      void operator=(const Self &);  //purposely not implemented
+
+     
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/MacheteImageFilter.hxx>
+#endif
+
+
+#endif // __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__H__
\ No newline at end of file
diff --git a/lib/cpExtensions/Algorithms/MacheteImageFilter.hxx b/lib/cpExtensions/Algorithms/MacheteImageFilter.hxx
new file mode 100644 (file)
index 0000000..a984df1
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__HXX__
+
+#include <cpExtensions/Algorithms/MacheteImageFilter.h>
+
+//filter stuff
+#include "itkObjectFactory.h"
+#include "itkImageRegionIterator.h"
+#include "itkImageRegionConstIterator.h"
+
+//typedef itk::Image<unsigned char, 2>  ImageType;
+
+template< class I, class O>
+void cpExtensions::Algorithms::MacheteImageFilter<  I, O>
+::GenerateData()
+{
+  //const typename Superclass::OutputImageRegionType& region;
+
+  typename I::ConstPointer input = this->GetInput();
+
+  typename O::Pointer output = this->GetOutput();
+  output->SetRegions(input->GetLargestPossibleRegion());
+  output->Allocate();
+
+  itk::ImageRegionIterator<O> outputIterator(output, output->GetLargestPossibleRegion());
+  itk::ImageRegionConstIterator<I> inputIterator(input, input->GetLargestPossibleRegion());
+
+  while (!outputIterator.IsAtEnd())
+  {
+    auto p0 = inputIterator.GetIndex();
+    itk::Point<double, 3> otherPoint;
+    otherPoint[0] = p0[0];
+    otherPoint[1] = p0[1];
+    otherPoint[2] = p0[2];
+    //otherPoint[2] = this->point[2]; // TODO : Solve this hammer
+
+    double dist = this->point.EuclideanDistanceTo(otherPoint);
+    if (dist <= this->m_Radius)
+    {
+      outputIterator.Set(0);
+    }
+    else
+    {
+      outputIterator.Set(inputIterator.Get());
+    }
+
+    ++inputIterator;
+    ++outputIterator;
+  }
+
+  
+}
+
+template< class I, class O>
+void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(const RadiusType & rad)
+{
+  if (this->m_Radius != rad)
+  {
+    this->m_Radius = rad;
+    this->Modified();
+  }
+}
+
+//template< class I, class O>
+//void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(const RadiusValueType & rad)
+//{
+//  RadiusType r;
+//  r.Fill(rad);
+//  this->SetRadius(r);
+//}
+
+template< class I, class O>
+void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(itk::Point<double, 3> & p){
+  if (point != p)
+  {
+    this->point = p;
+    this->Modified();
+  }
+}
+
+template< class I, class O>
+void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(const double & x, const double & y, const double & z)
+{
+  this->point[0] = x;
+  this->point[1] = y;
+  this->point[2] = z;
+  this->Modified();
+}
+
+
+
+#endif
\ No newline at end of file
diff --git a/lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h b/lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h
new file mode 100644 (file)
index 0000000..5dba45b
--- /dev/null
@@ -0,0 +1,102 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__H__
+
+#include <set>
+#include <itkImageToImageFilter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O >
+    class MultiScaleGaussianImageFilter
+      : public itk::ImageToImageFilter< I, O >
+    {
+    public:
+      typedef MultiScaleGaussianImageFilter   Self;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+
+      typedef std::set< double > TScalesContainer;
+
+      enum FilterId
+      {
+        Gradient = 0,
+        GradientMagnitude,
+        Hessian,
+        None
+      };
+
+    protected:
+      /**
+       */
+      class _Greater
+      {
+      public:
+        typedef typename O::PixelType _T;
+
+      public:
+        _Greater( );
+        virtual ~_Greater( );
+        bool operator!=( const _Greater& b ) const;
+        bool operator==( const _Greater& b ) const;
+        inline _T operator()( const _T& a ) const;
+        inline _T operator()( const _T& a, const _T& b ) const;
+      };
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( MultiScaleGaussianImageFilter, itkImageToImageFilter );
+
+    public:
+      void SetFilterToGradient( );
+      void SetFilterToGradientMagnitude( );
+      void SetFilterToHessian( );
+
+      bool IsGradientFilter( ) const;
+      bool IsGradientMagnitudeFilter( ) const;
+      bool IsHessianFilter( ) const;
+
+      void AddScale( const double& s );
+      unsigned long GetNumberOfScales( ) const;
+
+    protected:
+      MultiScaleGaussianImageFilter( );
+      virtual ~MultiScaleGaussianImageFilter( );
+
+      virtual void GenerateData( );
+
+      template< class F >
+      void _GenerateData( );
+
+    private:
+      // Purposely not implemented.
+      MultiScaleGaussianImageFilter( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      TScalesContainer m_Scales;
+      FilterId m_FilterId;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx b/lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx
new file mode 100644 (file)
index 0000000..c2e7cff
--- /dev/null
@@ -0,0 +1,315 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__HXX__
+
+#include <vnl/vnl_vector.h>
+
+#include <itkImageRegionIterator.h>
+#include <itkImageRegionConstIterator.h>
+#include <itkNumericTraits.h>
+#include <itkProgressAccumulator.h>
+
+#include <itkBinaryFunctorImageFilter.h>
+#include <itkUnaryFunctorImageFilter.h>
+#include <itkGradientMagnitudeRecursiveGaussianImageFilter.h>
+#include <itkGradientRecursiveGaussianImageFilter.h>
+#include <itkHessianRecursiveGaussianImageFilter.h>
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+_Greater( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+~_Greater( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+bool cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+operator!=( const _Greater& b ) const
+{
+  return( false );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+bool cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+operator==( const _Greater& b ) const
+{
+  return !( *this != b );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+typename cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+_T cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+operator()( const _T& a ) const
+{
+  return( a );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+typename cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+_T cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::_Greater::
+operator()( const _T& a, const _T& b ) const
+{
+  typedef itk::NumericTraits< _T >     _TTraits;
+  typedef typename _TTraits::ValueType _TValue;
+  typedef vnl_vector< _TValue >        _TVector;
+
+  _TVector va( _TTraits::GetLength( ) );
+  _TVector vb( _TTraits::GetLength( ) );
+
+  _TTraits::AssignToArray( a, va );
+  _TTraits::AssignToArray( b, vb );
+  return( ( vb.magnitude( ) < va.magnitude( ) )? a: b );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+SetFilterToGradient( )
+{
+  if(
+    itk::NumericTraits< typename O::PixelType >::GetLength( ) ==
+    I::ImageDimension
+    )
+    this->m_FilterId = Self::Gradient;
+  else
+    this->m_FilterId = Self::None;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+SetFilterToGradientMagnitude( )
+{
+  if( itk::NumericTraits< typename O::PixelType >::GetLength( ) == 1 )
+    this->m_FilterId = Self::GradientMagnitude;
+  else
+    this->m_FilterId = Self::None;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+SetFilterToHessian( )
+{
+  itkExceptionMacro( << "Check for hessian definition." );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+bool
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+IsGradientFilter( ) const
+{
+  return( this->m_FilterId == Self::Gradient );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+bool
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+IsGradientMagnitudeFilter( ) const
+{
+  return( this->m_FilterId == Self::GradientMagnitude );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+bool
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+IsHessianFilter( ) const
+{
+  return( this->m_FilterId == Self::Hessian );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+AddScale( const double& s )
+{
+  if( this->m_Scales.insert( s ).second )
+    this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+unsigned long
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+GetNumberOfScales( ) const
+{
+  return( this->m_Scales.size( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+MultiScaleGaussianImageFilter( )
+  : Superclass( )
+{
+  this->SetFilterToGradientMagnitude( );
+  if( !this->IsGradientMagnitudeFilter( ) )
+  {
+    this->SetFilterToGradient( );
+    if( !this->IsGradientFilter( ) )
+      this->SetFilterToHessian( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+~MultiScaleGaussianImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+GenerateData( )
+{
+  typedef itk::GradientRecursiveGaussianImageFilter< I, O >          _TGF;
+  typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< I, O > _TGMF;
+  typedef itk::HessianRecursiveGaussianImageFilter< I, O >           _THF;
+
+  if( this->IsGradientFilter( ) )
+    this->_GenerateData< _TGF >( );
+  else if( this->IsGradientMagnitudeFilter( ) )
+    this->_GenerateData< _TGMF >( );
+  else if( this->IsHessianFilter( ) )
+    this->_GenerateData< _THF >( );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+template< class F >
+void
+cpExtensions::Algorithms::
+MultiScaleGaussianImageFilter< I, O >::
+_GenerateData( )
+{
+  // Some types
+  typedef itk::BinaryFunctorImageFilter< O, O, O, _Greater > _TMaxFilter;
+  typedef itk::UnaryFunctorImageFilter< O, O, _Greater >     _TCopyFilter;
+  typedef itk::ImageRegionConstIterator< O >                 _TConstIt;
+  typedef itk::ImageRegionIterator< O >                      _TIt;
+  typedef itk::ProgressAccumulator                           _TProgress;
+
+  // Some values
+  typename I::ConstPointer input = this->GetInput( );
+  typename O::Pointer output = this->GetOutput( );
+  unsigned int nThreads = this->GetNumberOfThreads( );
+  float fw = float( 1 ) / float( this->m_Scales.size( ) << 1 );
+
+  // Progress accumulator
+  _TProgress::Pointer pg = _TProgress::New( );
+  pg->SetMiniPipelineFilter( this );
+
+  // Copy image information
+  output->SetLargestPossibleRegion( input->GetLargestPossibleRegion( ) );
+  output->SetRequestedRegion( input->GetRequestedRegion( ) );
+  output->SetBufferedRegion( input->GetBufferedRegion( ) );
+  output->SetSpacing( input->GetSpacing( ) );
+  output->SetOrigin( input->GetOrigin( ) );
+  output->SetDirection( input->GetDirection( ) );
+  output->Allocate( );
+
+  // Intermediary buffer
+  typename O::Pointer buffer = O::New( );
+  buffer->SetLargestPossibleRegion( input->GetLargestPossibleRegion( ) );
+  buffer->SetRequestedRegion( input->GetRequestedRegion( ) );
+  buffer->SetBufferedRegion( input->GetBufferedRegion( ) );
+  buffer->SetSpacing( input->GetSpacing( ) );
+  buffer->SetOrigin( input->GetOrigin( ) );
+  buffer->SetDirection( input->GetDirection( ) );
+  buffer->Allocate( );
+
+  // Perform all scales
+  _TIt gIt( output, output->GetRequestedRegion( ) );
+  TScalesContainer::const_iterator sIt = this->m_Scales.begin( );
+  for( ; sIt != this->m_Scales.end( ); sIt++ )
+  {
+    // Single scale filter
+    typename F::Pointer filter = F::New( );
+    filter->SetInput( input );
+    filter->SetNormalizeAcrossScale( true );
+    filter->SetNumberOfThreads( nThreads );
+    filter->SetSigma( *sIt );
+    pg->RegisterInternalFilter( filter, fw );
+    filter->GraftOutput( buffer );
+    filter->Update( );
+    buffer->Graft( filter->GetOutput( ) );
+
+    // Get maximum response
+    if( sIt == this->m_Scales.begin( ) )
+    {
+      // Copy first result
+      typename _TCopyFilter::Pointer copy = _TCopyFilter::New( );
+      copy->SetInput( buffer );
+      copy->InPlaceOff( );
+      copy->SetNumberOfThreads( nThreads );
+      pg->RegisterInternalFilter( copy, fw );
+      copy->GraftOutput( output );
+      copy->Update( );
+      output->Graft( copy->GetOutput( ) );
+    }
+    else
+    {
+      // Maximize results
+      typename _TMaxFilter::Pointer max = _TMaxFilter::New( );
+      max->SetInput1( output );
+      max->SetInput2( buffer );
+      max->InPlaceOn( );
+      max->SetNumberOfThreads( nThreads );
+      pg->RegisterInternalFilter( max, fw );
+      max->GraftOutput( output );
+      max->Update( );
+      output->Graft( max->GetOutput( ) );
+
+    } // fi
+
+  } // rof
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__MULTISCALEGAUSSIANIMAGEFILTER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/ParallelImageMean.h b/lib/cpExtensions/Algorithms/ParallelImageMean.h
new file mode 100644 (file)
index 0000000..6122ce3
--- /dev/null
@@ -0,0 +1,70 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__H__
+#define __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__H__
+
+#include <itkDomainThreader.h>
+#include <itkThreadedImageRegionPartitioner.h>
+#include <itkArray.h>
+#include <itkNumericTraits.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I >
+    class ParallelImageMean
+      : public itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I >
+    {
+    public:
+      // Standard ITK typedefs.
+      typedef itk::DomainThreader< itk::ThreadedImageRegionPartitioner< I::ImageDimension >, I > Superclass;
+      typedef ParallelImageMean               Self;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef typename Superclass::DomainType DomainType;
+
+      typedef itk::Array< double > TMean;
+
+    protected:
+      typedef itk::NumericTraits< typename I::PixelType > _TPixelTraits;
+
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( ParallelImageMean, itkDomainThreader );
+
+      itkGetConstMacro( Mean, TMean );
+
+    protected:
+      ParallelImageMean( );
+      virtual ~ParallelImageMean( );
+
+    private:
+      virtual void BeforeThreadedExecution( );
+      virtual void ThreadedExecution(
+        const DomainType& region, const itk::ThreadIdType id
+        );
+      virtual void AfterThreadedExecution( );
+
+    protected:
+      itk::Array< double > m_Mean;
+      unsigned long m_N;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/ParallelImageMean.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/ParallelImageMean.hxx b/lib/cpExtensions/Algorithms/ParallelImageMean.hxx
new file mode 100644 (file)
index 0000000..b3e4716
--- /dev/null
@@ -0,0 +1,65 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__HXX__
+
+#include <itkImageRegionConstIterator.h>
+
+// -------------------------------------------------------------------------
+template< class I >
+cpExtensions::Algorithms::ParallelImageMean< I >::
+ParallelImageMean( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+cpExtensions::Algorithms::ParallelImageMean< I >::
+~ParallelImageMean( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+void cpExtensions::Algorithms::ParallelImageMean< I >::
+BeforeThreadedExecution( )
+{
+  this->m_Mean.SetSize( _TPixelTraits::GetLength( ) );
+  this->m_Mean.Fill( double( 0 ) );
+  this->m_N = 0;
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+void cpExtensions::Algorithms::ParallelImageMean< I >::
+ThreadedExecution( const DomainType& region, const itk::ThreadIdType id )
+{
+  itk::ImageRegionConstIterator< I > i( this->m_Associate, region );
+  for( i.GoToBegin( ); !i.IsAtEnd( ); ++i )
+  {
+    for( unsigned int d = 0; d < _TPixelTraits::GetLength( ); ++d )
+    {
+      this->m_Mean.SetElement(
+        d, this->m_Mean.GetElement( d ) + double( i.Get( )[ d ] )
+        );
+      this->m_N++;
+
+    } // rof
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+void cpExtensions::Algorithms::ParallelImageMean< I >::
+AfterThreadedExecution( )
+{
+  this->m_Mean /= double( this->m_N );
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__PARALLELIMAGEMEAN__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/RGBExtractFunction.h b/lib/cpExtensions/Algorithms/RGBExtractFunction.h
new file mode 100644 (file)
index 0000000..ec7126b
--- /dev/null
@@ -0,0 +1,54 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__RGBEXTRACTFUNCTION__H__
+#define __CPEXTENSIONS__ALGORITHMS__RGBEXTRACTFUNCTION__H__
+
+#include <cmath>
+#include <limits>
+#include <vnl/vnl_math.h>
+
+#include <itkRGBPixel.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class P >
+    struct RGBExtractFunction
+    {
+      typedef RGBExtractFunction    Self;
+      typedef P                     TOutPixel;
+      typedef typename P::ValueType TValue;
+
+      template< class Tr, class Tg, class Tb >
+      P operator()( const Tr& r, const Tg& g, const Tb& b ) const
+        {
+          P out;
+          out[ 0 ] = TValue( r );
+          out[ 1 ] = TValue( g );
+          out[ 2 ] = TValue( b );
+          return( out );
+        }
+
+      template< class C >
+      TOutPixel operator()( const itk::RGBPixel< C >& rgb ) const
+        {
+          return(
+            this->operator()(
+              rgb.GetRed( ), rgb.GetGreen( ), rgb.GetBlue( )
+              )
+            );
+        }
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__ALGORITHMS__RGBEXTRACTFUNCTION__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h b/lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h
new file mode 100644 (file)
index 0000000..4ce6754
--- /dev/null
@@ -0,0 +1,67 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
+
+#include <itkImageToImageFilter.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O, class C >
+    class RGBImageToOtherChannelsFilter
+      : public itk::ImageToImageFilter< I, O >
+    {
+    public:
+      typedef RGBImageToOtherChannelsFilter     Self;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+      typedef C TConverter;
+      typedef typename I::PixelType TInputPixel;
+      typedef typename O::PixelType TOutputPixel;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( RGBImageToOtherChannelsFilter, itkImageToImageFilter );
+
+    protected:
+      RGBImageToOtherChannelsFilter( );
+      virtual ~RGBImageToOtherChannelsFilter( );
+
+      virtual void BeforeThreadedGenerateData( );
+      virtual void AfterThreadedGenerateData( );
+
+      virtual void ThreadedGenerateData(
+        const typename Superclass::OutputImageRegionType& region,
+        itk::ThreadIdType threadId
+        );
+
+    private:
+      // Purposely not implemented
+      RGBImageToOtherChannelsFilter( const Self& other );
+      void operator=( const Self& other );
+
+    private:
+      TConverter Converter;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.hxx b/lib/cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.hxx
new file mode 100644 (file)
index 0000000..74578d4
--- /dev/null
@@ -0,0 +1,71 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__HXX__
+
+#include <cmath>
+#include <limits>
+#include <vnl/vnl_math.h>
+
+#include <itkImageRegionIterator.h>
+#include <itkImageRegionConstIterator.h>
+
+// -------------------------------------------------------------------------
+template< class I, class O, class C >
+cpExtensions::Algorithms::RGBImageToOtherChannelsFilter< I, O, C >::
+RGBImageToOtherChannelsFilter( )
+  : Superclass( )
+{
+  this->SetNumberOfRequiredInputs( 1 );
+  this->SetNumberOfRequiredOutputs( 1 );
+
+  typename O::Pointer o = O::New( );
+  this->SetNthOutput( 0, o );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O, class C >
+cpExtensions::Algorithms::RGBImageToOtherChannelsFilter< I, O, C >::
+~RGBImageToOtherChannelsFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O, class C >
+void cpExtensions::Algorithms::RGBImageToOtherChannelsFilter< I, O, C >::
+BeforeThreadedGenerateData( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O, class C >
+void cpExtensions::Algorithms::RGBImageToOtherChannelsFilter< I, O, C >::
+AfterThreadedGenerateData( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O, class C >
+void cpExtensions::Algorithms::RGBImageToOtherChannelsFilter< I, O, C >::
+ThreadedGenerateData(
+  const typename Superclass::OutputImageRegionType& region,
+  itk::ThreadIdType threadId
+  )
+{
+  // typedef typename TInputPixel::ComponentType _TComponent;
+  typedef itk::ImageRegionConstIterator< I > _TInIt;
+  typedef itk::ImageRegionIterator< O >      _TOutIt;
+
+  _TInIt inIt( this->GetInput( ), region );
+  _TOutIt outIt( this->GetOutput( ), region );
+  inIt.GoToBegin( );
+  outIt.GoToBegin( );
+  for( ; !inIt.IsAtEnd( ); ++inIt, ++outIt )
+    outIt.Set( this->Converter( inIt.Get( ) ) );
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__RGBIMAGETOOTHERCHANNELSFILTER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/RGBToHSVFunction.h b/lib/cpExtensions/Algorithms/RGBToHSVFunction.h
new file mode 100644 (file)
index 0000000..b10f295
--- /dev/null
@@ -0,0 +1,87 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__RGBTOHSVFUNCTION__H__
+#define __CPEXTENSIONS__ALGORITHMS__RGBTOHSVFUNCTION__H__
+
+#include <cmath>
+#include <limits>
+#include <vnl/vnl_math.h>
+
+#include <itkRGBPixel.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class P >
+    struct RGBToHSVFunction
+    {
+      typedef RGBToHSVFunction      Self;
+      typedef P                     TOutPixel;
+      typedef typename P::ValueType TValue;
+
+      template< class Tr, class Tg, class Tb >
+      P operator()( const Tr& r, const Tg& g, const Tb& b ) const
+        {
+          static const double mVal =
+            double( std::numeric_limits< TValue >::max( ) );
+          static const double _0 = double( 0 );
+          static const double _1 = double( 1 );
+          static const double _2 = double( 2 );
+          static const double _3 = double( 3 );
+          static const double _2pi = _2 * double( vnl_math::pi );
+
+          P hsv;
+
+          double R = double( r );
+          double G = double( g );
+          double B = double( b );
+          double sRGB = R + G + B;
+          double RG = R - G;
+          double RB = R - B;
+          double GB = G - B;
+
+          // Hue
+          double A = std::sqrt( ( RG * RG ) + ( RB * GB ) );
+          if( A != _0 )
+            A = std::acos( ( RG + RB ) / ( _2 * A ) );
+          A /= _2pi;
+          hsv[ 0 ] = TValue( mVal * ( ( G >= B )? A: _1 - A ) );
+
+          // Saturation
+          if( sRGB != _0 )
+          {
+            double C = ( G < R )? G: R;
+            C        = ( B < C )? B: C;
+            hsv[ 1 ] = TValue( mVal * ( _1 - ( ( _3 * C ) / sRGB ) ) );
+          }
+          else
+            hsv[ 1 ] = TValue( 0 );
+
+          // Value
+          hsv[ 2 ] = TValue( sRGB / _3 );
+          return( hsv );
+        }
+
+      template< class C >
+      TOutPixel operator()( const itk::RGBPixel< C >& rgb ) const
+        {
+          return(
+            this->operator()(
+              rgb.GetRed( ), rgb.GetGreen( ), rgb.GetBlue( )
+              )
+            );
+        }
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__ALGORITHMS__RGBTOHSVFUNCTION__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/RGBToYPbPrFunction.h b/lib/cpExtensions/Algorithms/RGBToYPbPrFunction.h
new file mode 100644 (file)
index 0000000..83085fe
--- /dev/null
@@ -0,0 +1,72 @@
+// -------------------------------------------------------------------------
+// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+// -------------------------------------------------------------------------
+
+#ifndef __CPEXTENSIONS__ALGORITHMS__RGBTOYPBPRFUNCTION__H__
+#define __CPEXTENSIONS__ALGORITHMS__RGBTOYPBPRFUNCTION__H__
+
+#include <cmath>
+#include <limits>
+#include <vnl/vnl_math.h>
+#include <vnl/vnl_matrix.h>
+
+#include <itkRGBPixel.h>
+#include <itkMatrix.h>
+#include <itkVector.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class P >
+    struct RGBToYPbPrFunction
+    {
+      typedef RGBToYPbPrFunction    Self;
+      typedef P                     TOutPixel;
+      typedef typename P::ValueType TValue;
+
+      template< class Tr, class Tg, class Tb >
+      P operator()( const Tr& r, const Tg& g, const Tb& b ) const
+        {
+          static const double M[] =
+            {
+              double(  0.2990 ), double(  0.5870 ), double(  0.1140 ),
+              double( -0.1687 ), double( -0.3313 ), double(  0.5000 ),
+              double(  0.5000 ), double( -0.4187 ), double( -0.0813 )
+            };
+          static const vnl_matrix< double > vM( M, 3, 3 );
+          static const itk::Matrix< double, 3, 3 > iM( vM );
+
+          itk::Vector< double, 3 > rgb;
+          rgb[ 0 ] = double( r );
+          rgb[ 1 ] = double( b );
+          rgb[ 2 ] = double( g );
+          rgb = iM * rgb;
+
+          P out;
+          out[ 0 ] = TValue( rgb[ 0 ] );
+          out[ 1 ] = TValue( rgb[ 1 ] );
+          out[ 2 ] = TValue( rgb[ 2 ] );
+          return( out );
+        }
+
+      template< class C >
+      TOutPixel operator()( const itk::RGBPixel< C >& rgb ) const
+        {
+          return(
+            this->operator()(
+              rgb.GetRed( ), rgb.GetGreen( ), rgb.GetBlue( )
+              )
+            );
+        }
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__ALGORITHMS__RGBTOYPBPRFUNCTION__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h b/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h
new file mode 100644 (file)
index 0000000..2b81fb7
--- /dev/null
@@ -0,0 +1,87 @@
+#ifndef __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
+
+#include <itkConceptChecking.h>
+#include <itkImageToImageFilter.h>
+#include <itkSpatialObject.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O = I >
+    class SpatialObjectMaskImageFilter
+      : public itk::ImageToImageFilter< I, O >
+    {
+    public:
+      typedef SpatialObjectMaskImageFilter    Self;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+
+      itkStaticConstMacro( InputDimension, unsigned int, I::ImageDimension );
+      itkStaticConstMacro( OutputDimension, unsigned int, O::ImageDimension );
+
+#ifdef ITK_USE_CONCEPT_CHECKING
+      itkConceptMacro(
+        SameDimensionCheck1,
+        ( itk::Concept::SameDimension< InputDimension, OutputDimension > )
+        );
+#endif
+
+      typedef typename I::RegionType TRegion;
+      typedef typename O::PixelType  TOutPixel;
+      typedef itk::SpatialObject< InputDimension > TSpatialObject;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( SpatialObjectMaskImageFilter, itk::ImageToImageFilter );
+
+      itkGetObjectMacro( SpatialObject, TSpatialObject );
+      itkGetConstObjectMacro( SpatialObject, TSpatialObject );
+      itkGetConstMacro( OutsideValue, TOutPixel );
+
+      itkSetObjectMacro( SpatialObject, TSpatialObject );
+      itkSetMacro( OutsideValue, TOutPixel );
+
+    public:
+      O* GetPositiveOutput( );
+      const O* GetPositiveOutput( ) const;
+      O* GetNegativeOutput( );
+      const O* GetNegativeOutput( ) const;
+
+    protected:
+      SpatialObjectMaskImageFilter( );
+      virtual ~SpatialObjectMaskImageFilter( );
+
+      virtual void GenerateOutputInformation( );
+      virtual void ThreadedGenerateData(
+        const TRegion& region, itk::ThreadIdType threadId
+        );
+
+    private:
+      // Purposely not implemented.
+      SpatialObjectMaskImageFilter( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      typename TSpatialObject::Pointer m_SpatialObject;
+      TOutPixel m_OutsideValue;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx b/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx
new file mode 100644 (file)
index 0000000..2c3cac7
--- /dev/null
@@ -0,0 +1,136 @@
+#ifndef __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__HXX__
+
+#include <itkImageScanlineIterator.h>
+#include <itkProgressReporter.h>
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+O* cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+GetPositiveOutput( )
+{
+  return( this->GetOutput( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+const O* cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+GetPositiveOutput( ) const
+{
+  return( this->GetOutput( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+O* cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+GetNegativeOutput( )
+{
+  return( this->GetOutput( 1 ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+const O* cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+GetNegativeOutput( ) const
+{
+  return( this->GetOutput( 1 ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+SpatialObjectMaskImageFilter( )
+  : Superclass( )
+{
+  this->SetNumberOfRequiredInputs( 1 );
+  this->SetNumberOfRequiredOutputs( 2 );
+  this->SetNthOutput( 0, O::New( ) );
+  this->SetNthOutput( 1, O::New( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+~SpatialObjectMaskImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+GenerateOutputInformation( )
+{
+  const I* in =
+    dynamic_cast< const I* >( this->itk::ProcessObject::GetInput( 0 ) );
+  for( unsigned int idx = 0; idx < this->GetNumberOfOutputs( ); ++idx )
+  {
+    itk::DataObject* out = this->GetOutput( idx );
+    if( out )
+      out->CopyInformation( in );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId )
+{
+  if( this->m_SpatialObject.IsNull( ) )
+  {
+    itkGenericExceptionMacro( << "No itk::SpatialObject given." );
+    return;
+
+  } // fi
+
+  // Get inputs
+  const I* in =
+    dynamic_cast< const I* >( this->itk::ProcessObject::GetInput( 0 ) );
+  O* pos_out = this->GetPositiveOutput( );
+  O* neg_out = this->GetNegativeOutput( );
+  const auto size0 = region.GetSize( 0 );
+  if( size0 == 0 )
+    return;
+  const auto nLines = region.GetNumberOfPixels( ) / size0;
+
+  // Create iterators
+  itk::ImageScanlineConstIterator< I > iIt( in, region );
+  itk::ImageScanlineIterator< O > pos_oIt( pos_out, region );
+  itk::ImageScanlineIterator< O > neg_oIt( neg_out, region );
+  itk::ProgressReporter progress( this, threadId, nLines );
+
+  // Main loop
+  typename TSpatialObject::PointType pnt;
+  while( !iIt.IsAtEnd( ) )
+  {
+    while( !iIt.IsAtEndOfLine( ) )
+    {
+      auto idx = iIt.GetIndex( );
+      in->TransformIndexToPhysicalPoint( idx, pnt );
+      if( this->m_SpatialObject->IsInside( pnt ) )
+      {
+        pos_oIt.Set( TOutPixel( iIt.Get( ) ) );
+        neg_oIt.Set( this->m_OutsideValue );
+      }
+      else
+      {
+        neg_oIt.Set( TOutPixel( iIt.Get( ) ) );
+        pos_oIt.Set( this->m_OutsideValue );
+
+      } // fi
+      ++iIt;
+      ++pos_oIt;
+      ++neg_oIt;
+
+    } // elihw
+    iIt.NextLine( );
+    pos_oIt.NextLine( );
+    neg_oIt.NextLine( );
+    progress.CompletedPixel( );
+
+  } // elihw
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/CMakeLists.txt b/lib/cpExtensions/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c2abf2c
--- /dev/null
@@ -0,0 +1,133 @@
+SET(LIBRARY_NAME cpExtensions)
+
+CONFIGURE_FILE(
+  Config.h.in
+  ${PROJECT_BINARY_DIR}/lib/cpExtensions/Config.h
+  @ONLY
+  )
+
+## ===============
+## = Source code =
+## ===============
+
+SET(LIB_HEADERS_H   "")
+SET(LIB_HEADERS_HPP "")
+SET(LIB_HEADERS_HXX "")
+SET(LIB_SOURCES_C   "")
+SET(LIB_SOURCES_CPP "")
+SET(LIB_SOURCES_CXX "")
+
+SET(
+  lib_DIRECTORIES
+  .
+  DataStructures
+  Algorithms
+  IO
+  Interaction
+  Visualization
+  )
+FOREACH(dir ${lib_DIRECTORIES})
+  FILE(GLOB dir_LIB_HEADERS_H   "${dir}/*.h")
+  FILE(GLOB dir_LIB_HEADERS_HPP "${dir}/*.hpp")
+  FILE(GLOB dir_LIB_HEADERS_HXX "${dir}/*.hxx")
+  FILE(GLOB dir_LIB_SOURCES_C   "${dir}/*.c")
+  FILE(GLOB dir_LIB_SOURCES_CPP "${dir}/*.cpp")
+  FILE(GLOB dir_LIB_SOURCES_CXX "${dir}/*.cxx")
+
+  SET(LIB_HEADERS_H   "${LIB_HEADERS_H};${dir_LIB_HEADERS_H}")
+  SET(LIB_HEADERS_HPP "${LIB_HEADERS_HPP};${dir_LIB_HEADERS_HPP}")
+  SET(LIB_HEADERS_HXX "${LIB_HEADERS_HXX};${dir_LIB_HEADERS_HXX}")
+  SET(LIB_SOURCES_C   "${LIB_SOURCES_C};${dir_LIB_SOURCES_C}")
+  SET(LIB_SOURCES_CPP "${LIB_SOURCES_CPP};${dir_LIB_SOURCES_CPP}")
+  SET(LIB_SOURCES_CXX "${LIB_SOURCES_CXX};${dir_LIB_SOURCES_CXX}")
+
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+ENDFOREACH(dir)
+
+IF(USE_QT4)
+  FILE(GLOB LIB_QT_UI "QT/*.ui")
+  FILE(GLOB LIB_QT_Headers "QT/*.h")
+  FILE(GLOB LIB_QT_Sources "QT/*.cxx")
+  FILE(GLOB LIB_QT_Resources "QT/*.rc")
+
+  QT4_WRAP_UI(LIB_QT_Wrapped_Headers ${LIB_QT_UI})
+  QT4_WRAP_CPP(LIB_QT_Wrapped_MOC_Sources ${LIB_QT_Headers})
+  QT4_ADD_RESOURCES(LIB_QT_Wrapped_Resources_Sources ${LIB_QT_Resources})
+
+  SET(
+    LIB_HEADERS_H
+    ${LIB_HEADERS_H}
+    ${LIB_QT_Wrapped_Headers}
+    )
+  SET(
+    LIB_SOURCES_CXX
+    ${LIB_SOURCES_CXX}
+    ${LIB_QT_Sources}
+    ${LIB_QT_Wrapped_Headers}
+    ${LIB_QT_Wrapped_MOC_Sources}
+    ${LIB_QT_Wrapped_Resources_Sources}
+    )
+ENDIF(USE_QT4)
+
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_LIBRARY(
+  ${LIBRARY_NAME}
+  SHARED
+  ${LIB_SOURCES_C}
+  ${LIB_SOURCES_CPP}
+  ${LIB_SOURCES_CXX}
+  )
+SET_TARGET_PROPERTIES(
+  ${LIBRARY_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${LIBRARY_NAME}
+  BASE_NAME ${LIBRARY_NAME}
+  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpExtensions/${LIBRARY_NAME}_Export.h
+  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(
+  ${LIBRARY_NAME}
+  ${QT_LIBRARIES}
+  ${ITK_LIBRARIES}
+  ${VTK_LIBRARIES}
+  )
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+INSTALL(
+  FILES
+  ${PROJECT_BINARY_DIR}/lib/cpExtensions/${LIBRARY_NAME}_Export.h
+  DESTINATION include/cpExtensions
+  )
+
+## eof - $RCSfile$
diff --git a/lib/cpExtensions/Config.h.in b/lib/cpExtensions/Config.h.in
new file mode 100644 (file)
index 0000000..dbf80e9
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __CPEXTENSIONS__CONFIG__H__
+#define __CPEXTENSIONS__CONFIG__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#define cpExtensions_MAJ_VER @prj_MAJ_VER@
+#define cpExtensions_MIN_VER @prj_MIN_VER@
+#define cpExtensions_REL_VER @prj_VER@
+#define cpExtensions_VER     "@prj_sVER@"
+
+#define cpExtensions_QT4_USED @QT4_FOUND@
+#if cpExtensions_QT4_USED == 1
+#  define cpExtensions_QT4
+#else // cpExtensions_QT4_USED == 1
+#  undef cpExtensions_QT4
+#endif // cpExtensions_QT4_USED == 1
+
+#endif // __CPEXTENSIONS__CONFIG__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/Graph.h b/lib/cpExtensions/DataStructures/Graph.h
new file mode 100644 (file)
index 0000000..75bdd68
--- /dev/null
@@ -0,0 +1,166 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__GRAPH__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__GRAPH__H__
+
+#include <map>
+#include <set>
+#include <vector>
+#include <itkLightObject.h>
+#include <itkObjectFactory.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /** \brief A generic graph with templated index types.
+     *
+     *  @param V Vertex type.
+     *  @param C Cost type.
+     *  @param I Index type (it should be a strict weak ordering type).
+     */
+    template< class V, class C, class I = unsigned long >
+    class Graph
+      : public itk::LightObject
+    {
+    public:
+      typedef Graph                           Self;
+      typedef itk::LightObject                Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef V TVertex;
+      typedef C TCost;
+      typedef I TIndex;
+
+      // Base types
+      typedef std::map< TIndex, TVertex >    TVertices;
+      typedef std::vector< TCost >           TEdges;
+      typedef std::map< TIndex, TEdges >     TMatrixRow;
+      typedef std::map< TIndex, TMatrixRow > TMatrix;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( Graph, itk::LightObject );
+
+    public:
+      /*! \brief Iterators over vertices.
+       *         These allow you to iterate over all of graph's vertices.
+       *
+       * Typical iteration should be done as:
+       *
+       *  TGraph g;
+       *  ...
+       *  TGraph::TVertices::[const_]iterator vIt = g.BeginVertices( );
+       *  for( ; vIt != g.EndVertices( ); ++vIt )
+       *  {
+       *    vIt->first;  --> this is the vertex's index <--
+       *    vIt->second; --> this is the vertex's value <--
+       *  }
+       */
+      inline typename TVertices::iterator BeginVertices( )
+        { return( this->m_Vertices.begin( ) ); }
+      inline typename TVertices::iterator EndVertices( )
+        { return( this->m_Vertices.end( ) ); }
+      inline typename TVertices::const_iterator BeginVertices( ) const
+        { return( this->m_Vertices.begin( ) ); }
+      inline typename TVertices::const_iterator EndVertices( ) const
+        { return( this->m_Vertices.end( ) ); }
+
+      /*! \brief Iterators over edges.
+       *         These allow you to iterate over all of graph's edges.
+       *
+       * Typical iteration should be done as:
+       *
+       *  TGraph g;
+       *  ...
+       *  TGraph::TMatrix::[const_]iterator mIt = g.BeginEdgesRows( );
+       *  for( ; mIt != g.EndEdgesRows( ); ++mIt )
+       *  {
+       *    mIt->first; --> this is the row index. <--
+       *    TGraph::TMatrixRow::[const_]iterator rIt = mIt->second.begin( );
+       *    for( ; rIt != mIt->second.end( ); ++rIt )
+       *    {
+       *      rIt->first;  --> this is the column index.
+       *      TGraph::TEdges::[const_]iterator eIt = rIt->second.begin( );
+       *      for( ; eIt != rIt->second.end( ); ++eIt )
+       *        *eIt; --> this is the cost between mIt->first and rIt->first
+       *    }
+       *  }
+       */
+      inline typename TMatrix::iterator BeginEdgesRows( )
+        { return( this->m_Matrix.begin( ) ); }
+      inline typename TMatrix::iterator EndEdgetsRows( )
+        { return( this->m_Matrix.end( ) ); }
+      inline typename TMatrix::const_iterator BeginEdgesRows( ) const
+        { return( this->m_Matrix.begin( ) ); }
+      inline typename TMatrix::const_iterator EndEdgesRows( ) const
+        { return( this->m_Matrix.end( ) ); }
+
+      /*! \brief Clear all vertices and edges.
+       */
+      void Clear( );
+
+      /*! \brief Clear all edges.
+       */
+      inline void ClearEdges( )
+        { this->m_Matrix.clear( ); }
+
+      /*! \brief Vertex manipulation methods.
+       *         Names are self-explanatory.
+       */
+      inline bool HasVertexIndex( const I& i ) const
+        { return( this->m_Vertices.find( i ) != this->m_Vertices.end( ) ); }
+      inline void SetVertex( const I& index, V& vertex )
+        { this->m_Vertices[ index ] = vertex; }
+      inline V& GetVertex( const I& index )
+        { return( this->m_Vertices[ index ] ); }
+      inline const V& GetVertex( const I& index ) const
+        { return( this->m_Vertices[ index ] ); }
+      bool RenameVertex( const I& old_index, const I& new_index );
+      void RemoveVertex( const I& index );
+
+      /*! \brief Edge manipulation methods.
+       *         Names are self-explanatory.
+       */
+      inline void AddEdge( const I& orig, const I& dest, const C& cost )
+        { this->m_Matrix[ orig ][ dest ].push_back( cost ); }
+      inline TEdges& GetEdges( const I& orig, const I& dest )
+        { return( this->m_Matrix[ orig ][ dest ] ); }
+      inline const TEdges& GetEdges( const I& orig, const I& dest ) const
+        { return( this->m_Matrix[ orig ][ dest ] ); }
+      bool HasEdge( const I& orig, const I& dest ) const;
+      void RemoveEdge( const I& orig, const I& dest, const C& cost );
+      void RemoveEdges( const I& orig, const I& dest );
+
+      /*! \brief Returns graph's sinks.
+       *
+       *  A sink is a special vertex which does not have any "exiting" edges.
+       *
+       *  @return Sinks ordered by their index.
+       */
+      std::set< I > GetSinks( ) const;
+
+    protected:
+      Graph( );
+      virtual ~Graph( );
+
+    private:
+      // Purposely not implemented
+      Graph( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      TVertices m_Vertices;
+      TMatrix   m_Matrix;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/Graph.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__GRAPH__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/Graph.hxx b/lib/cpExtensions/DataStructures/Graph.hxx
new file mode 100644 (file)
index 0000000..d2d2d23
--- /dev/null
@@ -0,0 +1,208 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+void cpExtensions::DataStructures::Graph< V, C, I >::
+Clear( )
+{
+  this->m_Vertices.clear( );
+  this->m_Matrix.clear( );
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+bool cpExtensions::DataStructures::Graph< V, C, I >::
+RenameVertex( const I& old_index, const I& new_index )
+{
+  auto old_v = this->m_Vertices.find( old_index );
+  auto new_v = this->m_Vertices.find( new_index );
+  if( old_v != this->m_Vertices.end( ) && new_v == this->m_Vertices.end( ) )
+  {
+    // Replace vertex
+    this->m_Vertices[ new_index ] = old_v->second;
+    this->m_Vertices.erase( old_index );
+
+    // Duplicate edges
+    auto mIt = this->m_Matrix.begin( );
+    auto found_row = this->m_Matrix.end( );
+    for( ; mIt != this->m_Matrix.end( ); ++mIt )
+    {
+      if( mIt->first == old_index )
+        found_row = mIt;
+
+      auto rIt = mIt->second.begin( );
+      for( ; rIt != mIt->second.end( ); ++rIt )
+      {
+        if( mIt->first == old_index )
+          this->m_Matrix[ new_index ][ rIt->first ] = rIt->second;
+        else if( rIt->first == old_index )
+          this->m_Matrix[ mIt->first ][ new_index ] = rIt->second;
+
+      } // rof
+
+    } // rof
+
+    // Delete old edges
+    if( found_row != this->m_Matrix.end( ) )
+      this->m_Matrix.erase( found_row );
+
+    mIt = this->m_Matrix.begin( );
+    for( ; mIt != this->m_Matrix.end( ); ++mIt )
+    {
+      auto rIt = mIt->second.begin( );
+      while( rIt != mIt->second.end( ) )
+      {
+        if( rIt->first == old_index )
+        {
+          mIt->second.erase( rIt );
+          rIt = mIt->second.begin( );
+        }
+        else
+          ++rIt;
+
+      } // elihw
+
+    } // rof
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+void cpExtensions::DataStructures::Graph< V, C, I >::
+RemoveVertex( const I& index )
+{
+  auto i = this->m_Vertices.find( index );
+  if( i != this->m_Vertices.end( ) )
+  {
+    // Delete vertex
+    this->m_Vertices.erase( i );
+
+    // Delete edges starting from given vertex
+    auto mIt = this->m_Matrix.find( index );
+    if( mIt != this->m_Matrix.end( ) )
+      this->m_Matrix.erase( mIt );
+
+    // Delete edges arriving to given vertex
+    mIt = this->m_Matrix.begin( );
+    for( ; mIt != this->m_Matrix.end( ); ++mIt )
+    {
+      auto rIt = mIt->second.begin( );
+      while( rIt != mIt->second.end( ) )
+      {
+        if( rIt->first == index )
+        {
+          mIt->second.erase( rIt );
+          rIt = mIt->second.begin( );
+        }
+        else
+          ++rIt;
+
+      } // elihw
+
+    } // rof
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+bool cpExtensions::DataStructures::Graph< V, C, I >::
+HasEdge( const I& orig, const I& dest ) const
+{
+  auto mIt = this->m_Matrix.find( orig );
+  if( mIt != this->m_Matrix.end( ) )
+    return( mIt->second.find( dest ) != mIt->second.end( ) );
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+void cpExtensions::DataStructures::Graph< V, C, I >::
+RemoveEdge( const I& orig, const I& dest, const C& cost )
+{
+  auto m = this->m_Matrix.find( orig );
+  if( m != this->m_Matrix.end( ) )
+  {
+    auto r = m->second.find( dest );
+    if( r != m->second.end( ) )
+    {
+      auto e = std::find( r->second.begin( ), r->second.end( ), cost );
+      if( e != r->second.end( ) )
+      {
+        r->second.erase( e );
+        if( r->second.size( ) == 0 )
+        {
+          m->second.erase( r );
+          if( m->second.size( ) == 0 )
+            this->m_Matrix.erase( m );
+
+        } // fi
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+void cpExtensions::DataStructures::Graph< V, C, I >::
+RemoveEdges( const I& orig, const I& dest )
+{
+  auto m = this->m_Matrix.find( orig );
+  if( m != this->m_Matrix.end( ) )
+  {
+    auto r = m->second.find( dest );
+    if( r != m->second.end( ) )
+    {
+      m->second.erase( r );
+      if( m->second.size( ) == 0 )
+        this->m_Matrix.erase( m );
+
+    } // fi
+
+  } // fi
+
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+std::set< I > cpExtensions::DataStructures::Graph< V, C, I >::
+GetSinks( ) const
+{
+  std::set< I > sinks;
+
+  auto vIt = this->m_Vertices.begin( );
+  for( ; vIt != this->m_Vertices.end( ); ++vIt )
+    sinks.insert( vIt->first );
+  auto mIt = this->m_Matrix.begin( );
+  for( ; mIt != this->m_Matrix.end( ); ++mIt )
+    sinks.erase( mIt->first );
+
+  return( sinks );
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+cpExtensions::DataStructures::Graph< V, C, I >::
+Graph( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+cpExtensions::DataStructures::Graph< V, C, I >::
+~Graph( )
+{
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/ITKAndVTKImage.h b/lib/cpExtensions/DataStructures/ITKAndVTKImage.h
new file mode 100644 (file)
index 0000000..dfcad3f
--- /dev/null
@@ -0,0 +1,107 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__ITKANDVTKIMAGE__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__ITKANDVTKIMAGE__H__
+
+#include <itkImage.h>
+#include <itkImageFileReader.h>
+#include <itkImageFileWriter.h>
+#include <itkImageToVTKImageFilter.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< typename P, unsigned int D >
+    struct ITKAndVTKImage
+    {
+      typedef itk::Image< P, D >                   TImage;
+      typedef itk::ImageToVTKImageFilter< TImage > TItk2Vtk;
+
+      typename TImage::Pointer   ITK;
+      typename TItk2Vtk::Pointer VTK;
+
+      void CopyInformation( const itk::ImageBase< D >* i )
+        {
+          this->ITK = TImage::New( );
+          this->ITK->SetLargestPossibleRegion( i->GetLargestPossibleRegion( ) );
+          this->ITK->SetRequestedRegion( i->GetRequestedRegion( ) );
+          this->ITK->SetBufferedRegion( i->GetBufferedRegion( ) );
+          this->ITK->SetSpacing( i->GetSpacing( ) );
+          this->ITK->SetOrigin( i->GetOrigin( ) );
+          this->ITK->SetDirection( i->GetDirection( ) );
+          this->ITK->Allocate( );
+        }
+
+      void SetItkImage( TImage* image )
+        {
+          this->ITK = image;
+          this->_Synch( );
+        }
+
+      std::string ReadFromFile( const std::string& filename )
+        {
+          typename itk::ImageFileReader< TImage >::Pointer r =
+            itk::ImageFileReader< TImage >::New( );
+          r->SetFileName( filename );
+          try
+          {
+            r->Update( );
+          }
+          catch( itk::ExceptionObject& err )
+          {
+            this->ITK = NULL;
+            return( err.GetDescription( ) );
+
+          } // fi
+          this->ITK = r->GetOutput( );
+          this->ITK->DisconnectPipeline( );
+          this->_Synch( );
+          return( "" );
+        }
+
+      std::string WriteToFile( const std::string& filename ) const
+        {
+          typename itk::ImageFileWriter< TImage >::Pointer w =
+            itk::ImageFileWriter< TImage >::New( );
+          w->SetFileName( filename );
+          w->SetInput( this->ITK );
+          try
+          {
+            w->Update( );
+          }
+          catch( itk::ExceptionObject& err )
+          {
+            return( err.GetDescription( ) );
+
+          } // fi
+          return( "" );
+        }
+
+      TImage* GetItkImage( )
+        { return( this->ITK ); }
+      vtkImageData* GetVtkImage( )
+        { return( this->VTK->GetOutput( ) ); }
+      const TImage* GetItkImage( ) const
+        { return( this->ITK ); }
+      const vtkImageData* GetVtkImage( ) const
+        { return( this->VTK->GetOutput( ) ); }
+      void DisconnectPipeline( )
+        { this->ITK->DisconnectPipeline( ); }
+
+      void _Synch( )
+        {
+          this->VTK = TItk2Vtk::New( );
+          this->VTK->SetInput( this->ITK );
+          this->VTK->Update( );
+        }
+
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__ITKANDVTKIMAGE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h b/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h
new file mode 100644 (file)
index 0000000..2f61766
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
+
+#include <itkSpatialObject.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< unsigned int D >
+    class InfinitePlaneSpatialObject
+      : public itk::SpatialObject< D >
+    {
+    public:
+      typedef InfinitePlaneSpatialObject      Self;
+      typedef itk::SpatialObject< D >         Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef double                               ScalarType;
+      typedef typename Superclass::PointType       PointType;
+      typedef typename Superclass::TransformType   TransformType;
+      typedef typename Superclass::BoundingBoxType BoundingBoxType;
+      typedef typename PointType::VectorType       VectorType;
+
+      itkStaticConstMacro( NumberOfDimension, unsigned int, D );
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( InfinitePlaneSpatialObject, itk::SpatialObject );
+
+      itkGetConstMacro( Center, PointType );
+      itkGetConstMacro( Normal, VectorType );
+
+    public:
+      template< class P >
+      void SetCenter( const P& p );
+
+      template< class N >
+      void SetNormal( const N& n );
+
+      virtual bool ValueAt(
+        const PointType& point, double& value,
+        unsigned int depth = 0, char* name = NULL
+        ) const;
+
+      virtual bool IsEvaluableAt(
+        const PointType& point,
+        unsigned int depth = 0, char* name = NULL
+        ) const;
+
+      virtual bool IsInside(
+        const PointType& point,
+        unsigned int depth, char* name
+        ) const;
+
+      virtual bool IsInside( const PointType& point ) const;
+
+      virtual bool ComputeLocalBoundingBox( ) const;
+
+    protected:
+      InfinitePlaneSpatialObject( );
+      virtual ~InfinitePlaneSpatialObject( );
+      virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
+
+    private:
+      // Purposely not implemented.
+      InfinitePlaneSpatialObject( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      PointType  m_Center;
+      VectorType m_Normal;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx b/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx
new file mode 100644 (file)
index 0000000..fd68815
--- /dev/null
@@ -0,0 +1,109 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+template< class P >
+void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+SetCenter( const P& p )
+{
+  for( unsigned int d = 0; d < D; ++d )
+    this->m_Center[ d ] = ScalarType( p[ d ] );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+template< class N >
+void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+SetNormal( const N& n )
+{
+  for( unsigned int d = 0; d < D; ++d )
+    this->m_Normal[ d ] = ScalarType( n[ d ] );
+  ScalarType nn = this->m_Normal.GetNorm( );
+  if( nn > ScalarType( 0 ) )
+    this->m_Normal /= nn;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+ValueAt(
+  const PointType& point, double& value, unsigned int depth, char* name
+  ) const
+{
+  value = this->m_Normal * ( point - this->m_Center );
+  return( value >= double( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+IsEvaluableAt(
+  const PointType& point, unsigned int depth, char* name
+  ) const
+{
+  double value;
+  return( this->ValueAt( point, value, depth, name ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+IsInside(
+  const PointType& point, unsigned int depth, char* name
+  ) const
+{
+  double value;
+  return( this->ValueAt( point, value, depth, name ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+IsInside( const PointType& point ) const
+{
+  double value;
+  return( this->ValueAt( point, value, 0, NULL ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+ComputeLocalBoundingBox( ) const
+{
+  return( false );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+InfinitePlaneSpatialObject( )
+  : Superclass( )
+{
+  this->m_Center.Fill( ScalarType( 0 ) );
+  this->m_Normal.Fill( ScalarType( 0 ) );
+  this->m_Normal[ 0 ] = ScalarType( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+~InfinitePlaneSpatialObject( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+PrintSelf( std::ostream& os, itk::Indent indent ) const
+{
+  this->Superclass::PrintSelf( os, indent );
+  os << indent << "Center: " << this->m_Center << std::endl;
+  os << indent << "Normal: " << this->m_Normal << std::endl;
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdge.h b/lib/cpExtensions/DataStructures/QuadEdge.h
new file mode 100644 (file)
index 0000000..bcb1f88
--- /dev/null
@@ -0,0 +1,471 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGE__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGE__H__
+
+#include <itkLightObject.h>
+#include <cpExtensions/DataStructures/QuadEdgeIterators.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< typename P, typename D, bool IsPrimal = true >
+    class QuadEdge
+      : public itk::LightObject
+    {
+    public:
+      typedef QuadEdge                        Self;
+      typedef itk::LightObject                Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      /// Vertices and faces types
+      typedef P TPrimalGeometry;
+      typedef D TDualGeometry;
+
+      /**
+       * Dual type, basically the same type with swapped template
+       * parameters.
+       */
+      typedef QuadEdge< D, P, !IsPrimal > TDual;
+      typedef Self                        TPrimal;
+      typedef typename TDual::Pointer     PtrDual;
+      friend TDual;
+
+      /// Iterators
+      typedef QuadEdgeIterator< TPrimal >           Iterator;
+      typedef QuadEdgeConstIterator< TPrimal >      ConstIterator;
+      typedef QuadEdgePointIterator< TPrimal >      PointIterator;
+      typedef QuadEdgePointConstIterator< TPrimal > PointConstIterator;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( QuadEdge, itkLightObject );
+
+      cpPluginsExtensionsQEAllIteratorsMacro( Onext );
+      cpPluginsExtensionsQEAllIteratorsMacro( Lnext );
+      cpPluginsExtensionsQEAllIteratorsMacro( Rnext );
+      cpPluginsExtensionsQEAllIteratorsMacro( Dnext );
+      cpPluginsExtensionsQEAllIteratorsMacro( Oprev );
+      cpPluginsExtensionsQEAllIteratorsMacro( Lprev );
+      cpPluginsExtensionsQEAllIteratorsMacro( Rprev );
+      cpPluginsExtensionsQEAllIteratorsMacro( Dprev );
+
+    public:
+      void CreateRings( );
+
+      /// First order access methods
+      inline TPrimal* GetOnext( )
+        { return( this->m_Onext ); }
+      inline TDual* GetRot( )
+        { return( this->m_Rot ); }
+      inline const TPrimal* GetOnext( ) const
+        { return( this->m_Onext ); }
+      inline const TDual* GetRot( ) const
+        { return( this->m_Rot ); }
+
+      /// First order configuration methods
+      inline void SetOnext( TPrimal* e )
+        { this->m_Onext = e; }
+      inline void SetRot( TDual* e )
+        { this->m_Rot = e; }
+
+      /// Second order accessors: around base rings
+      inline TPrimal* GetSym( )
+        { return( this->m_Rot->m_Rot ); }
+      inline TDual* GetInvRot( )
+        { return( this->m_Rot->m_Rot->m_Rot ); }
+
+      /// Second order accessors: neighboring topology
+      inline TPrimal* GetLnext( )
+        { return( this->m_Rot->m_Rot->m_Rot->m_Onext->m_Rot ); }
+      inline TPrimal* GetRnext( )
+        { return( this->m_Rot->m_Onext->m_Rot->m_Rot->m_Rot ); }
+      inline TPrimal* GetDnext( )
+        { return( this->m_Rot->m_Rot->m_Onext->m_Rot->m_Rot ); }
+      inline TPrimal* GetOprev( )
+        { return( this->m_Rot->m_Onext->m_Rot ); }
+      inline TPrimal* GetLprev( )
+        { return( this->m_Onext->m_Rot->m_Rot ); }
+      inline TPrimal* GetRprev( )
+        { return( this->m_Rot->m_Rot->m_Onext ); }
+      inline TPrimal* GetDprev( )
+        {
+          return( this->m_Rot->m_Rot->m_Rot->m_Onext->m_Rot->m_Rot->m_Rot );
+        }
+
+      /// Second order accessors: around base rings (const versions)
+      inline const TPrimal* GetSym( ) const
+        { return( this->m_Rot->m_Rot ); }
+      inline const TDual* GetInvRot( ) const
+        { return( this->m_Rot->m_Rot->m_Rot ); }
+
+      /// Second order accessors: neighboring topology (const versions)
+      inline const TPrimal* GetLnext( ) const
+        { return( this->m_Rot->m_Rot->m_Rot->m_Onext->m_Rot ); }
+      inline const TPrimal* GetRnext( ) const
+        { return( this->m_Rot->m_Onext->m_Rot->m_Rot->m_Rot ); }
+      inline const TPrimal* GetDnext( ) const
+        { return( this->m_Rot->m_Rot->m_Onext->m_Rot->m_Rot ); }
+      inline const TPrimal* GetOprev( ) const
+        { return( this->m_Rot->m_Onext->m_Rot ); }
+      inline const TPrimal* GetLprev( ) const
+        { return( this->m_Onext->m_Rot->m_Rot ); }
+      inline const TPrimal* GetRprev( ) const
+        { return( this->m_Rot->m_Rot->m_Onext ); }
+      inline const TPrimal* GetDprev( ) const
+        {
+          return( this->m_Rot->m_Rot->m_Rot->m_Onext->m_Rot->m_Rot->m_Rot );
+        }
+
+      /// Get geometry methods
+      inline P& GetOrigin( )
+        { return ( this->m_Origin ); }
+      inline P& GetDestination( )
+        { return ( this->m_Rot->m_Rot->m_Origin ); }
+      inline D& GetRight( )
+        { return ( this->m_Rot->m_Origin ); }
+      inline D& GetLeft( )
+        { return ( this->m_Rot->m_Rot->m_Rot->m_Origin ); }
+
+      /// Get geometry methods (const versions)
+      inline const P& GetOrigin( ) const
+        { return ( this->m_Origin ); }
+      inline const P& GetDestination( ) const
+        { return ( this->m_Rot->m_Rot->m_Origin ); }
+      inline const D& GetRight( ) const
+        { return ( this->m_Rot->m_Origin ); }
+      inline const D& GetLeft( ) const
+        { return ( this->m_Rot->m_Rot->m_Rot->m_Origin ); }
+
+      /// Set geometry methods
+      inline void SetOrigin( const P& v )
+        { this->m_Origin = v; }
+      inline void SetDestination( const P& v )
+        { this->m_Rot->m_Rot->m_Origin = v; }
+      inline void SetRight( const D& v )
+        { this->m_Rot->m_Origin = v; }
+      inline void SetLeft( const D& v )
+        { this->m_Rot->m_Rot->m_Rot->m_Origin = v; }
+      inline void UnsetOrigin( )
+        { this->m_Origin = TPrimal::NoGeometry; }
+      inline void UnsetDestination( )
+        { this->m_Rot->m_Rot->m_Origin = TPrimal::NoGeometry; }
+      inline void UnsetRight( )
+        { this->m_Rot->m_Origin = TDual::NoGeometry; }
+      inline void UnsetLeft( )
+        { this->m_Rot->m_Rot->m_Rot->m_Origin = TDual::NoGeometry; }
+
+      /**
+       * Set the Left( ) of all the edges in the Lnext( ) ring of "this"
+       * with the same given geometrical information.
+       * @param  faceGeom Looks at most maxSize edges in the Lnext( ) ring.
+       * @return Returns true on success. False otherwise.
+       */
+      void SetLnextRingGeometry( const D& v );
+      void UnsetLnextRingGeometry( );
+
+      /// Topological queries
+      inline bool IsIsolated( ) const
+        { return( this == this->m_Onext ); }
+      bool IsEdgeInOnextRing( const TPrimal* e ) const;
+      bool IsEdgeInLnextRing( const TPrimal* e ) const;
+      unsigned int GetOnextRingSize( ) const;
+      unsigned int GetLnextRingSize( ) const;
+
+      /**
+       * @return Returns true when "this" has no faces set on both sides.
+       *         Return false otherwise.
+       */
+      inline bool IsWire( )
+        { return( !( this->IsLeftSet( ) ) && !( this->IsRightSet( ) ) ); }
+
+      /**
+       * @return Returns true when "this" is on the boundary i.e.
+       *         one and only one of the faces is set. Return false
+       *         otherwise.
+       */
+      inline bool IsAtBorder( ) const;
+
+      /**
+       * @return Returns true when "this" has faces set on both sides.
+       *         Return false otherwise.
+       */
+      inline bool IsInternal( ) const
+        { return ( this->IsLeftSet( ) && this->IsRightSet( ) ); }
+
+      /// Geometrical queries
+      inline bool IsOriginSet( ) const
+        { return ( this->m_Origin != Self::NoGeometry ); }
+      inline bool IsDestinationSet( ) const
+        { return ( this->m_Rot->m_Rot->IsOriginSet( ) ); }
+      inline bool IsRightSet( ) const
+        { return ( this->m_Rot->IsOriginSet( ) ); }
+      inline bool IsLeftSet( ) const
+        { return ( this->m_Rot->m_Rot->m_Rot->IsOriginSet( ) ); }
+
+      /**
+       * \brief Check wether edge's Origin is internal to the mesh (as
+       * opposed to being on the boundary) by looking if all the edges
+       * in the Onext() ring have a face set on both their Left() and
+       * Right() side.
+       */
+      bool IsOriginInternal( ) const;
+
+      /**
+       * Definition: an edge is said to be a boundary edge when it is
+       * adjacent to i.e. when at least one of the faces edge->GetLeft() or
+       * edge->GetRight() is unset.  Definition: an point is said to be a
+       * boundary point when at least one of the edges of it's Onext() ring
+       * is a boundary edge.
+       *
+       * Assume "this" edge belongs to a triangulation (i.e. it belongs to a
+       * QEMesh which represents a 2-manifold) which possesses a boundary.
+       * Assume "this" edge instance is a boundary edge. Let us denote by P
+       * the point which is the origin of "this" edge i.e. P is
+       * this->Origin().  By definition P is a boundary point.  Then AT
+       * LEAST two [see the note below] edges of the Onext() ring of P
+       * [which all have the point P as Origin()] are themselves boundary
+       * edges. And among those boundary edges AT LEAST one has it's Left()
+       * face unset.  By iterating over the Onext() ring (which defines a
+       * local ordering on edges) this method searches for the first edge
+       * whose Left() face is unset AND which is encountered AFTER edgeTest.
+       *
+       * @param edgeTest When present, this edge will be considered as
+       *        the entry edge in the Onext() ring. When absent it shall
+       *        be defaulted to "this" edge. (see the warning below).
+       * @return When "this" edge is a boundary edge, return the first
+       *         edge in "this" Onext() ring whose Left() face is unset
+       *         AND located after edgeTest.
+       *         When "this" edge is NOT a boundary edge the 0 is
+       *         returned.
+       * @warning When the Mesh possessing "this" edge is a 2-manifold
+       *          then result of this method is unique in the sense that
+       *          it is independent from the edgeTest parameter.
+       *          But when the Mesh is not 2-manifold (this state can
+       *          happen at intermediary stages of the building process,
+       *          or during "surgical" operations on the Mesh, and
+       *          even though the Mesh represents a triangulation)
+       *          the result of this method is not unique in the sense
+       *          that the result depends on the edgeTest parameter.
+       *          Let us illusatre this dependence by considering a
+       *          Mesh (which is a triangulation) which is not a 2-manifold.
+       *          Assume the point P (the origin of "this" edge i.e.
+       *          P = this->Originv()) is TWICE on the border i.e. it
+       *          is adjacent twice to noface. We can consider the situation
+       *          of the following diagram, which depicts some Onext()
+       *          ring around point P:
+       *
+       *                       \         /                               //
+       *                        \   *   /                                //
+       *                        i3     b2              counter-clockwise //
+       *                  *       \   /   NO FACE      Onext() order.    //
+       *                           \ /                                   //
+       *                 ----b4-----P----b1------                        //
+       *                           /|\                                   //
+       *               NO FACE    / | \                                  //
+       *                         /  |  \    *  <------ a * indicates the //
+       *                        /   |   \         the presence of a face //
+       *                       /    |    \                               //
+       *                     b5    i6     i7                             //
+       *                     /   *  |  *   \                             //
+       *                    /       |       \                            //
+       *
+       *          On this example, and if we assume the Onext() oder is
+       *          represented counter-clockwise, the edges are ordered as
+       *          follows:
+       *             b1, b2, i3, b4, b5, i6, i7
+       *          (when arbitrarily starting at edge b1).
+       *          We have four Boundary edges labeled b1, b2, b4, b5 and
+       *          we have three internal edges (i.e. non boundary edges)
+       *          labeled i3, i6 and i7.
+       *          Depending on edgeTest, the result of this method
+       *          will NOT return the same edge:
+       *            - when edgeTest == b5 (or i6 or i7 or b1) then the edge
+       *              b1 will be returned,
+       *            - when edgeTest == b2 (or i3 or b4) then the edge
+       *              b4 will be returned,
+       *          Eventually, when edgeTest is absent, the result shall
+       *          depend on the position of "this" in the Onext() ring().
+       *
+       */
+      TPrimal* GetNextBorderEdgeWithUnsetLeft( TPrimal* edge = NULL ) const;
+
+      /**
+       * Assume "this->Originv()" is a boundary point P that is thrice
+       * adjacent to noface and consider the given situation is the one
+       * depicted by the following diagram where:
+       *   - P is "this->Originv()" instance,
+       *   - the * (star) indicates the presence of a face,
+       *   - b1, b2, b3, b4, b5, b6 denote boundary edges,
+       *   - p denotes some generic point,
+       *   - A and B denote some specific points we want to discuss,
+       *   - the Onext() ring order is represented counter-clockwise
+       *     [which is coherent with the definition of edge->GetRigth()]
+       *     i.e. the ordering of the edges is:
+       *          b1, b2, b3, b4, b5, b6, b1...
+       *
+       *                    p       N       p
+       *                   / \      O      / \                            //
+       *                  /   \           /   \                           //
+       *                 /     \    F    /     \       counter-clockwise  //
+       *                /      b3   A   b2      \      Onext() ring order //
+       *               /         \  C  /         \                        //
+       *              /     *     \ E /     *     \                       //
+       *             /             \ /             \                      //
+       *             A------b4------P------b1-------B                     //
+       *                           / \                                    //
+       *                          /   \                                   //
+       *             NO FACE     /     \      NO FACE                     //
+       *                        /       \                                 //
+       *                      b5         b6                               //
+       *                      /     *     \                               //
+       *                     /             \                              //
+       *                    p---------------p                             //
+       *
+       * At P this Mesh doesn't represent a 2-manifold (since we are thrice
+       * on the boundary). Nevertheless such a situation could arise in
+       * intermediary stages (e.g. when building the Mesh, or during
+       * surgical changes on the Mesh).
+       *    Now, assume we are asked to build the triangle [P, A, B]. Note
+       * that this request is not absurd since the current situation at
+       * P isn't the one of a 2-manifold: hence when building the current
+       * Onext() ring of P, we had not enough information to decide
+       * wheter b4.Onext() should be b5 or b1. It is ONLY when we are
+       * required to build the triangle [P, A, B] that we have the
+       * additional information that b4.Onext() is indeed b1.
+       *    When we are required to build triangle [P, A, B], we hence
+       * need to change the Onext() ring order at P, i.e. we need to deal
+       * with the triangle [P, b5, b6] which currently prevents
+       * b4.Onext() to be b1. In other terms, when considering the
+       * additional information that b4.Onext() is b1, and before
+       * building the triangle [P, A, B], we need to reorder
+       * the Onext() ring of P from it's current state
+       *    b1, b2, b3, b4, b5, b6, b1...
+       * to an order coherent with the [P, A, B] request, i.e.
+       *     b1, b2, b5, b6, b3, b4, b1...
+       *
+       * In order to establish the "proper" Onext() ring at P we use
+       * two Splice operations. The algorithm goes:
+       *   - first disconnect the piece of the surface containing the edge
+       *     [PB] (it would be the same process if we chose [PA]) from
+       *     the Onext() ring at P.
+       *   - second, re-integrate the disconnected piece at the desired
+       *     location i.e. side by side with [PA] (respectively [PB] if
+       *     we chose [PA] at first stage).
+       * By "piece of surface containing the edge [PB]" we mean [all]
+       * the triangle[s] starting at [PB] in the Onext() order and
+       * having a left face set.
+       *
+       * We can illustrate this process on bit more general diagram than
+       * the last case (where the "piece of surface containing the edge
+       * [PB]" is constituted by two triangles) and when using
+       * the arguments of this method (i.e. [PA] = this and [PB] = second).
+       * The initial stage is the following (we note first=this=[PA] and
+       * second=[PB]) where the Onext() ring order is:
+       *     first, b2, b3, second, b5, bsplice, b7, first...
+       *
+       *                    p       N       A                            //
+       *                   / \      O      / \                           //
+       *                  /   \           /   \                          //
+       *                 /     \    F    /     \     counter-clockwise   //
+       *                /      b2   A  first    \    Onext() ring order  //
+       *               /         \  C  /         \                       //
+       *              /     *     \ E /     *     \                      //
+       *             /             \ /             \                     //
+       *            p-------b3------P------b7-------p                    //
+       *                           /|\                                   //
+       *                          / | \                                  //
+       *          NO FACE        /  |  \      NO FACE                    //
+       *                        /   |   \                                //
+       *                  second   b5   bsplice                          //
+       *                      /  *  |  *  \                              //
+       *                     /      |      \                             //
+       *                    B-------p-------p                            //
+       *
+       * The first stage, implemented as
+       *     second->Oprev()->Splice( bsplice ),
+       * yields the following diagram:
+       *
+       *                    p       N       A                            //
+       *                   / \      O      / \                           //
+       *                  /   \     F     /   \                          //
+       *                 /     \    A    /     \      counter-clockwise  //
+       *                /      b2   C  first    \     Onext() ring order //
+       *               /         \  E  /         \                       //
+       *              /     *     \   /     *     \                      //
+       *             /             \ /             \                     //
+       *            p-------b3------P------b7-------p                    //
+       *                                                                 //
+       *                         NO FACE                                 //
+       *                                                                 //
+       *                           /|\                                   //
+       *                          / | \                                  //
+       *                         /  |  \                                 //
+       *                        /   |   \                                //
+       *                  second   b5   bsplice                          //
+       *                      /  *  |  *  \                              //
+       *                     /      |      \                             //
+       *                    B-------p-------p                            //
+       *
+       * and the second stage, implemented as
+       *      first->Splice( bsplice ),
+       * yields the following diagram:
+       *
+       *                                    A                            //
+       *         B__        NO FACE        / \                           //
+       *         |  \__                   /   \                          //
+       *         |     \__               /     \       counter-          //
+       *         |      second         first    \      clockwise for all //
+       *         |           \__       /         \                       //
+       *         |     *        \__   /     *     \                      //
+       *         |                 \ /             \                     //
+       *         p-------b5---------P------b7-------p                    //
+       *         |               __/|\                                   //
+       *         |     *      __/   | \                                  //
+       *         |           /      |  \      NO FACE                    //
+       *         |     bsplice      |   \                                //
+       *         |   __/           b2    b3                              //
+       *         p__/               |  *  \                              //
+       *                NO FACE     |      \                             //
+       *                            p-------p                            //
+       *
+       */
+      inline static bool ReorderOnextRing( TPrimal* first, TPrimal* second );
+
+      /**
+       * \brief Basic quad-edge topological method.
+       *
+       * This method describes all possible topological operations on an
+       * edge since it is its own inverse. It works in two ways:
+       *
+       *   1. If this->m_Org != b->m_Org, it slice a face in two.
+       *   2. If this->m_Org == b->m_Org, it unifies two faces.
+       */
+      inline static void Splice( TPrimal* a, TPrimal* b );
+
+    protected:
+      QuadEdge( );
+      virtual ~QuadEdge( );
+
+    public:
+      static const TPrimalGeometry NoGeometry;
+
+    protected:
+      Pointer         m_Onext;  /**< Onext ring */
+      PtrDual         m_Rot;    /**< Rot ring */
+      TPrimalGeometry m_Origin; /**< Geometry attached to edge's origin */
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/QuadEdge.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdge.hxx b/lib/cpExtensions/DataStructures/QuadEdge.hxx
new file mode 100644 (file)
index 0000000..a0e0e25
--- /dev/null
@@ -0,0 +1,241 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGE__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGE__HXX__
+
+#include <limits>
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+const typename cpExtensions::DataStructures::
+QuadEdge< P, D, IsPrimal >::TPrimalGeometry
+cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+NoGeometry = std::numeric_limits< P >::max( );
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+void cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+CreateRings( )
+{
+  TPrimal* e = this;
+  PtrDual r = TDual::New( );
+  Pointer s = Self::New( );
+  PtrDual i = TDual::New( );
+
+  // Create Rot ring
+  e->m_Rot = r;
+  r->m_Rot = s;
+  s->m_Rot = i;
+  i->m_Rot = e;
+
+  // Update Onext rings
+  r->m_Onext = i;
+  i->m_Onext = r;
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+void cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+SetLnextRingGeometry( const D& v )
+{
+  for( Iterator i = this->BeginLnext( ); i != this->EndLnext( ); ++i )
+    ( *i )->SetLeft( v );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+void cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+UnsetLnextRingGeometry( )
+{
+  this->SetLnextRingGeometry( TDual::NoGeometry );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+bool cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+IsEdgeInOnextRing( const TPrimal* e ) const
+{
+  bool found = false;
+  for(
+    ConstIterator i = this->BeginOnext( );
+    i != this->EndOnext( ) && !found;
+    ++i
+    )
+    found |= ( *i == e );
+  return( found );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+bool cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+IsEdgeInLnextRing( const TPrimal* e ) const
+{
+  bool found = false;
+  for(
+    ConstIterator i = this->BeginLnext( );
+    i != this->EndLnext( ) && !found;
+    ++i
+    )
+    found |= ( *i == e );
+  return( found );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+unsigned int
+cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+GetOnextRingSize( ) const
+{
+  unsigned int count = 0;
+  for(
+    ConstIterator i = this->BeginOnext( );
+    i != this->EndOnext( );
+    ++i
+    )
+    count++;
+  return( count );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+unsigned int
+cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+GetLnextRingSize( ) const
+{
+  unsigned int count = 0;
+  for(
+    ConstIterator i = this->BeginLnext( );
+    i != this->EndLnext( );
+    ++i
+    )
+    count++;
+  return( count );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+bool cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+IsAtBorder( ) const
+{
+  return(
+    (    this->IsLeftSet( )   && !( this->IsRightSet( ) ) ) ||
+    ( !( this->IsLeftSet( ) ) &&    this->IsRightSet( )   )
+    );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+bool cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+IsOriginInternal( ) const
+{
+  bool internal = true;
+  for(
+    ConstIterator i = this->BeginOnext( );
+    i != this->EndOnext( ) && internal;
+    ++i
+    )
+    internal &= ( *i )->IsInternal( );
+  return( internal );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+typename cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+TPrimal* cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+GetNextBorderEdgeWithUnsetLeft( TPrimal* edge ) const
+{
+  // Be sure the Onext ring isn't already full
+  if( this->IsOriginInternal( ) )
+    return( NULL );
+
+  // Update reference
+  edge = ( edge == NULL )? const_cast< TPrimal* >( this ): edge;
+
+  // On efficiency purposes
+  if( edge->IsIsolated( ) )
+    return( edge );
+
+  // Ok, no more special cases
+  const TPrimal* cedge = const_cast< const TPrimal* >( edge );
+  ConstIterator it = cedge->BeginOnext( );
+  TPrimal* found = NULL;
+  for( ; it != cedge->EndOnext( ) && found == NULL; ++it )
+    if( !( ( *it )->IsLeftSet( ) ) )
+      found = const_cast< TPrimal* >( *it );
+  return( found );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+bool cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+ReorderOnextRing( TPrimal* first, TPrimal* second )
+{
+  // Making sure point adjacency is correct:
+  if( first->GetOrigin( ) != second->GetOrigin( ) )
+    return( false );
+
+  if( first->GetOnext( ) == second )
+    return( true );
+
+  if( first->IsLeftSet( ) )
+    return( false );
+
+  // Second is an internal edge.
+  if( second->IsInternal( ) )
+    return( false );
+
+  // Disconnect the triangles containing second:
+  TPrimal* bsplice;
+  if( second->IsLeftSet( ) )
+    bsplice = second->GetNextBorderEdgeWithUnsetLeft( );
+  else
+    bsplice = second;
+  TPrimal::Splice( second->GetOprev( ), bsplice );
+
+  // Reconnect second after first:
+  TPrimal::Splice( first, bsplice );
+  return( true );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+void cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+Splice( TPrimal* a, TPrimal* b )
+{
+  // Don't waste time splicing the same edge (or non-existent)
+  // remember: it is its own inverse!
+  if( a != b || a == NULL || b == NULL )
+  {
+    TPrimal* aNext = a->m_Onext;
+    TPrimal* bNext = b->m_Onext;
+    TDual* al      = aNext->m_Rot;
+    TDual* be      = bNext->m_Rot;
+    TDual* alNext  = al->m_Onext;
+    TDual* beNext  = be->m_Onext;
+
+    a->SetOnext( bNext );
+    b->SetOnext( aNext );
+    al->SetOnext( beNext );
+    be->SetOnext( alNext );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+QuadEdge( )
+  : m_Origin( Self::NoGeometry )
+{
+  this->m_Onext = this;
+  this->m_Rot = NULL;
+}
+
+// -------------------------------------------------------------------------
+template< typename P, typename D, bool IsPrimal >
+cpExtensions::DataStructures::QuadEdge< P, D, IsPrimal >::
+~QuadEdge( )
+{
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGE__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdgeCell.h b/lib/cpExtensions/DataStructures/QuadEdgeCell.h
new file mode 100644 (file)
index 0000000..84ae92f
--- /dev/null
@@ -0,0 +1,126 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGECELL__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGECELL__H__
+
+#include <vector>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< class I, class E >
+    class QuadEdgeCell
+      : public I
+    {
+    public:
+      // Base types
+      typedef QuadEdgeCell                   Self;
+      typedef I                              Superclass;
+      typedef itk::AutoPointer< Self >       SelfAutoPointer;
+      typedef itk::AutoPointer< const Self > ConstSelfAutoPointer;
+      typedef Self*                          RawPointer;
+      typedef const Self*                    ConstRawPointer;
+
+      // QuadEdge objects
+      typedef E                 TPrimalEdge;
+      typedef typename E::TDual TDualEdge;
+
+      // Inherited types
+      typedef typename I::PixelType                PixelType;
+      typedef typename I::CellType                 CellType;
+      typedef typename I::CellAutoPointer          CellAutoPointer;
+      typedef typename I::CellConstAutoPointer     CellConstAutoPointer;
+      typedef typename I::CellRawPointer           CellRawPointer;
+      typedef typename I::CellConstRawPointer      CellConstRawPointer;
+      typedef typename I::CellTraits               CellTraits;
+      typedef typename I::CoordRepType             CoordRepType;
+      typedef typename I::InterpolationWeightType  InterpolationWeightType;
+      typedef typename I::PointIdentifier          PointIdentifier;
+      typedef typename I::PointIdIterator          PointIdIterator;
+      typedef typename I::PointIdConstIterator     PointIdConstIterator;
+      typedef typename I::CellIdentifier           CellIdentifier;
+      typedef typename I::CellFeatureIdentifier    CellFeatureIdentifier;
+      typedef typename I::CellFeatureIdentifier    CellFeatureCount;
+      typedef typename I::PointType                PointType;
+      typedef typename I::VectorType               VectorType;
+      typedef typename I::PointsContainer          PointsContainer;
+      typedef typename I::UsingCellsContainer      UsingCellsContainer;
+      typedef typename I::CellGeometry             CellGeometry;
+      typedef typename I::ParametricCoordArrayType ParametricCoordArrayType;
+      typedef typename I::ShapeFunctionsArrayType  ShapeFunctionsArrayType;
+
+      itkStaticConstMacro( PointDimension, unsigned int, I::PointDimension );
+      itkStaticConstMacro( CellDimension, unsigned int, 2 );
+
+    public:
+      itkTypeMacro( QuadEdgeCell, I );
+
+    public:
+      QuadEdgeCell( );
+      QuadEdgeCell( E* entry );
+      virtual ~QuadEdgeCell( );
+
+      /// Implement the standard CellInterface.
+      virtual CellGeometry GetType( ) const;
+      virtual void MakeCopy( CellAutoPointer& other ) const;
+      virtual unsigned int GetDimension( ) const;
+      virtual unsigned int GetNumberOfPoints( ) const;
+      virtual CellFeatureCount GetNumberOfBoundaryFeatures(
+        int dimension
+        ) const;
+      virtual bool GetBoundaryFeature(
+        int dimension, CellFeatureIdentifier fId, CellAutoPointer& ptr
+        );
+      virtual void SetPointIds( PointIdConstIterator first );
+      virtual void SetPointIds(
+        PointIdConstIterator first, PointIdConstIterator last
+        );
+      virtual void AddPointId( PointIdentifier pId );
+      virtual void RemovePointId( PointIdentifier pId );
+      virtual void SetPointIds(
+        int dummy, int num, PointIdConstIterator first
+        );
+      virtual void BuildEdges( );
+      virtual void ClearPoints( );
+      virtual void SetPointId( int localId, PointIdentifier pId );
+
+      // Visitor methods
+      static int GetTopologyId( );
+      virtual void Accept(
+        CellIdentifier cellid,
+        typename itk::CellInterface< PixelType, CellTraits >::
+        MultiVisitor* mv
+        );
+
+      // Iterators
+      virtual PointIdIterator      PointIdsBegin( );
+      virtual PointIdConstIterator PointIdsBegin( ) const;
+      virtual PointIdIterator      PointIdsEnd( );
+      virtual PointIdConstIterator PointIdsEnd( ) const;
+
+      /// QuadEdgeCell-specific interface.
+      virtual E* GetEntryPrimalEdge( );
+      virtual const E* GetEntryPrimalEdge( ) const;
+      virtual void SetEntryPrimalEdge( E* entry );
+
+    private:
+      /// Purposely not implemented.
+    QuadEdgeCell( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      E* m_EntryEdge;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/QuadEdgeCell.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGECELL__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdgeCell.hxx b/lib/cpExtensions/DataStructures/QuadEdgeCell.hxx
new file mode 100644 (file)
index 0000000..7713b3e
--- /dev/null
@@ -0,0 +1,258 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGECELL__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGECELL__HXX__
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+QuadEdgeCell( )
+  : Superclass( ),
+    m_EntryEdge( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+QuadEdgeCell( E* entry )
+  : Superclass( ),
+    m_EntryEdge( entry )
+{
+  this->SetEntryPrimalEdge( entry );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+~QuadEdgeCell( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+typename cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+CellGeometry cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetType( ) const
+{
+  std::cout << "QuadEdgeCell GetType" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+MakeCopy( CellAutoPointer& other ) const
+{
+  std::cout << "QuadEdgeCell MakeCopy" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+unsigned int cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetDimension( ) const
+{
+  std::cout << "QuadEdgeCell GetDimension" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+unsigned int cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetNumberOfPoints( ) const
+{
+  return( this->m_EntryEdge->GetLnextRingSize( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+typename cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+CellFeatureCount cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetNumberOfBoundaryFeatures( int dimension ) const
+{
+  std::cout << "QuadEdgeCell GetNumberOfBoundaryFeatures" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+bool cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetBoundaryFeature(
+  int dimension,
+  CellFeatureIdentifier fId,
+  CellAutoPointer& ptr
+  )
+{
+  std::cout << "QuadEdgeCell GetBoundaryFeature" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+SetPointIds( PointIdConstIterator first )
+{
+  std::cout << "QuadEdgeCell SetPointIds" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+SetPointIds(
+  PointIdConstIterator first,
+  PointIdConstIterator last
+  )
+{
+  std::cout << "QuadEdgeCell SetPointIds(first,last)" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+AddPointId( PointIdentifier pId )
+{
+  std::cout << "QuadEdgeCell AddPointId" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+RemovePointId( PointIdentifier pId )
+{
+  std::cout << "QuadEdgeCell RemovePointId" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+SetPointIds(
+  int dummy,
+  int num,
+  PointIdConstIterator first
+  )
+{
+  std::cout << "QuadEdgeCell SetPointIds(dummy,num,first)" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+BuildEdges( )
+{
+  std::cout << "QuadEdgeCell BuildEdges" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+ClearPoints( )
+{
+  std::cout << "QuadEdgeCell ClearPoints" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+SetPointId( int localId, PointIdentifier pId )
+{
+  std::cout << "QuadEdgeCell SetPointId(localId,pId)" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+int cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetTopologyId( )
+{
+  // TODO: return( Superclass::POLYGON_CELL );
+  std::cout << "QuadEdgeCell GetTopologyId" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+Accept(
+  CellIdentifier cellid,
+  typename itk::CellInterface< PixelType, CellTraits >::MultiVisitor* mv
+  )
+{
+  std::cout << "QuadEdgeCell Accept" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+typename cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdIterator cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdsBegin( )
+{
+  std::cout << "QuadEdgeCell PointIdsBegin" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+typename cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdConstIterator
+cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdsBegin( ) const
+{
+  std::cout << "QuadEdgeCell PointIdsBegin (const)" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+typename cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdIterator cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdsEnd( )
+{
+  std::cout << "QuadEdgeCell PointIdsEnd" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+typename cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdConstIterator
+cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+PointIdsEnd( ) const
+{
+  std::cout << "QuadEdgeCell PointIdsEnd (const)" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+E* cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetEntryPrimalEdge( )
+{
+  return( this->m_EntryEdge );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+const E* cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+GetEntryPrimalEdge( ) const
+{
+  return( this->m_EntryEdge );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class E >
+void cpExtensions::DataStructures::QuadEdgeCell< I, E >::
+SetEntryPrimalEdge( E* entry )
+{
+  this->m_EntryEdge = entry;
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGECELL__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdgeIterators.h b/lib/cpExtensions/DataStructures/QuadEdgeIterators.h
new file mode 100644 (file)
index 0000000..c82ac34
--- /dev/null
@@ -0,0 +1,173 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__H__
+
+#include <cstdlib>
+
+// -------------------------------------------------------------------------
+#define cpPluginsQEIteratorsMacro( op, it, cit )        \
+  inline it Begin##op( )                                \
+  { return( it( this, it::Op##op, true ) ); }           \
+  inline it End##op( )                                  \
+  { return( it( this, it::Op##op, false ) ); }          \
+  inline cit Begin##op( ) const                         \
+  { return( cit( this, cit::Op##op, true ) ); }         \
+  inline cit End##op( ) const                           \
+  { return( cit( this, cit::Op##op, false ) ); }
+
+// -------------------------------------------------------------------------
+#define cpPluginsExtensionsQEPointIteratorsMacro( op, it, cit ) \
+  inline Point##it BeginPoint##op( )                            \
+  { return( Point##it( this, it::Op##op, true ) ); }            \
+  inline Point##it EndPoint##op( )                              \
+  { return( Point##it( this, it::Op##op, false ) ); }           \
+  inline Point##cit BeginPoint##op( ) const                     \
+  { return( Point##cit( this, cit::Op##op, true ) ); }          \
+  inline Point##cit EndPoint  ##op( ) const                     \
+  { return( Point##cit( this, cit::Op##op, false ) ); }
+
+// -------------------------------------------------------------------------
+#define cpPluginsExtensionsQEAllIteratorsMacro( op )                    \
+  cpPluginsQEIteratorsMacro( op, Iterator, ConstIterator );             \
+  cpPluginsExtensionsQEPointIteratorsMacro( op, Iterator, ConstIterator );
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< class E >
+    class QuadEdgeBaseIterator
+    {
+    public:
+      typedef QuadEdgeBaseIterator Self;
+      typedef E                    TQuadEdge;
+
+      // Different types of logical iterators
+      enum
+      {
+        OpOnext = 0,
+        OpLnext = 1,
+        OpRnext = 2,
+        OpDnext = 3,
+        OpOprev = 4,
+        OpLprev = 5,
+        OpRprev = 6,
+        OpDprev = 7
+      };
+
+    public:
+      QuadEdgeBaseIterator( E* e, int op = OpOnext, bool start = true );
+      virtual ~QuadEdgeBaseIterator( );
+      Self& operator=( const Self& r );
+
+      E*   GetStartEdge( ) const;
+      E*   GetIterator( ) const;
+      int  GetOpType( ) const;
+      bool GetStart( ) const;
+
+      bool  operator==( Self& r );
+      bool  operator==( const Self& r ) const;
+      bool  operator!=( Self& r );
+      bool  operator!=( const Self& r ) const;
+      Self& operator++( );
+      Self& operator++( int );
+
+    protected:
+      /// Method that should do all the iteration work
+    virtual void _GoToNext( );
+
+    protected:
+      E*   m_StartEdge; /**< Start edge */
+      E*   m_Iterator;  /**< Current iteration position */
+      int  m_OpType;    /**< Operation type */
+      bool m_Start;     /**< Indicates iteration has just started */
+    };
+
+    /**
+     */
+    template< class E >
+    class QuadEdgeIterator
+      : public QuadEdgeBaseIterator< E >
+    {
+    public:
+      typedef QuadEdgeIterator          Self;
+      typedef QuadEdgeBaseIterator< E > Superclass;
+      typedef E                         TQuadEdge;
+
+    public:
+      QuadEdgeIterator(
+        E* e = NULL, int op = Superclass::OpOnext, bool start = true
+        );
+      virtual ~QuadEdgeIterator( );
+      E* operator*( );
+    };
+
+    /**
+     */
+    template< class E >
+    class QuadEdgeConstIterator
+      : public QuadEdgeBaseIterator< const E >
+    {
+    public:
+      typedef QuadEdgeConstIterator           Self;
+      typedef QuadEdgeBaseIterator< const E > Superclass;
+      typedef E                               TQuadEdge;
+
+    public:
+      QuadEdgeConstIterator(
+        const E* e = NULL, int op = Superclass::OpOnext, bool start = true
+        );
+      virtual ~QuadEdgeConstIterator( );
+      const E* operator*( ) const;
+    };
+
+    /**
+     */
+    template< class E >
+    class QuadEdgePointIterator
+      : public QuadEdgeBaseIterator< const E >
+    {
+    public:
+      typedef QuadEdgePointIterator           Self;
+      typedef QuadEdgeBaseIterator< const E > Superclass;
+      typedef E                               TQuadEdge;
+
+    public:
+      QuadEdgePointIterator(
+        const E* e = NULL, int op = Superclass::OpOnext, bool start = true
+        );
+      virtual ~QuadEdgePointIterator( );
+      typename E::TPrimalGeometry& operator*( );
+    };
+
+    /**
+     */
+    template< class E >
+    class QuadEdgePointConstIterator
+      : public QuadEdgeBaseIterator< const E >
+    {
+    public:
+      typedef QuadEdgePointConstIterator      Self;
+      typedef QuadEdgeBaseIterator< const E > Superclass;
+      typedef E                               TQuadEdge;
+
+    public:
+      QuadEdgePointConstIterator(
+        const E* e = NULL, int op = Superclass::OpOnext, bool start = true
+        );
+      virtual ~QuadEdgePointConstIterator( );
+      const typename E::TPrimalGeometry& operator*( ) const;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/QuadEdgeIterators.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdgeIterators.hxx b/lib/cpExtensions/DataStructures/QuadEdgeIterators.hxx
new file mode 100644 (file)
index 0000000..3255e0d
--- /dev/null
@@ -0,0 +1,275 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__HXX__
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+QuadEdgeBaseIterator( E* e, int op, bool start )
+  : m_StartEdge( e ),
+    m_Iterator( e ),
+    m_OpType( op ),
+    m_Start( start )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+~QuadEdgeBaseIterator( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+typename cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+Self& cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator=( const Self& r )
+{
+  if( this != &r )
+  {
+    this->m_StartEdge = r.m_StartEdge;
+    this->m_Iterator = r.m_Iterator;
+    this->m_OpType = r.m_OpType;
+    this->m_Start = r.m_Start;
+
+  } // fi
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+E* cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+GetStartEdge( ) const
+{
+  return( this->m_StartEdge );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+E* cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+GetIterator( ) const
+{
+  return( this->m_Iterator );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+int cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+GetOpType( ) const
+{
+  return( this->m_OpType );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+bool cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+GetStart( ) const
+{
+  return( this->m_Start );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+bool cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator==( Self& r )
+{
+  return(
+    ( this->m_StartEdge == r.m_StartEdge ) &&
+    ( this->m_Iterator  == r.m_Iterator ) &&
+    ( this->m_OpType    == r.m_OpType ) &&
+    ( this->m_Start     == r.m_Start )
+    );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+bool cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator==( const Self& r ) const
+{
+  return(
+    ( this->m_StartEdge == r.m_StartEdge ) &&
+    ( this->m_Iterator  == r.m_Iterator ) &&
+    ( this->m_OpType    == r.m_OpType ) &&
+    ( this->m_Start     == r.m_Start )
+    );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+bool cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator!=( Self& r )
+{
+  return( !( this->operator==( r ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+bool cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator!=( const Self& r ) const
+{
+  return( !( this->operator==( r ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+typename cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+Self& cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator++( )
+{
+  if( this->m_Start )
+  {
+    this->_GoToNext( );
+    this->m_Start = !( this->m_Iterator == this->m_StartEdge );
+
+  } // fi
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+typename cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+Self& cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+operator++( int )
+{
+  if( this->m_Start )
+  {
+    this->_GoToNext( );
+    this->m_Start = !( this->m_Iterator == this->m_StartEdge );
+
+  } // fi
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+void cpExtensions::DataStructures::QuadEdgeBaseIterator< E >::
+_GoToNext( )
+{
+  switch( this->m_OpType )
+  {
+  case Self::OpOnext:
+    this->m_Iterator = this->m_Iterator->GetOnext( );
+    break;
+  case Self::OpLnext:
+    this->m_Iterator = this->m_Iterator->GetLnext( );
+    break;
+  case Self::OpRnext:
+    this->m_Iterator = this->m_Iterator->GetRnext( );
+    break;
+  case Self::OpDnext:
+    this->m_Iterator = this->m_Iterator->GetDnext( );
+    break;
+  case Self::OpOprev:
+    this->m_Iterator = this->m_Iterator->GetOprev( );
+    break;
+  case Self::OpLprev:
+    this->m_Iterator = this->m_Iterator->GetLprev( );
+    break;
+  case Self::OpRprev:
+    this->m_Iterator = this->m_Iterator->GetRprev( );
+    break;
+  case Self::OpDprev:
+    this->m_Iterator = this->m_Iterator->GetDprev( );
+    break;
+  default:
+    break;
+  } // hctiws
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgeIterator< E >::
+QuadEdgeIterator( E* e, int op, bool start )
+  : Superclass( e, op, start )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgeIterator< E >::
+~QuadEdgeIterator( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+E* cpExtensions::DataStructures::QuadEdgeIterator< E >::
+operator*( )
+{
+  return( this->m_Iterator );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgeConstIterator< E >::
+QuadEdgeConstIterator( const E* e, int op, bool start )
+  : Superclass( e, op, start )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgeConstIterator< E >::
+~QuadEdgeConstIterator( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+const E* cpExtensions::DataStructures::QuadEdgeConstIterator< E >::
+operator*( ) const
+{
+  return( this->m_Iterator );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgePointIterator< E >::
+QuadEdgePointIterator( const E* e, int op, bool start )
+  : Superclass( e, op, start )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgePointIterator< E >::
+~QuadEdgePointIterator( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+typename E::TPrimalGeometry&
+cpExtensions::DataStructures::QuadEdgePointIterator< E >::
+operator*( )
+{
+  return( this->m_Iterator->GetOrigin( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgePointConstIterator< E >::
+QuadEdgePointConstIterator( const E* e, int op, bool start )
+  : Superclass( e, op, start )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+cpExtensions::DataStructures::QuadEdgePointConstIterator< E >::
+~QuadEdgePointConstIterator( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class E >
+const typename E::TPrimalGeometry&
+cpExtensions::DataStructures::QuadEdgePointConstIterator< E >::
+operator*( ) const
+{
+  return( this->m_Iterator->GetOrigin( ) );
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEITERATORS__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdgeMesh.h b/lib/cpExtensions/DataStructures/QuadEdgeMesh.h
new file mode 100644 (file)
index 0000000..40cdf1f
--- /dev/null
@@ -0,0 +1,285 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEMESH__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEMESH__H__
+
+#include <set>
+#include <vector>
+
+#include <itkMesh.h>
+#include <cpExtensions/DataStructures/QuadEdgeCell.h>
+#include <cpExtensions/DataStructures/QuadEdge.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< typename P, unsigned int D = 3, typename T = itk::DefaultStaticMeshTraits< P, D, D > >
+    class QuadEdgeMesh
+      : public itk::Mesh< P, D, T >
+    {
+    public:
+      typedef QuadEdgeMesh                    Self;
+      typedef itk::Mesh< P, D, T >            Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      /// Types from superclass
+      typedef typename
+      Superclass::BoundaryAssignmentsContainer
+      BoundaryAssignmentsContainer;
+
+      typedef typename
+      Superclass::BoundaryAssignmentsContainerPointer
+      BoundaryAssignmentsContainerPointer;
+
+      typedef typename Superclass::BoundingBoxType       BoundingBoxType;
+      typedef typename Superclass::CellAutoPointer       CellAutoPointer;
+      typedef typename Superclass::CellsContainer        CellsContainer;
+      typedef typename Superclass::CellDataContainer     CellDataContainer;
+      typedef typename Superclass::CellFeatureCount      CellFeatureCount;
+      typedef typename Superclass::CellFeatureIdentifier CellFeatureIdentifier;
+      typedef typename Superclass::CellIdentifier        CellIdentifier;
+      typedef typename Superclass::CellLinksContainer    CellLinksContainer;
+      typedef typename Superclass::CellMultiVisitorType  CellMultiVisitorType;
+      typedef typename Superclass::CellPixelType         CellPixelType;
+      typedef typename Superclass::CellType              CellType;
+      typedef typename Superclass::PointIdentifier       PointIdentifier;
+      typedef typename Superclass::PointsContainer       PointsContainer;
+      typedef typename Superclass::PointType             PointType;
+
+      /// QuadEdge types (primal and dual)
+      typedef QuadEdge< PointIdentifier, CellIdentifier > TPrimalEdge;
+      typedef typename TPrimalEdge::TDual                 TDualEdge;
+      typedef QuadEdgeCell< CellType, TPrimalEdge >       TQuadEdgeCell;
+
+      /// Memory management objects
+      typedef std::set< typename TPrimalEdge::Pointer > CntPrimalEdges;
+      typedef std::set< typename TDualEdge::Pointer >   CntDualEdges;
+      typedef std::vector< TPrimalEdge* > CntOnextRings;
+
+      /// More geometry types
+      typedef typename PointType::VectorType      VectorType;
+      typedef typename VectorType::ValueType      TScalar;
+      typedef std::vector< VectorType >           CntNormals;
+      typedef typename CntNormals::const_iterator NormalsIterator;
+
+    protected:
+      typedef std::vector< TPrimalEdge* > _TEdges;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( QuadEdgeMesh, itkMesh );
+
+    public:
+      // Edge related methods
+      TPrimalEdge* FindEdge( const PointIdentifier& a ) const;
+      TPrimalEdge* FindEdge(
+        const PointIdentifier& a, const PointIdentifier& b
+        ) const;
+      TPrimalEdge* FindEntryEdge( const CellIdentifier& i ) const;
+
+      /// New geometric methods
+      const CntNormals& GetPointNormalsContainer( ) const;
+      NormalsIterator BeginPointNormals( ) const;
+      NormalsIterator EndPointNormals( ) const;
+      const VectorType& GetPointNormal( const PointIdentifier& id ) const;
+
+      /// itk::DataObject methods overloading
+      virtual bool RequestedRegionIsOutsideOfTheBufferedRegion( );
+
+      /// itk::PointSet methods overloading
+      virtual void SetPoints( PointsContainer* points );
+      virtual void SetPoint( PointIdentifier id , PointType point );
+
+      /// itk::Mesh methods overloading
+      virtual void PassStructure( Self* inputMesh )
+        {
+          std::cout << "PassStructure" << std::endl;
+          std::exit( 1 );
+        }
+
+      virtual void Initialize( );
+      virtual void Graft( const itk::DataObject* data );
+
+      void SetCellLinks( CellLinksContainer* cellLinks )
+        {
+          std::cout << "SetCellLinks" << std::endl;
+          std::exit( 1 );
+        }
+      virtual CellLinksContainer* GetCellLinks( )
+        {
+          std::cout << "GetCellLinks" << std::endl;
+          std::exit( 1 );
+        }
+      virtual const CellLinksContainer* GetCellLinks( ) const
+        {
+          std::cout << "GetCellLinks (const)" << std::endl;
+          std::exit( 1 );
+        }
+      virtual void SetCells( CellsContainer* cells );
+      virtual void SetCellData( CellDataContainer* data );
+      virtual CellDataContainer* GetCellData( )
+        {
+          std::cout << "GetCellData" << std::endl;
+          std::exit( 1 );
+        }
+      virtual const CellDataContainer* GetCellData( ) const
+        {
+          std::cout << "GetCellData (const)" << std::endl;
+          std::exit( 1 );
+        }
+
+#if !defined( CABLE_CONFIGURATION )
+      virtual void SetBoundaryAssignments(
+        int dimension, BoundaryAssignmentsContainer* container
+        )
+        {
+          std::cout << "SetBoundaryAssignments" << std::endl;
+          std::exit( 1 );
+        }
+      virtual BoundaryAssignmentsContainerPointer
+      GetBoundaryAssignments( int dimension )
+        {
+          std::cout << "GetBoundaryAssignments" << std::endl;
+          std::exit( 1 );
+        }
+      virtual const BoundaryAssignmentsContainerPointer
+      GetBoundaryAssignments( int dimension ) const
+        {
+          std::cout << "GetBoundaryAssignments (const)" << std::endl;
+          std::exit( 1 );
+        }
+#endif
+
+      virtual void SetCell( CellIdentifier id, CellAutoPointer& ptr );
+      virtual void SetCellData( CellIdentifier id, CellPixelType data );
+      virtual bool GetCellData( CellIdentifier id, CellPixelType* data ) const
+        {
+          std::cout << "GetCellData" << std::endl;
+          std::exit( 1 );
+        }
+      virtual void SetBoundaryAssignment(
+        int dimension, CellIdentifier cellId,
+        CellFeatureIdentifier featureId,
+        CellIdentifier boundaryId
+        )
+        {
+          std::cout << "SetBoundaryAssignment" << std::endl;
+          std::exit( 1 );
+        }
+      virtual bool GetBoundaryAssignment(
+        int dimension, CellIdentifier cellId,
+        CellFeatureIdentifier featureId,
+        CellIdentifier* boundaryId
+        ) const
+        {
+          std::cout << "GetBoundaryAssignment" << std::endl;
+          std::exit( 1 );
+        }
+      virtual bool RemoveBoundaryAssignment(
+        int dimension, CellIdentifier cellId,
+        CellFeatureIdentifier featureId
+        )
+        {
+          std::cout << "RemoveBoundaryAssignment" << std::endl;
+          std::exit( 1 );
+        }
+      virtual CellFeatureCount GetNumberOfCellBoundaryFeatures(
+        int dimension,
+        CellIdentifier id
+        ) const
+        {
+          std::cout << "GetNumberOfCellBoundaryFeatures" << std::endl;
+          std::exit( 1 );
+        }
+      virtual bool GetCellBoundaryFeature(
+        int dimension, CellIdentifier id,
+        CellFeatureIdentifier fid,
+        CellAutoPointer& ptr
+        ) const
+        {
+          std::cout << "GetCellBoundaryFeature" << std::endl;
+          std::exit( 1 );
+        }
+      virtual CellIdentifier GetCellBoundaryFeatureNeighbors(
+        int dimension,
+        CellIdentifier id,
+        CellFeatureIdentifier fid,
+        std::set< CellIdentifier >* cellSet )
+        {
+          std::cout << "GetCellBoundaryFeatureNeighbors" << std::endl;
+          std::exit( 1 );
+        }
+      virtual CellIdentifier GetCellNeighbors(
+        CellIdentifier cellId,
+        std::set< CellIdentifier >* cellSet
+        )
+        {
+          std::cout << "GetCellNeighbors" << std::endl;
+          std::exit( 1 );
+        }
+      virtual bool GetAssignedCellBoundaryIfOneExists(
+        int dimension, CellIdentifier id,
+        CellFeatureIdentifier fid,
+        CellAutoPointer& ptr
+        ) const
+        {
+          std::cout << "GetAssignedCellBoundaryIfOneExists" << std::endl;
+          std::exit( 1 );
+        }
+      virtual void BuildCellLinks( ) const;
+
+      virtual void Accept( CellMultiVisitorType* mv ) const
+        {
+          std::cout << "Accept" << std::endl;
+          std::exit( 1 );
+        }
+
+    protected:
+      QuadEdgeMesh( );
+      virtual ~QuadEdgeMesh( );
+
+      virtual void ReleaseCellsMemory( )
+        {
+          std::cout << "ReleaseCellsMemory" << std::endl;
+          std::exit( 1 );
+        }
+
+      inline bool _CheckPoints( const CellAutoPointer& ptr ) const;
+      inline void _DeletePoint( const PointIdentifier& pId );
+      inline TPrimalEdge* _CreateQuadEdge(
+        const PointIdentifier& a, const PointIdentifier& b
+        );
+      inline void _DeleteEdge( TPrimalEdge* edge );
+      inline void _DeleteFace( const CellIdentifier& f );
+      inline void _ConstructEdges(
+        _TEdges& edges, const CellAutoPointer& ptr
+        );
+      virtual VectorType _ComputePointNormal( const TPrimalEdge* e ) const;
+      inline void _ReleaseQuadEdgeObjects( );
+
+    private:
+      QuadEdgeMesh( const Self& );   // Not implemented
+      void operator=( const Self& ); // Not implemented
+
+    protected:
+      CntPrimalEdges m_PrimalEdges;
+      CntDualEdges   m_DualEdges;
+
+      CntOnextRings m_OnextRings;
+
+      CntNormals m_PointNormals;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/QuadEdgeMesh.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEMESH__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/QuadEdgeMesh.hxx b/lib/cpExtensions/DataStructures/QuadEdgeMesh.hxx
new file mode 100644 (file)
index 0000000..e4c5eff
--- /dev/null
@@ -0,0 +1,527 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEMESH__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEMESH__HXX__
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+TPrimalEdge* cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+FindEdge( const PointIdentifier& a ) const
+{
+  if( a < this->m_OnextRings.size( ) )
+    return( this->m_OnextRings[ a ] );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+TPrimalEdge* cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+FindEdge( const PointIdentifier& a, const PointIdentifier& b ) const
+{
+  TPrimalEdge* found = NULL;
+  TPrimalEdge* e = this->FindEdge( a );
+  if( e != NULL )
+  {
+    typename TPrimalEdge::Iterator eIt = e->BeginOnext( );
+    for( ; eIt != e->EndOnext( ) && found == NULL; eIt++ )
+      if( ( *eIt )->GetDestination( ) == b )
+        found = *eIt;
+
+  } // fi
+  return( found );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+TPrimalEdge* cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+FindEntryEdge( const CellIdentifier& i ) const
+{
+  if( i < this->GetNumberOfCells( ) )
+  {
+    CellAutoPointer c;
+    this->GetCell( i, c );
+
+    TQuadEdgeCell* ec = dynamic_cast< TQuadEdgeCell* >( c.GetPointer( ) );
+    if( ec != NULL )
+      return( ec->GetEntryPrimalEdge( ) );
+    else
+      return( NULL );
+  }
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+const typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+CntNormals& cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+GetPointNormalsContainer( ) const
+{
+  return( this->m_PointNormals );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+NormalsIterator cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+BeginPointNormals( ) const
+{
+  return( this->m_PointNormals.begin( ) );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+NormalsIterator cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+EndPointNormals( ) const
+{
+  return( this->m_PointNormals.end( ) );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+const typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+VectorType& cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+GetPointNormal( const PointIdentifier& id ) const
+{
+  static const VectorType zero( TScalar( 0 ) );
+  if( id < this->m_PointNormals.size( ) )
+    return( this->m_PointNormals[ id ] );
+  else
+    return( zero );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+bool cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+RequestedRegionIsOutsideOfTheBufferedRegion( )
+{
+  // Mesh regions don't have meaning with QuadEdges, this is important
+  // in order to guarantee correct pipeline execution
+  return( false );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+SetPoints( PointsContainer* points )
+{
+  this->_ReleaseQuadEdgeObjects( );
+  this->m_OnextRings.resize( points->Size( ), NULL );
+  this->m_PointNormals.resize(
+    points->Size( ), VectorType( TScalar( 0 ) )
+    );
+  this->Superclass::SetPoints( points );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+SetPoint( PointIdentifier id , PointType point )
+{
+  // If the point is brand new, add some non-existent edges and normals
+  unsigned long N = this->GetNumberOfPoints( );
+  N = ( N < id + 1 )? id + 1: N;
+  if( this->m_OnextRings.size( ) < N )
+  {
+    this->m_OnextRings.resize( N, NULL );
+    this->m_PointNormals.resize( N, VectorType( TScalar( 0 ) ) );
+
+  } // fi
+
+  // Ok pass it to itk
+  this->Superclass::SetPoint( id, point );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+Initialize( )
+{
+  this->Superclass::Initialize( );
+  this->_ReleaseQuadEdgeObjects( );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+Graft( const itk::DataObject* data )
+{
+  this->Superclass::Graft( data );
+  const Self* mesh = dynamic_cast< const Self* >( data );
+  if( mesh != NULL )
+  {
+    this->_ReleaseQuadEdgeObjects( );
+    this->m_PrimalEdges    = mesh->m_PrimalEdges;
+    this->m_DualEdges      = mesh->m_DualEdges;
+    this->m_OnextRings     = mesh->m_OnextRings;
+    this->m_PointNormals   = mesh->m_PointNormals;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+SetCells( CellsContainer* cells )
+{
+  // Clear cells
+  if( this->GetCells( ) != NULL )
+    this->SetCells( CellsContainer::New( ) );
+  this->_ReleaseQuadEdgeObjects( );
+  this->m_OnextRings.resize( this->GetNumberOfPoints( ), NULL );
+
+  // Copy cells
+  if( cells != NULL )
+  {
+    for( unsigned long cId = 0; cId < cells->Size( ); ++cId )
+    {
+      CellAutoPointer cell( cells->GetElement( cId ), false );
+      this->SetCell( cId, cell );
+
+    } // rof
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+SetCellData( CellDataContainer* data )
+{
+  /* TODO
+     No need for CellData in initial application:
+     how should this be overridden?
+  */
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+SetCell( CellIdentifier id, CellAutoPointer& ptr )
+{
+  // Overwrite an existing cell?
+  if( id < this->GetNumberOfCells( ) )
+  {
+    itkExceptionMacro(
+      << "TODO: What do I do here? Trying to overwrite a cell!"
+      );
+
+  } // fi
+
+  // Do not allow to add vertices or edges as cells for the sake of
+  // correct mesh construction
+  if( ptr->GetNumberOfPoints( ) < 3 )
+  {
+    itkExceptionMacro(
+      << "Face have less than 3 points ("
+      << ptr->GetNumberOfPoints( )
+      << ")"
+      );
+
+  } // fi
+
+  // Fill up geometrical prerrequisites
+  if( !( this->_CheckPoints( ptr ) ) )
+  {
+    itkExceptionMacro( << "Points missing in the mesh" );
+
+  } // fi
+
+  // Get (or create) individual edges
+  _TEdges edges;
+  this->_ConstructEdges( edges, ptr );
+
+  // Configure new face's geometry
+  edges[ 0 ]->SetLnextRingGeometry( id );
+
+  // Update normals
+  typename _TEdges::const_iterator eIt = edges.begin( );
+  for( ; eIt != edges.end( ); ++eIt )
+    this->m_PointNormals[ ( *eIt )->GetOrigin( ) ] =
+      this->_ComputePointNormal( *eIt );
+
+  // Save cell
+  TQuadEdgeCell* qcell = new TQuadEdgeCell( edges[ 0 ] );
+  CellAutoPointer cell;
+  cell.TakeOwnership( qcell );
+  this->Superclass::SetCell( id, cell );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+SetCellData( CellIdentifier id, CellPixelType data )
+{
+  /* TODO
+     No need for CellData in initial application:
+     how should this be overridden?
+  */
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+BuildCellLinks( ) const
+{
+  // This is no longer required when using QuadEdges
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+QuadEdgeMesh( )
+  : Superclass( )
+{
+  this->_ReleaseQuadEdgeObjects( );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+~QuadEdgeMesh( )
+{
+  this->_ReleaseQuadEdgeObjects( );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+bool cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_CheckPoints( const CellAutoPointer& ptr ) const
+{
+  const typename Superclass::PointsContainer* pnts = this->GetPoints( );
+
+  bool all_exist = true;
+  typename CellType::PointIdConstIterator pIt = ptr->PointIdsBegin( );
+  for( ; pIt != ptr->PointIdsEnd( ) && all_exist; ++pIt )
+    all_exist &= pnts->IndexExists( *pIt );
+  return( all_exist );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_DeletePoint( const PointIdentifier& pId )
+{
+  PointIdentifier lastId = this->GetNumberOfPoints( ) - 1;
+  if( lastId < pId )
+    return;
+
+  // Modify point container
+  PointType to_delete = this->GetPoint( pId );
+  PointType last = this->GetPoint( lastId );
+  this->Superclass::SetPoint( pId, last );
+
+  // Modify Onext ring and normals containers
+  this->m_OnextRings[ pId ] = this->m_OnextRings[ lastId ];
+  this->m_PointNormals[ pId ] = this->m_PointNormals[ lastId ];
+  this->m_OnextRings.pop_back( );
+  this->m_PointNormals.pop_back( );
+
+  // Update origins
+  typename TPrimalEdge::Iterator oIt =
+    this->m_OnextRings[ pId ]->BeginOnext( );
+  for( ; oIt != this->m_OnextRings[ pId ]->EndOnext( ); ++oIt )
+    ( *oIt )->SetOrigin( pId );
+
+  // Erase the point
+  this->GetPoints( )->CastToSTLContainer( ).pop_back( );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+TPrimalEdge* cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_CreateQuadEdge( const PointIdentifier& a, const PointIdentifier& b )
+{
+  // Create brand new object
+  typename TPrimalEdge::Pointer edge = TPrimalEdge::New( );
+  edge->CreateRings( );
+
+  // Configure geometry
+  edge->SetOrigin( a );
+  edge->SetDestination( b );
+
+  // Keep trace of all reserved memory
+  this->m_PrimalEdges.insert( edge );
+  this->m_PrimalEdges.insert( edge->GetSym( ) );
+  this->m_DualEdges.insert( edge->GetRot( ) );
+  this->m_DualEdges.insert( edge->GetInvRot( ) );
+
+  return( edge );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_DeleteEdge( TPrimalEdge* edge )
+{
+  this->m_DualEdges.erase( edge->GetInvRot( ) );
+  this->m_PrimalEdges.erase( edge->GetSym( ) );
+  this->m_DualEdges.erase( edge->GetRot( ) );
+  this->m_PrimalEdges.erase( edge );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_DeleteFace( const CellIdentifier& f )
+{
+  unsigned long cellId = this->GetNumberOfCells( ) - 1;
+  if( cellId < f )
+    return;
+
+  // Exchange desired face with last one
+  CellAutoPointer to_delete, last;
+  this->GetCell( f, to_delete );
+  this->GetCell( cellId, last );
+  this->Superclass::SetCell( f, last );
+  this->Superclass::SetCell( cellId, to_delete );
+
+  // This will delete cell's memory when to_delete is no longer used
+  to_delete.TakeOwnership( );
+
+  // Squeeze container
+  this->GetCells( )->CastToSTLContainer( ).pop_back( );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_ConstructEdges( _TEdges& edges, const CellAutoPointer& ptr )
+{
+  edges.clear( );
+  typename CellType::PointIdConstIterator pIt = ptr->PointIdsBegin( );
+  for( pIt = ptr->PointIdsBegin( ); pIt != ptr->PointIdsEnd( ); ++pIt )
+  {
+    typename CellType::PointIdConstIterator nIt = pIt;
+    ++nIt;
+    if( nIt == ptr->PointIdsEnd( ) )
+      nIt = ptr->PointIdsBegin( );
+
+    TPrimalEdge* edge = this->FindEdge( *pIt, *nIt );
+    if( edge == NULL )
+    {
+      edge = this->_CreateQuadEdge( *pIt, *nIt );
+      if( this->m_OnextRings[ *pIt ] != NULL )
+      {
+        if( this->m_OnextRings[ *pIt ]->IsOriginInternal( ) )
+        {
+          itkExceptionMacro(
+            << "Edge ["
+            << *pIt << ", " << *nIt << "] is already internal."
+            );
+
+        } // fi
+
+        // Put edge in Onext ring
+        typename TPrimalEdge::Iterator eIt =
+          this->m_OnextRings[ *pIt ]->BeginOnext( );
+        while( eIt != this->m_OnextRings[ *pIt ]->EndOnext( ) )
+        {
+          if( !( ( *eIt )->IsLeftSet( ) ) )
+          {
+            TPrimalEdge::Splice( *eIt, edge );
+            eIt = this->m_OnextRings[ *pIt ]->EndOnext( );
+          }
+          else
+            ++eIt;
+
+        } // elihw
+      }
+      else
+        this->m_OnextRings[ *pIt ] = edge;
+    }
+    else
+    {
+      if( edge->IsLeftSet( ) )
+      {
+        itkExceptionMacro(
+          << "Edge ["
+          << edge->GetOrigin( ) << ", "
+          << edge->GetDestination( ) << "] already have a left face ("
+          << edge->GetLeft( )
+          << "). Face already exits (at least in part)."
+          );
+
+      } // fi
+
+    } // fi
+    edges.push_back( edge );
+
+  } // rof
+
+  // Reorder Onext rings
+  typename _TEdges::iterator ecIt;
+  for( ecIt = edges.begin( ); ecIt != edges.end( ); ++ecIt )
+  {
+    TPrimalEdge* e = *ecIt;
+    TPrimalEdge* eOprev;
+    if( ecIt != edges.begin( ) )
+    {
+      typename _TEdges::iterator eOprevIt = ecIt;
+      --eOprevIt;
+      eOprev = ( *eOprevIt )->GetSym( );
+    }
+    else
+      eOprev = edges.back( )->GetSym( );
+    TPrimalEdge::ReorderOnextRing( e, eOprev );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+typename cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+VectorType cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_ComputePointNormal( const TPrimalEdge* e ) const
+{
+  VectorType n( TScalar( 0 ) );
+  if( Superclass::PointDimension == 3 )
+  {
+    PointType p0 = this->GetPoint( e->GetOrigin( ) );
+    typename TPrimalEdge::ConstIterator eIt = e->BeginOnext( );
+    unsigned int count = 0;
+    for( ; eIt != e->EndOnext( ); eIt++ )
+    {
+      if( ( *eIt )->IsLeftSet( ) )
+      {
+        typename TPrimalEdge::ConstIterator nIt = eIt;
+        nIt++;
+        if( nIt == e->EndOnext( ) )
+          nIt = e->BeginOnext( );
+
+        VectorType pe = this->GetPoint( ( *eIt )->GetDestination( ) ) - p0;
+        VectorType pn = this->GetPoint( ( *nIt )->GetDestination( ) ) - p0;
+        n[ 0 ] += ( pe[ 1 ] * pn[ 2 ] ) - ( pe[ 2 ] * pn[ 1 ] );
+        n[ 1 ] += ( pe[ 2 ] * pn[ 0 ] ) - ( pe[ 0 ] * pn[ 2 ] );
+        n[ 2 ] += ( pe[ 0 ] * pn[ 1 ] ) - ( pe[ 1 ] * pn[ 0 ] );
+        count++;
+
+      } // fi
+
+    } // rof
+    TScalar nn = n.GetNorm( );
+    if( nn > TScalar( 0 ) && count > 0 )
+      n /= nn * TScalar( count );
+
+  } // fi
+  return( n );
+}
+
+// -------------------------------------------------------------------------
+template< typename P, unsigned int D, typename T >
+void cpExtensions::DataStructures::QuadEdgeMesh< P, D, T >::
+_ReleaseQuadEdgeObjects( )
+{
+  this->m_PrimalEdges.clear( );
+  this->m_OnextRings.clear( );
+  this->m_DualEdges.clear( );
+  this->m_PointNormals.clear( );
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__QUADEDGEMESH__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/VectorValuesContainer.h b/lib/cpExtensions/DataStructures/VectorValuesContainer.h
new file mode 100644 (file)
index 0000000..eea4e40
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__VECTORVALUESCONTAINER__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__VECTORVALUESCONTAINER__H__
+
+#include <vector>
+#include <itkSimpleDataObjectDecorator.h>
+#include <itkSmartPointer.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< class T >
+    class VectorValuesContainer
+      : public itk::SimpleDataObjectDecorator< std::vector< T > >
+    {
+    public:
+      typedef std::vector< T >                             TDecorated;
+      typedef VectorValuesContainer                        Self;
+      typedef itk::SimpleDataObjectDecorator< TDecorated > Superclass;
+      typedef itk::SmartPointer< Self >                    Pointer;
+      typedef itk::SmartPointer< const Self >              ConstPointer;
+
+      typedef T TValue;
+      typedef typename TDecorated::iterator          Iterator;
+      typedef typename TDecorated::const_iterator    ConstIterator;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( VectorValuesContainer, itkSimpleDataObjectDecorator );
+
+    public:
+      void PushBack( const T& v )
+        { this->Get( ).push_back( v ); this->Modified( ); }
+      void PopBack( const T& v )
+        { this->Get( ).pop_back( ); this->Modified( ); }
+      Iterator Begin( )
+        { return( this->Get( ).begin( ) ); }
+      Iterator End( )
+        { return( this->Get( ).end( ) ); }
+      ConstIterator Begin( ) const
+        { return( this->Get( ).begin( ) ); }
+      ConstIterator End( ) const
+        { return( this->Get( ).end( ) ); }
+
+    protected:
+      VectorValuesContainer( )
+        : Superclass( )
+        { }
+      virtual ~VectorValuesContainer( )
+        { }
+
+    private:
+      // Purposely not implemented
+      VectorValuesContainer( const Self& other );
+      Self& operator=( const Self& other );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__VECTORVALUESCONTAINER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/IO/MementoState.cxx b/lib/cpExtensions/IO/MementoState.cxx
new file mode 100644 (file)
index 0000000..2af5abf
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+#include <cpExtensions/IO/MementoState.h>
+
+
+#include <vtkMetaImageReader.h>
+#include <vtkMetaImageWriter.h>
+#include <future>
+
+
+
+
+
+// -------------------------------------------------------------------------
+cpExtensions::IO::MementoState::MementoState()
+{
+  m_maxId = m_Id = 0;
+  m_stateIt = m_stateReady.begin();
+};
+
+// -------------------------------------------------------------------------
+bool
+cpExtensions::IO::MementoState::SetToMemento(cpPlugins::Interface::Image* _img)
+{
+  char base[] = "state";
+  std::ostringstream oss;
+  this->m_Id;
+  oss << this->m_Id;
+  std::string str = oss.str();
+  auto complement = str.c_str();
+
+  std::string fileName(base);
+  fileName.append(complement);
+  fileName.append(".mhd");
+
+  std::string fileNameRaw(base);
+  fileNameRaw.append(complement);
+  fileNameRaw.append(".raw");
+  //save(fileName, fileNameRaw, _img);
+  m_stateReady.insert(m_stateReady.begin() + m_Id, false);
+  std::async(std::launch::async, &MementoState::Save, this, fileName, fileNameRaw, _img);
+
+  m_stateReady[m_Id] = true;
+  m_Id++;
+
+  if (m_Id > m_maxId)
+  {
+    m_maxId = m_Id;
+  }
+
+  return true;
+}
+
+
+// -------------------------------------------------------------------------
+vtkSmartPointer<vtkImageData>
+cpExtensions::IO::MementoState::GetFromMemento(long id)
+{
+  if (id > m_maxId)
+  {
+    return nullptr;
+  }
+
+  char base[] = "state";
+  std::ostringstream oss;
+  oss << id;
+  std::string str = oss.str();
+  auto complement = str.c_str();
+
+  std::string fileName(base);
+  fileName.append(complement);
+  fileName.append(".mhd");
+  return Load(fileName);
+  //std::future<vtkSmartPointer<vtkImageData>> result(std::async(std::launch::async, &MementoState::Load, this, fileName));
+  //return result.get();
+}
+
+// -------------------------------------------------------------------------
+vtkSmartPointer<vtkImageData>
+cpExtensions::IO::MementoState::MementoUndo()
+{
+  char base[] = "state";
+  std::ostringstream oss;
+  oss << --this->m_Id;
+  std::string str = oss.str();
+  auto complement = str.c_str();
+
+  std::string fileName(base);
+  fileName.append(complement);
+  fileName.append(".mhd");
+
+  if (m_stateReady.at(this->m_Id))
+  {
+    return Load(fileName);
+  }
+
+  return nullptr;
+}
+
+
+vtkSmartPointer<vtkImageData>
+cpExtensions::IO::MementoState::MementoRedo()
+{
+  char base[] = "state";
+  std::ostringstream oss;
+  oss << ++this->m_Id;
+  std::string str = oss.str();
+  auto complement = str.c_str();
+
+  std::string fileName(base);
+  fileName.append(complement);
+  fileName.append(".mhd");
+
+  if (m_stateReady.at(this->m_Id) &&
+    this->m_Id <= this->m_maxId)
+  {
+    return Load(fileName);
+  }
+  return nullptr;
+}
+
+// -------------------------------------------------------------------------
+void
+cpExtensions::IO::MementoState::
+Save(const std::string& filename, const std::string& filenameRaw, cpPlugins::Interface::Image* img) {
+
+  vtkSmartPointer<vtkMetaImageWriter> writer =
+    vtkSmartPointer<vtkMetaImageWriter>::New();
+  writer->SetInputData(img->GetVTK< vtkImageData >());
+  writer->SetFileName(filename.c_str());
+  writer->SetRAWFileName(filenameRaw.c_str());
+  writer->Write();
+}
+
+// -------------------------------------------------------------------------
+vtkSmartPointer<vtkImageData>
+cpExtensions::IO::MementoState::Load(const std::string& filename) {
+
+  vtkSmartPointer<vtkMetaImageReader> reader =
+    vtkSmartPointer<vtkMetaImageReader>::New();
+  reader->SetFileName(filename.c_str());
+
+  reader->Update();
+  return reader->GetOutput();
+
+}
+*/
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/IO/MementoState.h b/lib/cpExtensions/IO/MementoState.h
new file mode 100644 (file)
index 0000000..d7430d3
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef __CPEXTENSIONS__IO__MEMENTOSTATE__H__
+#define __CPEXTENSIONS__IO__MEMENTOSTATE__H__
+
+/*
+#include <cpExtensions/cpExtensions_Export.h>
+
+
+#include <vector>
+
+
+// vtk stuff
+#include <vtkSmartPointer.h>
+#include <cpExtensions/Visualization/MPRObjects.h>
+
+// Plugins interface
+#include <cpPlugins/Interface/Interface.h>
+#include <cpPlugins/Interface/ProcessObject.h>
+#include <cpPlugins/Interface/Image.h>
+#include <cpPlugins/Interface/ImplicitFunction.h>
+#include <cpPlugins/Interface/Mesh.h>
+
+#include <vtkMetaImageReader.h>
+#include <vtkCommand.h>
+
+namespace cpExtensions
+{
+  namespace IO
+  {
+    class cpExtensions_EXPORT MementoState
+    {
+    private:
+      long m_Id;
+      long m_maxId;
+      std::vector<bool> m_stateReady;
+      std::vector<bool>::iterator m_stateIt;
+    public:
+
+      MementoState();
+      bool SetToMemento(cpPlugins::Interface::Image* _img);
+      vtkSmartPointer<vtkImageData> MementoUndo();
+      vtkSmartPointer<vtkImageData> MementoRedo();
+      vtkSmartPointer<vtkImageData> GetFromMemento(long id);
+    private:
+      void Save(const std::string& filename, const std::string& filenameRaw, cpPlugins::Interface::Image* img);
+      vtkSmartPointer<vtkImageData> Load(const std::string& filename);
+
+    };
+  }
+}
+*/
+//==========================================================================
+
+// -------------------------------------------------------------------------
+/**
+ */
+
+
+
+
+
+#endif // __CPEXTENSIONS__IO__MEMENTOSTATE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/IO/MeshReader.h b/lib/cpExtensions/IO/MeshReader.h
new file mode 100644 (file)
index 0000000..af16293
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef __CPEXTENSIONS__IO__MESHREADER__H__
+#define __CPEXTENSIONS__IO__MESHREADER__H__
+
+#include <string>
+#include <itkMeshSource.h>
+
+namespace cpExtensions
+{
+  namespace IO
+  {
+    /**
+     */
+    template< typename M >
+    class MeshReader
+      : public itk::MeshSource< M >
+    {
+    public:
+      typedef MeshReader                      Self;
+      typedef itk::MeshSource< M >            Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef M MeshType;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( MeshReader, itkMeshSource );
+
+      itkSetStringMacro( FileName );
+      itkGetStringMacro( FileName );
+
+    public:
+      virtual itk::ModifiedTimeType GetMTime( ) const;
+
+    protected:
+      MeshReader( );
+      virtual ~MeshReader( );
+
+      virtual void GenerateData( );
+
+      template< class R >
+      void _Read( );
+
+    private:
+      // Purposely not implemented
+      MeshReader( const Self& );
+      Self& operator=( const Self & );
+
+    protected:
+      typename Superclass::Pointer m_Reader;
+      std::string m_FileName;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/IO/MeshReader.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__IO__MESHREADER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/IO/MeshReader.hxx b/lib/cpExtensions/IO/MeshReader.hxx
new file mode 100644 (file)
index 0000000..8146e6e
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef __CPEXTENSIONS__IO__MESHREADER__HXX__
+#define __CPEXTENSIONS__IO__MESHREADER__HXX__
+
+#include <algorithm>
+#include <cpExtensions/IO/WaveFrontOBJReader.h>
+#include <itkVTKPolyDataReader.h>
+
+// -------------------------------------------------------------------------
+template< typename M >
+itk::ModifiedTimeType cpExtensions::IO::MeshReader< M >::
+GetMTime( ) const
+{
+  itk::ModifiedTimeType mtime = this->Superclass::GetMTime( );
+  if( this->m_Reader.IsNotNull( ) )
+  {
+    itk::ModifiedTimeType rtime = this->m_Reader->GetMTime( );
+    mtime = ( rtime < mtime )? rtime: mtime;
+
+  } // fi
+  return( mtime );
+}
+
+// -------------------------------------------------------------------------
+template< typename M >
+cpExtensions::IO::MeshReader< M >::
+MeshReader( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< typename M >
+cpExtensions::IO::MeshReader< M >::
+~MeshReader( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< typename M >
+void cpExtensions::IO::MeshReader< M >::
+GenerateData( )
+{
+  std::string fn = this->m_FileName;
+  std::transform( fn.begin( ), fn.end( ), fn.begin( ), ::tolower );
+  if( fn.rfind( ".vtk" ) != std::string::npos )
+    this->_Read< itk::VTKPolyDataReader< M > >( );
+  else if( fn.rfind( ".obj" ) != std::string::npos )
+    this->_Read< cpExtensions::IO::WaveFrontOBJReader< M > >( );
+}
+
+// -------------------------------------------------------------------------
+template< typename M >
+template< class R >
+void cpExtensions::IO::MeshReader< M >::
+_Read( )
+{
+  typename R::Pointer reader = NULL;
+  if( this->m_Reader.IsNotNull( ) )
+  {
+    reader = dynamic_cast< R* >( this->m_Reader.GetPointer( ) );
+    if( reader.IsNotNull( ) )
+    {
+      if( reader->GetFileName( ) == this->m_FileName )
+        reader = NULL;
+    }
+    else
+    {
+      reader = R::New( );
+      this->m_Reader = reader;
+
+    } // fi
+  }
+  else
+  {
+    reader = R::New( );
+    this->m_Reader = reader;
+
+  } // fi
+
+  if( reader.IsNotNull( ) )
+  {
+    reader->SetFileName( this->m_FileName );
+    reader->GraftOutput( this->GetOutput( ) );
+    reader->Update( );
+    this->GraftOutput( reader->GetOutput( ) );
+
+  } // fi
+}
+
+#endif // __CPEXTENSIONS__IO__MESHREADER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/IO/WaveFrontOBJReader.h b/lib/cpExtensions/IO/WaveFrontOBJReader.h
new file mode 100644 (file)
index 0000000..4cd7446
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef __CPEXTENSIONS__IO__WAVEFRONTOBJREADER__H__
+#define __CPEXTENSIONS__IO__WAVEFRONTOBJREADER__H__
+
+#include <string>
+#include <itkIntTypes.h>
+#include <itkMesh.h>
+#include <itkMeshSource.h>
+#include <itkPolygonCell.h>
+
+namespace cpExtensions
+{
+  namespace IO
+  {
+    /**
+     * \class WaveFrontOBJReader
+     * \brief
+     * Reads a wavefront OBJ file and create an itkMesh.
+     *
+     * Caveat1: itkWaveFrontOBJReader will read only vertices and faces.
+     *          Normal, parameters and textures vectors are ignored.
+     *
+     */
+    template< typename M >
+    class WaveFrontOBJReader
+      : public itk::MeshSource< M >
+    {
+    public:
+      typedef WaveFrontOBJReader              Self;
+      typedef itk::MeshSource< M >            Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef M                                    MeshType;
+      typedef typename M::MeshTraits               MeshTraits;
+      typedef typename M::PointType                PointType;
+      typedef typename MeshTraits::PixelType       PixelType;
+      typedef typename M::Pointer                  MeshPointer;
+      typedef typename M::CellTraits               CellTraits;
+      typedef typename M::CellIdentifier           CellIdentifier;
+      typedef typename M::CellType                 CellType;
+      typedef typename M::CellAutoPointer          CellAutoPointer;
+      typedef typename M::PointIdentifier          PointIdentifier;
+      typedef typename CellTraits::PointIdIterator PointIdIterator;
+      typedef typename M::PointsContainerPointer   PointsContainerPointer;
+      typedef typename M::PointsContainer          PointsContainer;
+
+      typedef itk::PolygonCell< CellType > TPolygonCell;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( WaveFrontOBJReader, itkMeshSource );
+
+      itkSetStringMacro( FileName );
+      itkGetStringMacro( FileName );
+
+    protected:
+      WaveFrontOBJReader( );
+      virtual ~WaveFrontOBJReader( );
+
+      virtual void GenerateData( );
+
+    private:
+      // Purposely not implemented
+      WaveFrontOBJReader( const Self& );
+      Self& operator=( const Self & );
+
+    protected:
+      std::string m_FileName;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/IO/WaveFrontOBJReader.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__IO__WAVEFRONTOBJREADER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/IO/WaveFrontOBJReader.hxx b/lib/cpExtensions/IO/WaveFrontOBJReader.hxx
new file mode 100644 (file)
index 0000000..355f779
--- /dev/null
@@ -0,0 +1,123 @@
+#ifndef __CPEXTENSIONS__IO__WAVEFRONTOBJREADER__HXX__
+#define __CPEXTENSIONS__IO__WAVEFRONTOBJREADER__HXX__
+
+#include <cstdlib>
+#include <fstream>
+#include <sstream>
+
+// -------------------------------------------------------------------------
+template< typename M >
+cpExtensions::IO::WaveFrontOBJReader< M >::
+WaveFrontOBJReader( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< typename M >
+cpExtensions::IO::WaveFrontOBJReader< M >::
+~WaveFrontOBJReader( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< typename M >
+void cpExtensions::IO::WaveFrontOBJReader< M >::
+GenerateData( )
+{
+  typedef typename PointType::ValueType TScalar;
+  typename M::Pointer out = this->GetOutput( );
+
+  out->SetCellsAllocationMethod( M::CellsAllocatedDynamicallyCellByCell );
+  if( this->m_FileName == "" )
+  {
+    itkExceptionMacro( << "No input FileName" );
+
+  } // fi
+
+  std::ifstream in( this->m_FileName.c_str( ) );
+  if( !in.is_open( ) )
+  {
+    itkExceptionMacro(
+      << "Unable to open file" << std::endl
+      << "\"" << m_FileName << "\""
+      );
+
+  } // fi
+
+  in.imbue( std::locale::classic( ) );
+  std::string buffer;
+
+  while( !in.eof( ) )
+  {
+    std::getline( in, buffer, '\n' );
+
+    // Tokenize
+    std::stringstream ss( buffer );
+    std::istream_iterator< std::string > it( ss );
+    std::istream_iterator< std::string > end;
+    std::vector< std::string > line( it, end );
+    if( line.size( ) == 0 )
+      continue;
+
+    // Now, we are talking...
+    if( line[ 0 ] == "v" || line[ 0 ] == "V" )
+    {
+      // Add points
+      PointType pnt;
+      pnt.Fill( TScalar( 0 ) );
+
+      if( line.size( ) > 1 && M::PointDimension >= 1 )
+        pnt[ 0 ] = TScalar( std::atof( line[ 1 ].c_str( ) ) );
+      if( line.size( ) > 2 && M::PointDimension >= 2 )
+        pnt[ 1 ] = TScalar( std::atof( line[ 2 ].c_str( ) ) );
+      if( line.size( ) > 3 && M::PointDimension >= 3 )
+        pnt[ 2 ] = TScalar( std::atof( line[ 3 ].c_str( ) ) );
+      if( M::PointDimension >= 4 )
+      {
+        if( line.size( ) > 4 )
+          pnt[ 3 ] = TScalar( std::atof( line[ 4 ].c_str( ) ) );
+        else
+          pnt[ 4 ] = TScalar( 1 );
+
+      } // fi
+      out->SetPoint( out->GetNumberOfPoints( ), pnt );
+    }
+    else if( line[ 0 ] == "f" || line[ 0 ] == "F" )
+    {
+      if( line.size( ) > 3 )
+      {
+        // Add a face
+        CellAutoPointer cell;
+        TPolygonCell* face = new TPolygonCell( );
+
+        for( unsigned int k = 1; k < line.size( ); ++k )
+        {
+          PointIdentifier pId =
+            PointIdentifier(
+              std::atoi(
+                line[ k ].
+                substr( 0, line[ k ].find_first_of( "/" ) ).c_str( )
+                )
+              );
+
+          // In OBJ files, vertices are numbered from 1
+          face->AddPointId( pId - 1 );
+
+        } // rof
+        cell.TakeOwnership( face );
+        out->SetCell( out->GetNumberOfCells( ), cell );
+
+      } // fi
+
+    } // fi
+
+  } // elihw
+
+  // Finish the job
+  in.close( );
+}
+
+#endif // __CPEXTENSIONS__IO__WAVEFRONTOBJREADER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/BaseInteractorStyle.cxx b/lib/cpExtensions/Interaction/BaseInteractorStyle.cxx
new file mode 100644 (file)
index 0000000..6c0ebbe
--- /dev/null
@@ -0,0 +1,568 @@
+#include <cpExtensions/Interaction/BaseInteractorStyle.h>
+
+#include <cmath>
+
+#include <vtkCallbackCommand.h>
+#include <vtkCamera.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindowInteractor.h>
+
+// -------------------------------------------------------------------------
+long cpExtensions::Interaction::BaseInteractorStyle::_TMouseButtonEvent::
+MaxDoubleClick = 350; // ms
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+SetSetDoubleClickDelay( long delay )
+{
+  Self::_TMouseButtonEvent::MaxDoubleClick = delay;
+}
+
+// -------------------------------------------------------------------------
+vtkObject* cpExtensions::Interaction::BaseInteractorStyle::
+GetAssociatedObject( )
+{
+  return( this->m_AssociatedObject );
+}
+
+// -------------------------------------------------------------------------
+const vtkObject* cpExtensions::Interaction::BaseInteractorStyle::
+GetAssociatedObject( ) const
+{
+  return( this->m_AssociatedObject );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+SetAssociatedObject( vtkObject* obj )
+{
+  if( this->m_AssociatedObject != obj )
+  {
+    this->m_AssociatedObject = obj;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+DelegateTDxEvent( unsigned long event, void* calldata )
+{
+  // TODO
+  std::cerr << "No TDx support at this time!" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnMouseMove( )
+{
+  // Get current position on the associated actors
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Get modifiers
+  bool alt = ( rwi->GetAltKey( ) == 1 );
+  bool ctr = ( rwi->GetControlKey( ) == 1 );
+  bool sft = ( rwi->GetShiftKey( ) == 1 );
+  ButtonID button = this->GetButtonID( );
+
+  // Invoke possible generic events
+  if( button == Self::ButtonID_Right )
+  {
+    if( !alt && !ctr && !sft )
+    {
+      this->FindPokedRenderer(
+        rwi->GetEventPosition( )[ 0 ],
+        rwi->GetEventPosition( )[ 1 ]
+        );
+      this->Dolly( );
+
+    } // fi
+  }
+  else if( button == Self::ButtonID_Middle )
+  {
+    if( !alt && !ctr && !sft )
+    {
+      this->FindPokedRenderer(
+        rwi->GetEventPosition( )[ 0 ],
+        rwi->GetEventPosition( )[ 1 ]
+        );
+      this->Pan( );
+
+    } // fi
+
+  } // fi
+
+  // Get mouse pointer position
+  static int idx[ 2 ];
+  static double pos[ 3 ];
+  if( !( this->_PickPosition( idx, pos ) ) )
+    return;
+
+  // Invoke possible specialized events
+  auto i = this->m_MouseMoveCommands.begin( );
+  for( ; i != this->m_MouseMoveCommands.end( ); ++i )
+    i->first( i->second, button, idx, pos, alt, ctr, sft );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnMouseWheelForward( )
+{
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Invoke possible events
+  auto i = this->m_MouseWheelCommands.begin( );
+  for( ; i != this->m_MouseWheelCommands.end( ); ++i )
+    i->first(
+      i->second, 1,
+      rwi->GetAltKey( ) == 1,
+      rwi->GetControlKey( ) == 1,
+      rwi->GetShiftKey( ) == 1
+      );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnMouseWheelBackward( )
+{
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Invoke possible events
+  auto i = this->m_MouseWheelCommands.begin( );
+  for( ; i != this->m_MouseWheelCommands.end( ); ++i )
+    i->first(
+      i->second, -1,
+      rwi->GetAltKey( ) == 1,
+      rwi->GetControlKey( ) == 1,
+      rwi->GetShiftKey( ) == 1
+      );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnLeftButtonDown( )
+{
+  this->m_ActiveButton = Self::ButtonID_Left;
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnLeftButtonUp( )
+{
+  this->m_ActiveButton = Self::ButtonID_None;
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnMiddleButtonDown( )
+{
+  this->m_ActiveButton = Self::ButtonID_Middle;
+
+  // Get current position on the associated actors
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Get modifiers
+  bool alt = ( rwi->GetAltKey( ) == 1 );
+  bool ctr = ( rwi->GetControlKey( ) == 1 );
+  bool sft = ( rwi->GetShiftKey( ) == 1 );
+
+  if( !alt && !ctr && !sft )
+    this->StartPan( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnMiddleButtonUp( )
+{
+  this->m_ActiveButton = Self::ButtonID_None;
+
+  // Get current position on the associated actors
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Get modifiers
+  bool alt = ( rwi->GetAltKey( ) == 1 );
+  bool ctr = ( rwi->GetControlKey( ) == 1 );
+  bool sft = ( rwi->GetShiftKey( ) == 1 );
+
+  switch( this->State )
+  {
+  case VTKIS_PAN:
+    this->EndPan( );
+    break;
+  default:
+    break;
+  } // hctiws
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnRightButtonDown( )
+{
+  this->m_ActiveButton = Self::ButtonID_Right;
+
+  // Get current position on the associated actors
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Get modifiers
+  bool alt = ( rwi->GetAltKey( ) == 1 );
+  bool ctr = ( rwi->GetControlKey( ) == 1 );
+  bool sft = ( rwi->GetShiftKey( ) == 1 );
+
+  if( !alt && !ctr && !sft )
+    this->StartDolly( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnRightButtonUp( )
+{
+  this->m_ActiveButton = Self::ButtonID_None;
+
+  // Get current position on the associated actors
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Get modifiers
+  bool alt = ( rwi->GetAltKey( ) == 1 );
+  bool ctr = ( rwi->GetControlKey( ) == 1 );
+  bool sft = ( rwi->GetShiftKey( ) == 1 );
+
+  switch( this->State )
+  {
+  case VTKIS_DOLLY:
+    this->EndDolly( );
+    break;
+  default:
+    break;
+  } // hctiws
+}
+
+// -------------------------------------------------------------------------
+#define cpExtensions_BaseInteractorStyle_Click( S, T )          \
+  void cpExtensions::Interaction::BaseInteractorStyle::         \
+  On##S##T( )                                                   \
+  {                                                             \
+    vtkRenderWindowInteractor* rwi = this->GetInteractor( );    \
+    if( rwi == NULL )                                           \
+      return;                                                   \
+    static int idx[ 2 ];                                        \
+    static double pos[ 3 ];                                     \
+    if( !( this->_PickPosition( idx, pos ) ) )                  \
+      return;                                                   \
+    auto i = this->m_Mouse##T##Commands.begin( );               \
+    for( ; i != this->m_Mouse##T##Commands.end( ); ++i )        \
+      i->first(                                                 \
+        i->second,                                              \
+        Self::ButtonID_##S,                                     \
+        idx, pos,                                               \
+        rwi->GetAltKey( ) == 1,                                 \
+        rwi->GetControlKey( ) == 1,                             \
+        rwi->GetShiftKey( ) == 1                                \
+        );                                                      \
+  }
+
+cpExtensions_BaseInteractorStyle_Click( Left, Click );
+cpExtensions_BaseInteractorStyle_Click( Middle, Click );
+cpExtensions_BaseInteractorStyle_Click( Right, Click );
+cpExtensions_BaseInteractorStyle_Click( Left, DoubleClick );
+cpExtensions_BaseInteractorStyle_Click( Middle, DoubleClick );
+cpExtensions_BaseInteractorStyle_Click( Right, DoubleClick );
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+OnChar( )
+{
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return;
+
+  // Invoke possible events
+  auto i = this->m_KeyCommands.begin( );
+  for( ; i != this->m_KeyCommands.end( ); ++i )
+    i->first( i->second, rwi->GetKeyCode( ) );
+}
+
+// -------------------------------------------------------------------------
+#define cpExtensions_BaseInteractorStyle_Global( N )            \
+  void cpExtensions::Interaction::BaseInteractorStyle::         \
+  On##N( )                                                      \
+  {                                                             \
+    vtkRenderWindowInteractor* rwi = this->GetInteractor( );    \
+    if( rwi == NULL )                                           \
+      return;                                                   \
+    auto i = this->m_##N##Commands.begin( );                    \
+    for( ; i != this->m_##N##Commands.end( ); ++i )             \
+      i->first( i->second );                                    \
+  }
+
+cpExtensions_BaseInteractorStyle_Global( Expose );
+cpExtensions_BaseInteractorStyle_Global( Configure );
+cpExtensions_BaseInteractorStyle_Global( Enter );
+cpExtensions_BaseInteractorStyle_Global( Leave );
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+Dolly( )
+{
+  if( this->CurrentRenderer == NULL )
+    return;
+
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  double *center = this->CurrentRenderer->GetCenter( );
+  int dy = rwi->GetEventPosition( )[ 1 ] - rwi->GetLastEventPosition( )[ 1 ];
+  double dyf = this->m_MotionFactor * dy / center[ 1 ];
+  this->_Dolly( std::pow( 1.1, dyf ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+Pan( )
+{
+  if( this->CurrentRenderer == NULL )
+    return;
+
+  vtkRenderWindowInteractor* rwi = this->Interactor;
+  double viewFocus[ 4 ], focalDepth, viewPoint[ 3 ];
+  double newPickPoint[ 4 ], oldPickPoint[ 4 ], motionVector[ 3 ];
+
+  // Calculate the focal depth since we'll be using it a lot
+  vtkCamera* camera = this->CurrentRenderer->GetActiveCamera( );
+  camera->GetFocalPoint( viewFocus );
+  this->ComputeWorldToDisplay(
+    viewFocus[ 0 ], viewFocus[ 1 ], viewFocus[ 2 ], viewFocus
+    );
+  focalDepth = viewFocus[ 2 ];
+  this->ComputeDisplayToWorld(
+    rwi->GetEventPosition( )[ 0 ],
+    rwi->GetEventPosition( )[ 1 ],
+    focalDepth,
+    newPickPoint
+    );
+
+  // Has to recalc old mouse point since the viewport has moved,
+  // so can't move it outside the loop
+  this->ComputeDisplayToWorld(
+    rwi->GetLastEventPosition( )[ 0 ],
+    rwi->GetLastEventPosition( )[ 1 ],
+    focalDepth,
+    oldPickPoint
+    );
+
+  // Camera motion is reversed
+  motionVector[ 0 ] = oldPickPoint[ 0 ] - newPickPoint[ 0 ];
+  motionVector[ 1 ] = oldPickPoint[ 1 ] - newPickPoint[ 1 ];
+  motionVector[ 2 ] = oldPickPoint[ 2 ] - newPickPoint[ 2 ];
+
+  camera->GetFocalPoint( viewFocus );
+  camera->GetPosition( viewPoint );
+  camera->SetFocalPoint(
+    motionVector[ 0 ] + viewFocus[ 0 ],
+    motionVector[ 1 ] + viewFocus[ 1 ],
+    motionVector[ 2 ] + viewFocus[ 2 ]
+    );
+  camera->SetPosition(
+    motionVector[ 0 ] + viewPoint[ 0 ],
+    motionVector[ 1 ] + viewPoint[ 1 ],
+    motionVector[ 2 ] + viewPoint[ 2 ]
+    );
+  if( rwi->GetLightFollowCamera( ) )
+    this->CurrentRenderer->UpdateLightsGeometryToFollowCamera( );
+  rwi->Render( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::BaseInteractorStyle::
+BaseInteractorStyle( )
+  : Superclass( ),
+    m_AssociatedObject( NULL ),
+    m_MotionFactor( double( 10 ) )
+{
+  this->m_LeftButtonEvent.Reset( );
+  this->m_MiddleButtonEvent.Reset( );
+  this->m_RightButtonEvent.Reset( );
+  this->m_ActiveButton = Self::ButtonID_None;
+
+  this->EventCallbackCommand->SetCallback( Self::_ProcessEvents );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::BaseInteractorStyle::
+~BaseInteractorStyle( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+_Dolly( double factor )
+{
+  if( this->CurrentRenderer == NULL )
+    return;
+
+  vtkCamera* camera = this->CurrentRenderer->GetActiveCamera( );
+  if( camera->GetParallelProjection( ) == 0 )
+  {
+    camera->Dolly( factor );
+    if( this->AutoAdjustCameraClippingRange )
+      this->CurrentRenderer->ResetCameraClippingRange( );
+  }
+  else
+    camera->SetParallelScale( camera->GetParallelScale( ) / factor );
+  if( this->Interactor->GetLightFollowCamera( ) )
+    this->CurrentRenderer->UpdateLightsGeometryToFollowCamera( );
+  this->Interactor->Render( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::BaseInteractorStyle::
+_ProcessEvents(
+  vtkObject* object,
+  unsigned long event,
+  void* clientdata,
+  void* calldata
+  )
+{
+  // Get active style and interactor
+  Self* s = reinterpret_cast< Self* >( clientdata );
+  if( s == NULL )
+    return;
+
+  // Process events
+  switch( event )
+  {
+  case vtkCommand::MouseMoveEvent:
+  {
+    s->OnMouseMove( );
+  }
+  break;
+  case vtkCommand::LeftButtonPressEvent:
+  {
+    unsigned char nc = s->m_LeftButtonEvent.Clicks( );
+    if( nc == 2 )
+      s->OnLeftDoubleClick( );
+    else if( nc == 1 )
+      s->OnLeftClick( );
+    s->OnLeftButtonDown( );
+  }
+  break;
+  case vtkCommand::LeftButtonReleaseEvent:
+  {
+    s->m_LeftButtonEvent.Release( );
+    s->OnLeftButtonUp( );
+  }
+  break;
+  case vtkCommand::MiddleButtonPressEvent:
+  {
+    unsigned char nc = s->m_MiddleButtonEvent.Clicks( );
+    if( nc == 2 )
+      s->OnMiddleDoubleClick( );
+    else if( nc == 1 )
+      s->OnMiddleClick( );
+    s->OnMiddleButtonDown( );
+  }
+  break;
+  case vtkCommand::MiddleButtonReleaseEvent:
+  {
+    s->m_MiddleButtonEvent.Release( );
+    s->OnMiddleButtonUp( );
+  }
+  break;
+  case vtkCommand::RightButtonPressEvent:
+  {
+    unsigned char nc = s->m_RightButtonEvent.Clicks( );
+    if( nc == 2 )
+      s->OnRightDoubleClick( );
+    else if( nc == 1 )
+      s->OnRightClick( );
+    s->OnRightButtonDown( );
+  }
+  break;
+  case vtkCommand::RightButtonReleaseEvent:
+  {
+    s->m_RightButtonEvent.Release( );
+    s->OnRightButtonUp( );
+  }
+  break;
+  case vtkCommand::MouseWheelForwardEvent:
+  {
+    s->OnMouseWheelForward( );
+  }
+  break;
+  case vtkCommand::MouseWheelBackwardEvent:
+  {
+    s->OnMouseWheelBackward( );
+  }
+  break;
+  case vtkCommand::KeyPressEvent:
+  {
+    s->OnKeyDown( );
+    s->OnKeyPress( );
+  }
+  break;
+  case vtkCommand::KeyReleaseEvent:
+  {
+    s->OnKeyUp( );
+    s->OnKeyRelease( );
+  }
+  break;
+  case vtkCommand::CharEvent:
+  {
+    s->OnChar( );
+  }
+  break;
+  case vtkCommand::ExposeEvent:
+  {
+    s->OnExpose( );
+  }
+  break;
+  case vtkCommand::ConfigureEvent:
+  {
+    s->OnConfigure( );
+  }
+  break;
+  case vtkCommand::EnterEvent:
+  {
+    s->OnEnter( );
+  }
+  break;
+  case vtkCommand::LeaveEvent:
+  {
+    s->OnLeave( );
+  }
+  break;
+  case vtkCommand::TimerEvent:
+  {
+    // Do nothing
+  }
+  break;
+  case vtkCommand::DeleteEvent:
+  {
+    s->SetInteractor( 0 );
+  }
+  break;
+  case vtkCommand::TDxMotionEvent:
+  case vtkCommand::TDxButtonPressEvent:
+  case vtkCommand::TDxButtonReleaseEvent:
+  {
+    s->DelegateTDxEvent( event, calldata );
+  }
+  break;
+  default:
+    break;
+  } // hctiws
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/BaseInteractorStyle.h b/lib/cpExtensions/Interaction/BaseInteractorStyle.h
new file mode 100644 (file)
index 0000000..30c3ba3
--- /dev/null
@@ -0,0 +1,226 @@
+#ifndef __CPEXTENSIONS__INTERACTION__BASEINTERACTORSTYLE__H__
+#define __CPEXTENSIONS__INTERACTION__BASEINTERACTORSTYLE__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <chrono>
+#include <map>
+#include <utility>
+
+#include <vtkInteractorStyle.h>
+
+/* =========================================================================
+ * Double click algorithm inspired from:
+ * http://www.autohotkey.com/board/topic/56493-easiest-way-to-detect-double-clicks/
+ * =========================================================================
+ */
+
+// -------------------------------------------------------------------------
+#define cpExtensions_BaseInteractorStyle_Commands( C )                  \
+  protected:                                                            \
+  std::map< T##C##Command, void* > m_##C##Commands;                     \
+public:                                                                 \
+  inline void Add##C##Command( T##C##Command c, void* d )               \
+  {                                                                     \
+    if( c != NULL )                                                     \
+    {                                                                   \
+      this->m_##C##Commands[ c ] = d;                                   \
+      this->Modified( );                                                \
+    }                                                                   \
+  }                                                                     \
+  inline void Remove##C##Command( T##C##Command c )                     \
+  {                                                                     \
+    std::map< T##C##Command, void* >::iterator i =                      \
+      this->m_##C##Commands.find( c );                                  \
+    if( i != this->m_##C##Commands.end( ) )                             \
+    {                                                                   \
+      this->m_##C##Commands.erase( i );                                 \
+      this->Modified( );                                                \
+    }                                                                   \
+  }
+
+// -------------------------------------------------------------------------
+#define BaseInteractorStyle_DIFF_TIME                           \
+  std::chrono::duration_cast< std::chrono::milliseconds >(      \
+    std::chrono::system_clock::now( ).time_since_epoch( )       \
+    ).count( )
+
+namespace cpExtensions
+{
+  namespace Interaction
+  {
+    /**
+     */
+    class cpExtensions_EXPORT BaseInteractorStyle
+      : public vtkInteractorStyle
+    {
+    public:
+      typedef BaseInteractorStyle Self;
+      vtkTypeMacro( BaseInteractorStyle, vtkInteractorStyle );
+
+      enum ButtonID
+      {
+        ButtonID_None = 0,
+        ButtonID_Left,
+        ButtonID_Middle,
+        ButtonID_Right
+      };
+
+      // Callbacks types
+      typedef void ( *TMouseCommand )(
+        void*, const ButtonID&, int*, double*, bool, bool, bool
+        );
+      typedef void ( *TMouseWheelCommand )( void*, const int&, bool, bool, bool );
+      typedef void ( *TKeyCommand )( void*, const char& );
+      typedef void ( *TVoidCommand )( void* );
+      typedef TMouseCommand TMouseMoveCommand;
+      typedef TMouseCommand TMouseClickCommand;
+      typedef TMouseCommand TMouseDoubleClickCommand;
+      typedef TVoidCommand  TExposeCommand;
+      typedef TVoidCommand  TConfigureCommand;
+      typedef TVoidCommand  TEnterCommand;
+      typedef TVoidCommand  TLeaveCommand;
+
+      // Associate callbacks for each event
+      cpExtensions_BaseInteractorStyle_Commands( MouseMove );
+      cpExtensions_BaseInteractorStyle_Commands( MouseClick );
+      cpExtensions_BaseInteractorStyle_Commands( MouseDoubleClick );
+      cpExtensions_BaseInteractorStyle_Commands( MouseWheel );
+      cpExtensions_BaseInteractorStyle_Commands( Key );
+      cpExtensions_BaseInteractorStyle_Commands( Expose );
+      cpExtensions_BaseInteractorStyle_Commands( Configure );
+      cpExtensions_BaseInteractorStyle_Commands( Enter );
+      cpExtensions_BaseInteractorStyle_Commands( Leave );
+
+    public:
+      vtkObject* GetAssociatedObject( );
+      const vtkObject* GetAssociatedObject( ) const;
+      void SetAssociatedObject( vtkObject* obj );
+
+      static void SetSetDoubleClickDelay( long delay );
+      void DelegateTDxEvent( unsigned long event, void* calldata );
+
+      // Possible mouse motion events
+      virtual void OnMouseMove( );
+      virtual void OnMouseWheelForward( );
+      virtual void OnMouseWheelBackward( );
+
+      // Possible mouse click-related events
+      inline ButtonID GetButtonID( ) const
+      {
+        return( this->m_ActiveButton );
+      }
+
+      virtual void OnLeftButtonDown( );
+      virtual void OnLeftButtonUp( );
+      virtual void OnMiddleButtonDown( );
+      virtual void OnMiddleButtonUp( );
+      virtual void OnRightButtonDown( );
+      virtual void OnRightButtonUp( );
+
+      virtual void OnLeftClick( );
+      virtual void OnLeftDoubleClick( );
+      virtual void OnMiddleClick( );
+      virtual void OnMiddleDoubleClick( );
+      virtual void OnRightClick( );
+      virtual void OnRightDoubleClick( );
+
+      // Keyboard-related events
+      virtual void OnChar( );
+      virtual void OnKeyDown( )    { }
+      virtual void OnKeyUp( )      { }
+      virtual void OnKeyPress( )   { }
+      virtual void OnKeyRelease( ) { }
+
+      // Other events
+      virtual void OnExpose( );
+      virtual void OnConfigure( );
+      virtual void OnEnter( );
+      virtual void OnLeave( );
+
+      virtual void Dolly( );
+      virtual void Pan( );
+
+    protected:
+      BaseInteractorStyle( );
+      virtual ~BaseInteractorStyle( );
+
+      virtual void _Dolly( double factor );
+
+      // Extension interface
+      virtual bool _PickPosition( int idx[ 2 ], double pos[ 3 ] ) = 0;
+
+      // Main event callback
+      static void _ProcessEvents(
+        vtkObject* object,
+        unsigned long event,
+        void* clientdata,
+        void* calldata
+        );
+
+    private:
+      // Purposely not implemented
+      BaseInteractorStyle( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      vtkObject* m_AssociatedObject;
+      double m_MotionFactor;
+
+      /**
+       * Button events
+       */
+      struct _TMouseButtonEvent
+      {
+        static long MaxDoubleClick;
+        long m_LastButtonUp;
+        long m_LastButtonHeld;
+        long m_LastButtonDown;
+
+        inline _TMouseButtonEvent( )
+          { this->Reset( ); }
+        inline void Reset( )
+          {
+            this->m_LastButtonUp = 0;
+            this->m_LastButtonHeld = 0;
+            this->m_LastButtonDown = -1;
+          }
+        inline void Release( )
+          {
+            long c = BaseInteractorStyle_DIFF_TIME;
+            this->m_LastButtonUp = c;
+            this->m_LastButtonHeld = c - this->m_LastButtonDown;
+            this->m_LastButtonDown = -1;
+          }
+        inline unsigned char Clicks( )
+          {
+            unsigned char n = 0;
+            long c = BaseInteractorStyle_DIFF_TIME;
+            if(
+              this->m_LastButtonHeld < MaxDoubleClick &&
+              ( c - this->m_LastButtonUp ) < MaxDoubleClick
+              )
+            {
+              this->Reset( );
+              n = 2;
+            }
+            else
+              n = 1;
+            if( this->m_LastButtonDown < 0 )
+              this->m_LastButtonDown = c;
+            return( n );
+          }
+      };
+      _TMouseButtonEvent m_LeftButtonEvent;
+      _TMouseButtonEvent m_MiddleButtonEvent;
+      _TMouseButtonEvent m_RightButtonEvent;
+      ButtonID           m_ActiveButton;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__INTERACTION__BASEINTERACTORSTYLE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/ImageInteractorStyle.cxx b/lib/cpExtensions/Interaction/ImageInteractorStyle.cxx
new file mode 100644 (file)
index 0000000..c037193
--- /dev/null
@@ -0,0 +1,168 @@
+#include <cpExtensions/Interaction/ImageInteractorStyle.h>
+
+#include <vtkCommand.h>
+#include <vtkImageActor.h>
+#include <vtkPropCollection.h>
+#include <vtkProperty.h>
+#include <vtkRenderWindowInteractor.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::ImageInteractorStyle::TSeedWidget::
+TSeedWidget( vtkRenderWindowInteractor* interactor, vtkImageActor* actor )
+{
+  this->Placer = vtkSmartPointer< vtkImageActorPointPlacer >::New( );
+  this->Handle = vtkSmartPointer< vtkPointHandleRepresentation3D >::New( );
+  this->Representation = vtkSmartPointer< vtkSeedRepresentation >::New( );
+  this->Widget = vtkSmartPointer< SeedWidget >::New( );
+
+  this->Placer->SetImageActor( actor );
+  this->Handle->GetProperty( )->SetColor( 1, 0, 0 );
+  this->Handle->SetPointPlacer( this->Placer );
+  this->Representation->SetHandleRepresentation( this->Handle );
+  this->Widget->SetRepresentation( this->Representation );
+  this->Widget->SetInteractor( interactor );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::TSeedWidget::
+On( )
+{
+  this->Widget->On( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::TSeedWidget::
+Off( )
+{
+  this->Widget->Off( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::ImageInteractorStyle::
+Self* cpExtensions::Interaction::ImageInteractorStyle::
+New( )
+{
+  return( new Self );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::
+AssociateImageActor( vtkImageActor* actor )
+{
+  if( actor != NULL )
+  {
+    this->m_PropPicker->AddPickList( actor );
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::
+SeedWidgetOn( )
+{
+  if( this->m_SeedWidget != NULL ) delete this->m_SeedWidget;
+
+  this->m_PropPicker->GetPickList( )->InitTraversal( );
+  this->m_SeedWidget = new TSeedWidget(
+    this->Interactor,
+    dynamic_cast< vtkImageActor* >(
+      this->m_PropPicker->GetPickList( )->GetNextProp( )
+      )
+    );
+  this->m_SeedWidget->On( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::
+SeedWidgetOff( )
+{
+  if( this->m_SeedWidget != NULL )
+  {
+    this->m_SeedWidget->Off( );
+    delete this->m_SeedWidget;
+    this->m_SeedWidget = NULL;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::
+SetSeedWidgetCommand( vtkCommand* cmd )
+{
+  if( cmd == NULL || this->m_SeedWidget == NULL )
+    return;
+  this->m_SeedWidget->Widget->
+    AddObserver( vtkCommand::PlacePointEvent, cmd );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Interaction::ImageInteractorStyle::
+GetNumberOfSeeds( ) const
+{
+  if( this->m_SeedWidget != NULL )
+    return( this->m_SeedWidget->Representation->GetNumberOfSeeds( ) );
+  else
+    return( 0 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::
+GetSeedAsPoint( unsigned int id, double pos[ 3 ] ) const
+{
+  if( this->m_SeedWidget != NULL )
+    this->m_SeedWidget->Representation->GetSeedWorldPosition( id, pos );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageInteractorStyle::
+GetSeedAsIndex( unsigned int id, int idx[ 3 ] ) const
+{
+  /* TODO
+     if( this->m_SeedWidget != NULL )
+     this->m_SeedWidget->Representation->GetSeedWorldPosition( id, pos );
+  */
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::ImageInteractorStyle::
+ImageInteractorStyle( )
+  : Superclass( ),
+    m_SeedWidget( NULL )
+{
+  this->m_PropPicker = vtkSmartPointer< vtkPropPicker >::New( );
+  this->m_PropPicker->PickFromListOn( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::ImageInteractorStyle::
+~ImageInteractorStyle( )
+{
+  if( this->m_SeedWidget != NULL ) delete this->m_SeedWidget;
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::Interaction::ImageInteractorStyle::
+_PickPosition( int idx[ 2 ], double pos[ 3 ] )
+{
+  vtkRenderWindowInteractor* rwi = this->GetInteractor( );
+  if( rwi == NULL )
+    return( false );
+
+  // Find the renderer where the event has been raised
+  idx[ 0 ] = rwi->GetEventPosition( )[ 0 ];
+  idx[ 1 ] = rwi->GetEventPosition( )[ 1 ];
+  this->FindPokedRenderer( double( idx[ 0 ] ), double( idx[ 1 ] ) );
+
+  // Pick a 3D position
+  int r = this->m_PropPicker->Pick(
+    double( idx[ 0 ] ), double( idx[ 1 ] ), double( 0 ),
+    this->CurrentRenderer
+    );
+  if( r == 0 )
+    return( false );
+  this->m_PropPicker->GetPickPosition( pos );
+  return( true );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/ImageInteractorStyle.h b/lib/cpExtensions/Interaction/ImageInteractorStyle.h
new file mode 100644 (file)
index 0000000..ec54f5e
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
+#define __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
+
+#include <cpExtensions/Interaction/BaseInteractorStyle.h>
+
+#include <vector>
+
+#include <vtkSmartPointer.h>
+#include <vtkImageActorPointPlacer.h>
+#include <vtkPropPicker.h>
+#include <vtkPointHandleRepresentation3D.h>
+#include <vtkSeedRepresentation.h>
+#include <cpExtensions/Interaction/SeedWidget.h>
+
+// Forward definitions
+class vtkCommand;
+class vtkImageActor;
+
+namespace cpExtensions
+{
+  namespace Interaction
+  {
+    /**
+     */
+    class cpExtensions_EXPORT ImageInteractorStyle
+      : public BaseInteractorStyle
+    {
+    public:
+      typedef ImageInteractorStyle Self;
+      vtkTypeMacro( ImageInteractorStyle, BaseInteractorStyle );
+
+      // Callbacks types
+      typedef Superclass::TMouseCommand            TMouseCommand;
+      typedef Superclass::TMouseWheelCommand       TMouseWheelCommand;
+      typedef Superclass::TKeyCommand              TKeyCommand;
+      typedef Superclass::TVoidCommand             TVoidCommand;
+      typedef Superclass::TMouseMoveCommand        TMouseMoveCommand;
+      typedef Superclass::TMouseClickCommand       TMouseClickCommand;
+      typedef Superclass::TMouseDoubleClickCommand TMouseDoubleClickCommand;
+      typedef Superclass::TExposeCommand           TExposeCommand;
+      typedef Superclass::TConfigureCommand        TConfigureCommand;
+      typedef Superclass::TEnterCommand            TEnterCommand;
+      typedef Superclass::TLeaveCommand            TLeaveCommand;
+
+      // Widgets
+      struct TSeedWidget
+      {
+        vtkSmartPointer< vtkImageActorPointPlacer >              Placer;
+        vtkSmartPointer< vtkPointHandleRepresentation3D >        Handle;
+        vtkSmartPointer< vtkSeedRepresentation >         Representation;
+        vtkSmartPointer< SeedWidget > Widget;
+
+        TSeedWidget(
+          vtkRenderWindowInteractor* interactor, vtkImageActor* actor
+          );
+        void On( );
+        void Off( );
+      };
+
+    public:
+      static Self* New( );
+
+      // Data for local picker
+      virtual void AssociateImageActor( vtkImageActor* actor );
+
+      // Widgets
+      void SeedWidgetOn( );
+      void SeedWidgetOff( );
+      void SetSeedWidgetCommand( vtkCommand* cmd );
+      unsigned int GetNumberOfSeeds( ) const;
+      void GetSeedAsPoint( unsigned int id, double pos[ 3 ] ) const;
+      void GetSeedAsIndex( unsigned int id, int pos[ 3 ] ) const;
+
+    protected:
+      ImageInteractorStyle( );
+      virtual ~ImageInteractorStyle( );
+
+      virtual bool _PickPosition( int idx[ 2 ], double pos[ 3 ] );
+
+    private:
+      // Purposely not implemented
+      ImageInteractorStyle( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      vtkSmartPointer< vtkPropPicker > m_PropPicker;
+
+      TSeedWidget* m_SeedWidget;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/SeedWidget.cxx b/lib/cpExtensions/Interaction/SeedWidget.cxx
new file mode 100644 (file)
index 0000000..73d13a5
--- /dev/null
@@ -0,0 +1,93 @@
+#include <cpExtensions/Interaction/SeedWidget.h>
+
+#include <vtkCallbackCommand.h>
+#include <vtkCommand.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkSeedRepresentation.h>
+#include <vtkWidgetEventTranslator.h>
+#include <vtkWidgetRepresentation.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::SeedWidget::
+Self* cpExtensions::Interaction::SeedWidget::
+New( )
+{
+  return( new Self );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SeedWidget::
+SetInteractor( vtkRenderWindowInteractor* rwi )
+{
+  this->Superclass::SetInteractor( rwi );
+  if( rwi != NULL )
+  {
+    TBaseStyle* s =
+      dynamic_cast< TBaseStyle* >( rwi->GetInteractorStyle( ) );
+    if( s != NULL )
+    {
+      s->AddMouseClickCommand( Self::_Click, this );
+      s->AddMouseDoubleClickCommand( Self::_DoubleClick, this );
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::SeedWidget::
+SeedWidget( )
+  : Superclass( )
+{
+  // Remove default translations
+  vtkWidgetEventTranslator* t = this->GetEventTranslator( );
+  t->RemoveTranslation( vtkCommand::LeftButtonPressEvent );
+  t->RemoveTranslation( vtkCommand::MiddleButtonPressEvent );
+  t->RemoveTranslation( vtkCommand::RightButtonPressEvent );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::SeedWidget::
+~SeedWidget( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SeedWidget::
+_Click(
+  void* data, const TBaseStyle::ButtonID& button,
+  int* idx, double* pos, bool alt, bool ctr, bool sft
+  )
+{
+  SeedWidget* self = reinterpret_cast< SeedWidget* >( data );
+  if( self == NULL )
+    return;
+  if( self->WidgetState == vtkSeedWidget::MovingSeed )
+    return;
+
+  int st = self->WidgetRep->ComputeInteractionState( idx[ 0 ], idx[ 1 ] );
+  if( st == vtkSeedRepresentation::NearSeed )
+  {
+    self->WidgetState = vtkSeedWidget::MovingSeed;
+
+    // Invoke an event on ourself for the handles
+    self->InvokeEvent( vtkCommand::LeftButtonPressEvent, NULL );
+    self->Superclass::StartInteraction( );
+    self->InvokeEvent( vtkCommand::StartInteractionEvent, NULL );
+    self->EventCallbackCommand->SetAbortFlag( 1 );
+    self->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SeedWidget::
+_DoubleClick(
+  void* data, const TBaseStyle::ButtonID& button,
+  int* idx, double* pos, bool alt, bool ctr, bool sft
+  )
+{
+  Self::AddPointAction( reinterpret_cast< vtkAbstractWidget* >( data ) );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/SeedWidget.h b/lib/cpExtensions/Interaction/SeedWidget.h
new file mode 100644 (file)
index 0000000..526ac7e
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef __CPEXTENSIONS__INTERACTION__SEEDWIDGET__H__
+#define __CPEXTENSIONS__INTERACTION__SEEDWIDGET__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions/Interaction/BaseInteractorStyle.h>
+#include <vtkSeedWidget.h>
+
+namespace cpExtensions
+{
+  namespace Interaction
+  {
+    /**
+     */
+    class cpExtensions_EXPORT SeedWidget
+      : public vtkSeedWidget
+    {
+    public:
+      typedef SeedWidget Self;
+      vtkTypeMacro( SeedWidget, vtkSeedWidget );
+
+      typedef cpExtensions::Interaction::BaseInteractorStyle TBaseStyle;
+      typedef TBaseStyle::TMouseCommand TMouseCommand;
+
+    public:
+      static Self* New( );
+
+      virtual void SetInteractor( vtkRenderWindowInteractor* rwi );
+
+    protected:
+      SeedWidget( );
+      virtual ~SeedWidget( );
+
+      static void _Click(
+        void* data, const TBaseStyle::ButtonID& button,
+        int* idx, double* pos, bool alt, bool ctr, bool sft
+        );
+      static void _DoubleClick(
+        void* data, const TBaseStyle::ButtonID& button,
+        int* idx, double* pos, bool alt, bool ctr, bool sft
+        );
+
+    private:
+      // Purposely not implemented
+      SeedWidget( const Self& );
+      Self& operator=( const Self& );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__INTERACTION__SEEDWIDGET__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/SphereWidget.cxx b/lib/cpExtensions/Interaction/SphereWidget.cxx
new file mode 100644 (file)
index 0000000..882c3ca
--- /dev/null
@@ -0,0 +1,263 @@
+#include <cpExtensions/Interaction/SphereWidget.h>
+
+#include <vtkCallbackCommand.h>
+#include <vtkCommand.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkSeedRepresentation.h>
+#include <vtkWidgetEventTranslator.h>
+#include <vtkWidgetRepresentation.h>
+#include <vtkActor.h>
+#include <vtkSphereRepresentation.h>
+#include <vtkSmartPointer.h>
+#include <vtkSphere.h>
+#include <vtkProperty.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::SphereWidget::
+Self* cpExtensions::Interaction::SphereWidget::
+New()
+{
+  return(new Self);
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SphereWidget::
+SetInteractor(vtkRenderWindowInteractor* rwi)
+{
+  this->Superclass::SetInteractor(rwi);
+  TBaseStyle* s = dynamic_cast<TBaseStyle*>(rwi->GetInteractorStyle());
+  if (s != NULL)
+  {    
+    s->AddKeyCommand(Self::_KeyPress, this);
+    s->AddMouseMoveCommand(Self::_MouseMove, this);
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::SphereWidget::
+SphereWidget()
+: Superclass()
+{
+  //this->SetAxis(0);
+
+  this->SetTranslation(0);
+  this->SetRadius(7);
+
+  this->SetPhiResolution(10);
+  this->SetThetaResolution(20);
+
+  this->SetRepresentationToWireframe();
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Interaction::SphereWidget::
+~SphereWidget()
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SphereWidget::
+_Click(
+void* data, const TBaseStyle::ButtonID& button,
+int* idx, double* pos, bool alt, bool ctr, bool sft
+)
+{
+  SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  self->Superclass::EndInteraction();
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SphereWidget::
+_DoubleClick(
+void* data, const TBaseStyle::ButtonID& button,
+int* idx, double* pos, bool alt, bool ctr, bool sft
+)
+{
+
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SphereWidget::
+_MouseMove(
+void* data, const TBaseStyle::ButtonID& button,
+int* idx, double* pos, bool alt, bool ctr, bool sft
+)
+{
+  /*SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  self->Superclass::StartInteraction();*/
+}
+
+void cpExtensions::Interaction::SphereWidget::SetAxis(int axis)
+{
+  this->m_axis = axis;
+}
+
+
+void cpExtensions::Interaction::SphereWidget::SetAxis(void* data, int axis)
+{
+  SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  self->SetAxis(axis);
+}
+
+int cpExtensions::Interaction::SphereWidget::GetAxis()
+{
+  return this->m_axis;
+}
+
+int cpExtensions::Interaction::SphereWidget::GetAxis(void* data)
+{
+  SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  return self->GetAxis();
+}
+
+double* cpExtensions::Interaction::SphereWidget::GetPosition()
+{
+  return this->SphereActor->GetPosition();
+}
+
+double* cpExtensions::Interaction::SphereWidget::GetPosition(void* data)
+{
+  SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  return self->GetPosition();
+}
+
+void cpExtensions::Interaction::SphereWidget::SetCenter(double * center)
+{
+  //this->Superclass::SetCenter(center);
+  this->SphereActor->SetPosition(center);
+  this->SphereActor->Modified();
+  this->Modified();
+  this->GetInteractor()->Render();
+}
+
+void cpExtensions::Interaction::SphereWidget::SetCenter(void* data, double * center)
+{
+  SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  
+  //self->Superclass::SetCenter(center);
+  self->SphereActor->SetPosition(center);
+  self->SphereActor->Modified();
+  self->Modified();
+  self->GetInteractor()->Render();
+
+  std::cout << "sphere: {" << center[0] << " , " << center[1] << " , " << center[2] << "} " << std::endl;
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::SphereWidget::_KeyPress(void* data, const char& key)
+{
+  SphereWidget* self = reinterpret_cast<SphereWidget*>(data);
+  self->Superclass::StartInteraction();
+
+  double * center = self->SphereActor->GetPosition();
+
+  auto radius = self->GetRadius();
+
+  auto axis = self->GetAxis();
+
+  switch (key)
+  {
+  case 122: // Z & z
+  case 90:
+    radius += 0.1;
+   
+    break;
+  case 88:  // X & x
+  case 120:
+    radius -= 0.1;
+   
+    break;
+  case 119: // W & w
+  case 87:
+    if (axis == 0)
+    {
+      center[2] += 1;
+    } else if (axis == 1)
+    {
+      center[2] += 1;
+    } else
+    {
+      center[1] -= 1;
+    }
+   
+   
+    break;
+  case 83: // S & s
+  case 115:
+    if (axis == 0)
+    {
+      center[2] -= 1;
+    }
+    else if (axis == 1)
+    {
+      center[2] -= 1;
+    }
+    else
+    {
+      center[1] += 1;
+    }
+   
+    break;
+  case 65: // A & a
+  case 97:
+    if (axis == 0)
+    {
+      center[1] -= 1;
+    }
+    else if (axis == 1)
+    {
+      center[0] -= 1;
+    }
+    else
+    {
+      center[0] += 1;
+    }
+   
+    break;
+  case 100: // D & d
+  case 68:
+    if (axis == 0)
+    {
+      center[1] += 1;
+    }
+    else if (axis == 1)
+    {
+      center[0] += 1;
+    }
+    else
+    {
+      center[0] -= 1;
+    }
+   
+    break;
+  //case 81: // Q & q
+  //case 113:
+  //  center[2] += 1;
+  //
+  //  break;
+  //case 69: // E & e
+  //case 101:
+  //  center[2] -= 1;
+  //
+  //  break;
+
+  default:
+    break;
+  }
+
+
+  self->SetRadius(radius);
+  self->SetCenter(data, center);
+  self->Modified();
+  self->GetInteractor()->Render();
+  self->EndInteraction();
+}
+
+
+
+
+
+
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Interaction/SphereWidget.h b/lib/cpExtensions/Interaction/SphereWidget.h
new file mode 100644 (file)
index 0000000..9afae7c
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef __CPEXTENSIONS__INTERACTION__SphereWidget__H__
+#define __CPEXTENSIONS__INTERACTION__SphereWidget__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions/Interaction/BaseInteractorStyle.h>
+#include <vtkSphereWidget.h>
+
+namespace cpExtensions
+{
+  namespace Interaction
+  {
+    /**
+     */
+    class cpExtensions_EXPORT SphereWidget
+      : public vtkSphereWidget
+    {
+    public:
+      typedef SphereWidget Self;
+      vtkTypeMacro( SphereWidget, vtkSphereWidget );
+
+      typedef cpExtensions::Interaction::BaseInteractorStyle TBaseStyle;
+      typedef TBaseStyle::TMouseCommand TMouseCommand;
+      typedef TBaseStyle::TKeyCommand TKeyCommand;
+
+    public:
+      static Self* New( );
+
+      virtual void SetInteractor( vtkRenderWindowInteractor* rwi );
+      void SetCenter(double* center);
+      void SetAxis(int axis);
+      int GetAxis();
+      double * GetPosition();
+    protected:
+      SphereWidget( );
+      virtual ~SphereWidget( );
+
+      static void _Click(
+        void* data, const TBaseStyle::ButtonID& button,
+        int* idx, double* pos, bool alt, bool ctr, bool sft
+        );
+      static void _DoubleClick(
+        void* data, const TBaseStyle::ButtonID& button,
+        int* idx, double* pos, bool alt, bool ctr, bool sft
+        );
+      static void _MouseMove(
+        void* data, const TBaseStyle::ButtonID& button,
+        int* idx, double* pos, bool alt, bool ctr, bool sft
+        );
+     
+      static void _KeyPress(void* data, const char& key);
+       
+      static void SetCenter(void* data, double* center);
+
+      static void SetAxis(void* data, int axis);
+      static int GetAxis(void* data);
+      static double * GetPosition(void* data);
+    private:
+      int m_axis;
+
+      // Purposely not implemented
+      SphereWidget( const Self& );
+      Self& operator=( const Self& );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__INTERACTION__SphereWidget__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.cxx b/lib/cpExtensions/QT/SimpleMPRWidget.cxx
new file mode 100644 (file)
index 0000000..62b9296
--- /dev/null
@@ -0,0 +1,622 @@
+#include <cpExtensions/QT/SimpleMPRWidget.h>
+
+#ifdef cpExtensions_QT4
+
+#include <cpExtensions/ui_SimpleMPRWidget.h>
+
+#include <vtkProperty.h>
+#include <vtkRendererCollection.h>
+
+double cpExtensions::QT::SimpleMPRWidget::
+cm_Colors[ 8 ][ 3 ] =
+{
+  { 1.0, 0.0, 0.0 },
+  { 0.0, 1.0, 0.0 },
+  { 0.0, 0.0, 1.0 },
+  { 0.0, 1.0, 1.0 },
+  { 1.0, 0.0, 1.0 },
+  { 1.0, 1.0, 0.0 },
+  { 1.0, 0.5, 0.0 },
+  { 1.0, 0.0, 0.5 }
+};
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::
+SimpleMPRWidget( QWidget* parent )
+  : QWidget( parent ),
+    m_UI( new Ui::SimpleMPRWidget ),
+    m_MainImage( "" )
+{
+  this->m_UI->setupUi( this );
+
+  // Configure VTK widgets
+  this->m_VTK[ 0 ] = this->m_UI->VTK01;
+  this->m_VTK[ 1 ] = this->m_UI->VTK00;
+  this->m_VTK[ 2 ] = this->m_UI->VTK10;
+  this->m_VTK[ 3 ] = this->m_UI->VTK11;
+
+  this->m_MPRObjects = vtkSmartPointer< TMPRObjects >::New( );
+  this->m_MPRObjects->SetRenderWindows(
+    this->m_VTK[ 0 ]->GetRenderWindow( ),
+    this->m_VTK[ 1 ]->GetRenderWindow( ),
+    this->m_VTK[ 2 ]->GetRenderWindow( ),
+    this->m_VTK[ 3 ]->GetRenderWindow( )
+    );
+
+  // Connect slots
+  QObject::connect(
+    this->m_UI->TopSplitter, SIGNAL( splitterMoved( int, int ) ),
+    this, SLOT( _SyncBottom( int, int ) )
+    );
+  QObject::connect(
+    this->m_UI->BottomSplitter, SIGNAL( splitterMoved( int, int ) ),
+    this, SLOT( _SyncTop( int, int ) )
+    );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::
+~SimpleMPRWidget( )
+{
+  delete this->m_UI;
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::QT::SimpleMPRWidget::
+GetNumberOfData( ) const
+{
+  return( this->m_Data.size( ) );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::SimpleMPRWidget::
+AddData(
+  vtkImageData* data, const std::string& name,
+  const std::string& parent
+  )
+{
+  if( name == "" )
+    return( false );
+
+  auto iIt = this->m_Data.find( name );
+  if( iIt == this->m_Data.end( ) )
+  {
+    if( parent != "" )
+    {
+      auto pIt = this->m_Data.find( parent );
+      if( pIt == this->m_Data.end( ) )
+        return( false );
+
+    } // fi
+
+    // Add new data
+    this->m_Data[ name ].SetImageData( data );
+
+    // Set color
+    auto iIt = this->m_Data.find( name );
+    if( iIt != this->m_Data.end( ) )
+    {
+      vtkActor* actor =
+        dynamic_cast< vtkActor* >( iIt->second.GetMeshActor( ) );
+      if( actor != NULL )
+      {
+        unsigned int idx = this->m_Data.size( ) % 8;
+        actor->GetProperty( )->SetColor(
+          Self::cm_Colors[ idx ][ 0 ],
+          Self::cm_Colors[ idx ][ 1 ],
+          Self::cm_Colors[ idx ][ 2 ]
+          );
+
+      } // fi
+
+    } // fi
+
+    // Add to tree view
+    // TODO: this->_UpdateTreeItem( name, parent );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::SimpleMPRWidget::
+AddData( vtkPolyData* data, const std::string& name )
+{
+  if( name == "" )
+    return( false );
+
+  auto iIt = this->m_Data.find( name );
+  if( iIt == this->m_Data.end( ) )
+  {
+    // Add new data
+    this->m_Data[ name ].SetPolyData( data );
+
+    // Set color
+    auto iIt = this->m_Data.find( name );
+    if( iIt != this->m_Data.end( ) )
+    {
+      vtkActor* actor =
+        dynamic_cast< vtkActor* >( iIt->second.GetMeshActor( ) );
+      if( actor != NULL )
+      {
+        unsigned int idx = this->m_Data.size( ) % 8;
+        actor->GetProperty( )->SetColor(
+          Self::cm_Colors[ idx ][ 0 ],
+          Self::cm_Colors[ idx ][ 1 ],
+          Self::cm_Colors[ idx ][ 2 ]
+          );
+
+      } // fi
+
+    } // fi
+
+    // Add to tree view
+    // TODO: this->_UpdateTreeItem( name, parent );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+const std::string& cpExtensions::QT::SimpleMPRWidget::
+GetMainImage( ) const
+{
+  return( this->m_MainImage );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::SimpleMPRWidget::
+SetMainImage( const std::string& name )
+{
+  auto iIt = this->m_Data.find( name );
+  if( iIt != this->m_Data.end( ) )
+  {
+    if( iIt->second.Tag == Data::IMAGE )
+    {
+      this->m_MainImage = name;
+      return( true );
+    }
+    else
+      return( false );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+DeleteData( const std::string& name )
+{
+  auto iIt = this->m_Data.find( name );
+  if( iIt != this->m_Data.end( ) )
+  {
+    this->m_Data.erase( iIt );
+
+    // Get children
+    std::vector< std::string > to_erase;
+    auto tIt = this->m_Tree.begin( );
+    for( ; tIt != this->m_Tree.end( ); ++tIt )
+      if( tIt->second == name )
+        to_erase.push_back( tIt->first );
+
+    // Delete from tree
+    tIt = this->m_Tree.find( name );
+    if( tIt != this->m_Tree.end( ) )
+      this->m_Tree.erase( tIt );
+
+    // Recursive erase
+    auto dIt = to_erase.begin( );
+    for( ; dIt != to_erase.end( ); ++dIt )
+      this->DeleteData( *dIt );
+
+    // Delete from tree widget
+    /* TODO
+       QTreeWidgetItem* item = this->_FindItemInTree( name );
+       if( item != NULL )
+       this->m_UI->LoadedData->removeItemWidget( item, 0 );
+    */
+
+    // Reset main image, just in case
+    if( this->m_Data.size( ) == 0 )
+      this->m_MainImage = "";
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+DeleteAllData( )
+{
+  this->m_MPRObjects->Clear( );
+  this->m_Data.clear( );
+  this->m_Tree.clear( );
+  // TODO: this->m_UI->LoadedData->clear( );
+  this->m_MainImage = "";
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetDataColor(
+  const std::string& name, const double& r, const double& g, const double& b
+  )
+{
+  /*
+    auto iIt = this->m_Data.find( name );
+    if( iIt == this->m_Data.end( ) )
+    return;
+
+    if( iIt->second.Tag == Data::IMAGE )
+    {
+    }
+    else if( iIt->second.Tag == Data::MESH )
+    {
+    } // fi
+  */
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+ShowData( const std::string& name )
+{
+  auto iIt = this->m_Data.find( name );
+  if( iIt == this->m_Data.end( ) )
+    return;
+
+  if( iIt->second.Tag == Data::IMAGE )
+  {
+    if( name == this->m_MainImage )
+      this->m_MPRObjects->SetInputImage( iIt->second.Image );
+    else
+    {
+      unsigned int i = ( this->m_MPRObjects->GetNumberOfImages( ) - 1 ) % 8;
+      this->m_MPRObjects->AddBinaryImage(
+        iIt->second.Image,
+        Self::cm_Colors[ i ][ 0 ],
+        Self::cm_Colors[ i ][ 1 ],
+        Self::cm_Colors[ i ][ 2 ]
+        );
+    }
+    this->m_MPRObjects->Show( );
+  }
+  else if( iIt->second.Tag == Data::MESH )
+  {
+    vtkRenderer* ren =
+      this->m_VTK[ 3 ]->GetRenderWindow( )->
+      GetRenderers( )->GetFirstRenderer( );
+    if( ren == NULL )
+      return;
+    ren->AddActor( iIt->second.GetMeshActor( ) );
+    this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+HideData( const std::string& name )
+{
+}
+
+// -------------------------------------------------------------------------
+vtkRenderWindowInteractor* cpExtensions::QT::SimpleMPRWidget::
+GetInteractor( unsigned int i )
+{
+  if( i < 4 )
+  {
+    if( this->m_VTK[ i ] != NULL )
+      return( this->m_VTK[ i ]->GetInteractor( ) );
+    else
+      return( NULL );
+  }
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+/*
+  bool cpExtensions::QT::SimpleMPRWidget::
+  ShowImage(
+  vtkImageData* image,
+  const std::string& name,
+  const std::string& parent
+  )
+  {
+  // Update tree view
+  QTreeWidgetItem* new_item = this->_UpdateTreeItem( name, parent );
+  if( new_item == NULL )
+  return( false );
+
+  // Associate new data
+  this->m_Images[ name ] = image;
+  this->m_Tree[ name ] = parent;
+
+  // Show image and return
+  this->m_MPRObjects->AddImage( image );
+  return( true );
+  }
+
+  // -------------------------------------------------------------------------
+  bool cpExtensions::QT::SimpleMPRWidget::
+  ShowImage(
+  vtkImageData* image,
+  const std::string& name,
+  const std::string& parent,
+  const double& r, const double& g, const double& b
+  )
+  {
+  // Update tree view
+  QTreeWidgetItem* new_item = this->_UpdateTreeItem( name, parent );
+  if( new_item == NULL )
+  return( false );
+
+  // Associate new data
+  this->m_Images[ name ] = image;
+  this->m_Tree[ name ] = parent;
+
+  // Show image and return
+  this->m_MPRObjects->AddImage( image );
+  return( true );
+  }
+
+  // -------------------------------------------------------------------------
+  bool cpExtensions::QT::SimpleMPRWidget::
+  ShowMesh(
+  vtkPolyData* mesh,
+  const std::string& name,
+  const std::string& parent
+  )
+  {
+  // Update tree view
+  QTreeWidgetItem* new_item = this->_UpdateTreeItem( name, parent );
+  if( new_item == NULL )
+  return( false );
+
+  // Associate new data
+  PolyDataActor* actor = new PolyDataActor( mesh );
+  this->m_Meshes[ name ] = actor;
+  this->m_Tree[ name ] = parent;
+
+  // Show mesh
+  this->_Add3DActor( actor->Actor );
+  return( true );
+  }
+
+  // -------------------------------------------------------------------------
+  bool cpExtensions::QT::SimpleMPRWidget::
+  ShowMesh(
+  vtkPolyData* mesh,
+  const std::string& name,
+  const std::string& parent,
+  const double& r, const double& g, const double& b
+  )
+  {
+  return false;
+  }
+
+  // -------------------------------------------------------------------------
+  void cpExtensions::QT::SimpleMPRWidget::
+  ClearAll( )
+  {
+  this->m_MPRObjects->ClearAll( );
+  this->m_Images.clear( );
+  this->m_Meshes.clear( );
+  }
+*/
+
+// -------------------------------------------------------------------------
+std::string cpExtensions::QT::SimpleMPRWidget::
+GetSelectedData( ) const
+{
+  /* TODO
+     QTreeWidgetItem* item = this->m_UI->LoadedData->currentItem( );
+     if( item != NULL )
+     return( item->text( 0 ).toStdString( ) );
+     else
+  */
+  return( "" );
+}
+
+// -------------------------------------------------------------------------
+/* TODO
+QTreeWidgetItem* cpExtensions::QT::SimpleMPRWidget::
+_FindItemInTree( const std::string& name ) const
+{
+  QList< QTreeWidgetItem* > items =
+    this->m_UI->LoadedData->findItems(
+      name.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
+      );
+  if( items.size( ) > 0 )
+    return( items[ 0 ] );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+QTreeWidgetItem* cpExtensions::QT::SimpleMPRWidget::
+_UpdateTreeItem( const std::string& name, const std::string& parent )
+{
+  // Update tree view
+  QTreeWidgetItem* new_item = NULL;
+  if( parent != "" )
+  {
+    QTreeWidgetItem* parent_item = this->_FindItemInTree( parent );
+    if( parent_item != NULL )
+    {
+      QTreeWidgetItem* old_item = this->_FindItemInTree( name );
+      if( old_item == NULL )
+      {
+        new_item =
+          new QTreeWidgetItem( parent_item, QStringList( name.c_str( ) ) );
+        parent_item->setExpanded( true );
+
+      } // fi
+
+    } // fi
+  }
+  else
+  {
+    new_item = new QTreeWidgetItem(
+      ( QTreeWidgetItem* )( NULL ), QStringList( name.c_str( ) )
+      );
+    this->m_UI->LoadedData->addTopLevelItem( new_item );
+
+  } // fi
+  return( new_item );
+}
+*/
+
+// -------------------------------------------------------------------------
+/*
+  void cpExtensions::QT::SimpleMPRWidget::
+  _Add3DActor( vtkProp3D* prop )
+  {
+  vtkRenderer* ren =
+  this->m_VTK[ 3 ]->GetRenderWindow( )->GetRenderers( )->GetFirstRenderer( );
+  if( ren == NULL )
+  return;
+  ren->AddActor( prop );
+  this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
+  }
+*/
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+_SyncBottom( int a, int b )
+{
+  this->m_UI->BottomSplitter->setSizes( this->m_UI->TopSplitter->sizes( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+_SyncTop( int a, int b )
+{
+  this->m_UI->TopSplitter->setSizes( this->m_UI->BottomSplitter->sizes( ) );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::PolyDataActor::
+PolyDataActor( )
+  : Mesh( NULL ),
+    Normals( NULL ),
+    Stripper( NULL ),
+    Mapper( NULL ),
+    Actor( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::PolyDataActor::
+~PolyDataActor( )
+{
+  if( this->Actor != NULL )    this->Actor->Delete( );
+  if( this->Mapper != NULL )   this->Mapper->Delete( );
+  if( this->Stripper != NULL ) this->Stripper->Delete( );
+  if( this->Normals != NULL )  this->Normals->Delete( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::PolyDataActor::
+Configure( vtkPolyData* pd )
+{
+  if( pd ==  NULL )
+    return;
+
+  double range[ 2 ];
+  pd->GetScalarRange( range );
+
+  this->Normals = vtkPolyDataNormals::New( );
+  this->Stripper = vtkStripper::New( );
+  this->Mapper = vtkPolyDataMapper::New( );
+  this->Actor = vtkQuadricLODActor::New( );
+
+  this->Mesh = pd;
+  this->Normals->SetInputData( pd );
+  this->Normals->SetFeatureAngle( 60.0 );
+  this->Stripper->SetInputConnection( this->Normals->GetOutputPort( ) );
+  this->Mapper->SetInputConnection( this->Stripper->GetOutputPort( ) );
+  this->Mapper->UseLookupTableScalarRangeOff( );
+  this->Mapper->SetScalarRange(
+    range[ 0 ], ( ( range[ 1 ] - range[ 0 ] ) * 0.75 ) + range[ 0 ]
+    );
+  this->Actor->SetMapper( this->Mapper );
+  this->Actor->DeferLODConstructionOff( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::Data::
+Data( )
+{
+  this->Tag = Data::IMAGE;
+  this->Image = NULL;
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::Data::
+~Data( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::
+Data& cpExtensions::QT::SimpleMPRWidget::Data::
+operator=( const Data& data )
+{
+  this->Tag = data.Tag;
+  if( this->Tag == Data::IMAGE )
+    this->Image = data.Image;
+  else if( this->Tag == Data::MESH )
+    this->Mesh = data.Mesh;
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::Data::
+SetImageData( vtkImageData* data )
+{
+  this->Tag = Data::IMAGE;
+  this->Image = data;
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::Data::
+SetPolyData( vtkPolyData* data )
+{
+  this->Tag = Data::MESH;
+  this->Mesh.Configure( data );
+}
+
+// -------------------------------------------------------------------------
+vtkImageData* cpExtensions::QT::SimpleMPRWidget::Data::
+GetImage( )
+{
+  if( this->Tag == Data::IMAGE )
+    return( this->Image );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+vtkPolyData* cpExtensions::QT::SimpleMPRWidget::Data::
+GetMesh( )
+{
+  if( this->Tag == Data::MESH )
+    return( this->Mesh.Mesh );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+vtkProp* cpExtensions::QT::SimpleMPRWidget::Data::
+GetMeshActor( )
+{
+  if( this->Tag == Data::MESH )
+    return( this->Mesh.Actor );
+  else
+    return( NULL );
+}
+
+#endif // cpExtensions_QT4
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.h b/lib/cpExtensions/QT/SimpleMPRWidget.h
new file mode 100644 (file)
index 0000000..c4d5ec5
--- /dev/null
@@ -0,0 +1,147 @@
+#ifndef __CPEXTENSIONS__QT__SIMPLEMPRWIDGET__H__
+#define __CPEXTENSIONS__QT__SIMPLEMPRWIDGET__H__
+
+#include <cpExtensions/Config.h>
+
+#ifdef cpExtensions_QT4
+
+#include <map>
+#include <string>
+
+#include <QWidget>
+
+#include <vtkSmartPointer.h>
+#include <vtkImageData.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkPolyDataNormals.h>
+#include <vtkQuadricLODActor.h>
+#include <vtkStripper.h>
+
+#include <cpExtensions/Visualization/MPRObjects.h>
+
+// -------------------------------------------------------------------------
+class QTreeWidgetItem;
+class QVTKWidget;
+
+namespace Ui
+{
+  class SimpleMPRWidget;
+}
+
+// -------------------------------------------------------------------------
+namespace cpExtensions
+{
+  namespace QT
+  {
+    /**
+     */
+    class cpExtensions_EXPORT SimpleMPRWidget
+      : public QWidget
+    {
+      Q_OBJECT;
+
+    public:
+      typedef SimpleMPRWidget Self;
+
+      typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
+      typedef TMPRObjects::TStyle                     TStyle;
+      typedef TMPRObjects::TMouseCommand              TMouseCommand;
+      typedef TMPRObjects::TMouseWheelCommand         TMouseWheelCommand;
+      typedef TMPRObjects::TKeyCommand                TKeyCommand;
+      typedef TMPRObjects::TVoidCommand               TVoidCommand;
+      typedef TMPRObjects::TMouseMoveCommand          TMouseMoveCommand;
+      typedef TMPRObjects::TMouseClickCommand         TMouseClickCommand;
+      typedef TMPRObjects::TMouseDoubleClickCommand   TMouseDoubleClickCommand;
+      typedef TMPRObjects::TExposeCommand             TExposeCommand;
+      typedef TMPRObjects::TConfigureCommand          TConfigureCommand;
+      typedef TMPRObjects::TEnterCommand              TEnterCommand;
+      typedef TMPRObjects::TLeaveCommand              TLeaveCommand;
+
+    public:
+      explicit SimpleMPRWidget( QWidget* parent = 0 );
+      virtual ~SimpleMPRWidget( );
+
+      // Data management
+      unsigned int GetNumberOfData( ) const;
+      bool AddData(
+        vtkImageData* data, const std::string& name,
+        const std::string& parent
+        );
+      bool AddData(
+        vtkPolyData* data, const std::string& name
+        );
+      const std::string& GetMainImage( ) const;
+      bool SetMainImage( const std::string& name );
+      void DeleteData( const std::string& name );
+      void DeleteAllData( );
+
+      // Some qt accessors
+      void SetDataColor(
+        const std::string& name,
+        const double& r, const double& g, const double& b
+        );
+      void ShowData( const std::string& name );
+      void HideData( const std::string& name );
+
+      vtkRenderWindowInteractor* GetInteractor( unsigned int i );
+
+      // Visual objects accessors
+      std::string GetSelectedData( ) const;
+                                          
+    private slots:
+      void _SyncBottom( int a, int b );
+      void _SyncTop( int a, int b );
+
+    protected:
+      static double cm_Colors[ 8 ][ 3 ];
+
+      Ui::SimpleMPRWidget*           m_UI;
+      vtkSmartPointer< TMPRObjects > m_MPRObjects;
+      QVTKWidget*                    m_VTK[ 4 ];
+
+      struct PolyDataActor
+      {
+        vtkPolyData*        Mesh;
+        vtkPolyDataNormals* Normals;
+        vtkStripper*        Stripper;
+        vtkPolyDataMapper*  Mapper;
+        vtkQuadricLODActor* Actor;
+
+        PolyDataActor( );
+        virtual ~PolyDataActor( );
+        void Configure( vtkPolyData* pd );
+      };
+
+      struct Data
+      {
+        enum { IMAGE, MESH } Tag;
+        vtkImageData*        Image;
+        PolyDataActor        Mesh;
+
+        Data( );
+        virtual ~Data( );
+
+        Data& operator=( const Data& data );
+
+        void SetImageData( vtkImageData* data );
+        void SetPolyData( vtkPolyData* data );
+
+        vtkImageData* GetImage( );
+        vtkPolyData* GetMesh( );
+        vtkProp* GetMeshActor( );
+      };
+
+      std::string m_MainImage;
+      std::map< std::string, Data >        m_Data;
+      std::map< std::string, std::string > m_Tree;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // cpExtensions_QT4
+
+#endif // __CPEXTENSIONS__QT__SIMPLEMPRWIDGET__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.ui b/lib/cpExtensions/QT/SimpleMPRWidget.ui
new file mode 100644 (file)
index 0000000..e468e92
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SimpleMPRWidget</class>
+ <widget class="QWidget" name="SimpleMPRWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>424</width>
+    <height>424</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QSplitter" name="QuadSplitter">
+     <property name="minimumSize">
+      <size>
+       <width>406</width>
+       <height>406</height>
+      </size>
+     </property>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <widget class="QSplitter" name="TopSplitter">
+      <property name="minimumSize">
+       <size>
+        <width>406</width>
+        <height>200</height>
+       </size>
+      </property>
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <widget class="QVTKWidget" name="VTK00" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>200</width>
+         <height>200</height>
+        </size>
+       </property>
+      </widget>
+      <widget class="QVTKWidget" name="VTK01" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>200</width>
+         <height>200</height>
+        </size>
+       </property>
+      </widget>
+     </widget>
+     <widget class="QSplitter" name="BottomSplitter">
+      <property name="minimumSize">
+       <size>
+        <width>406</width>
+        <height>200</height>
+       </size>
+      </property>
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <widget class="QVTKWidget" name="VTK10" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>200</width>
+         <height>200</height>
+        </size>
+       </property>
+      </widget>
+      <widget class="QVTKWidget" name="VTK11" native="true">
+       <property name="minimumSize">
+        <size>
+         <width>200</width>
+         <height>200</height>
+        </size>
+       </property>
+      </widget>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>QVTKWidget</class>
+   <extends>QWidget</extends>
+   <header location="global">QVTKWidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
\ No newline at end of file
diff --git a/lib/cpExtensions/Visualization/Image3DMPR.cxx b/lib/cpExtensions/Visualization/Image3DMPR.cxx
new file mode 100644 (file)
index 0000000..7812300
--- /dev/null
@@ -0,0 +1,364 @@
+#include <cpExtensions/Visualization/Image3DMPR.h>
+
+#include <vtkCommand.h>
+#include <vtkInteractorStyleSwitch.h>
+
+#include <cpExtensions/Visualization/SeedWidgetCorrector.h>
+
+/**
+ */
+class cpPlugins_Extensions_Visualization_InteractionModeCallback
+  : public vtkCommand
+{
+public:
+  static cpPlugins_Extensions_Visualization_InteractionModeCallback* New( )
+    {
+      return( new cpPlugins_Extensions_Visualization_InteractionModeCallback );
+    }
+  virtual void Execute(
+    vtkObject* caller, unsigned long eventId, void* arguments )
+    {
+      if( eventId == vtkCommand::KeyPressEvent )
+      {
+        vtkRenderWindowInteractor* iren =
+          static_cast< vtkRenderWindowInteractor* >( caller );
+        if( caller == NULL )
+          return;
+
+        switch( iren->GetKeyCode( ) )
+        {
+        case 'x':
+        case 'X':
+        {
+          bool eSeed = ( this->SeedWidget->GetProcessEvents( ) == 1 );
+          if( eSeed )
+          {
+            this->SeedWidget->ProcessEventsOff( );
+            this->WidgetX->InteractionOn( );
+            this->WidgetY->InteractionOn( );
+            this->WidgetZ->InteractionOn( );
+          }
+          else
+          {
+            this->SeedWidget->ProcessEventsOn( );
+            this->WidgetX->InteractionOff( );
+            this->WidgetY->InteractionOff( );
+            this->WidgetZ->InteractionOff( );
+
+          } // fi
+        }
+        break;
+        case 'z':
+        case 'Z':
+        {
+          this->SeedWidget->ProcessEventsOff( );
+          this->WidgetX->InteractionOff( );
+          this->WidgetY->InteractionOff( );
+          this->WidgetZ->InteractionOff( );
+        }
+        break;
+        default:
+          break;
+
+        } // hctiws
+
+      } // fi
+    }
+
+public:
+  vtkImagePlaneWidget* WidgetX;
+  vtkImagePlaneWidget* WidgetY;
+  vtkImagePlaneWidget* WidgetZ;
+  vtkSeedWidget*       SeedWidget;
+};
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::Image3DMPR::
+Image3DMPR( )
+{
+  this->m_Outline = vtkSmartPointer< vtkOutlineSource >::New( );
+  this->m_OutlineMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_OutlineActor = vtkSmartPointer< vtkActor >::New( );
+  this->m_Picker = vtkSmartPointer< vtkCellPicker >::New( );
+  this->m_WidgetX = vtkSmartPointer< vtkImagePlaneWidget >::New( );
+  this->m_WidgetY = vtkSmartPointer< vtkImagePlaneWidget >::New( );
+  this->m_WidgetZ = vtkSmartPointer< vtkImagePlaneWidget >::New( );
+  this->m_Renderer = vtkSmartPointer< vtkRenderer >::New( );
+  this->m_Window = vtkSmartPointer< vtkRenderWindow >::New( );
+  this->m_Interactor = vtkSmartPointer< vtkRenderWindowInteractor >::New( );
+  this->m_SeedHandleRepresentation =
+    vtkSmartPointer< vtkPointHandleRepresentation3D >::New( );
+  this->m_SeedRepresentation =
+    vtkSmartPointer< vtkSeedRepresentation >::New( );
+  this->m_SeedWidget = vtkSmartPointer<vtkSeedWidget>::New();
+
+  this->m_SeedHandleRepresentation->GetProperty()->SetColor( 1, 0, 1 );
+  this->m_SeedRepresentation->
+    SetHandleRepresentation( this->m_SeedHandleRepresentation );
+  this->m_SeedWidget->SetRepresentation( this->m_SeedRepresentation );
+
+  this->m_WidgetX->KeyPressActivationOff( );
+  this->m_WidgetY->KeyPressActivationOff( );
+  this->m_WidgetZ->KeyPressActivationOff( );
+  this->m_SeedWidget->KeyPressActivationOff( );
+
+  typedef
+    cpPlugins_Extensions_Visualization_InteractionModeCallback
+    _TInteractionCB;
+  vtkSmartPointer< _TInteractionCB > int_cb =
+    vtkSmartPointer< _TInteractionCB >::New( );
+  int_cb->WidgetX = this->m_WidgetX;
+  int_cb->WidgetY = this->m_WidgetY;
+  int_cb->WidgetZ = this->m_WidgetZ;
+  int_cb->SeedWidget = this->m_SeedWidget;
+  this->m_Interactor->AddObserver( vtkCommand::KeyPressEvent, int_cb );
+
+  typedef
+    cpExtensions::Visualization::SeedWidgetCorrector
+    _TCorrector;
+  vtkSmartPointer< _TCorrector > corr_cb =
+    vtkSmartPointer< _TCorrector >::New( );
+  corr_cb->Configure( this->m_Picker );
+  this->m_SeedWidget->AddObserver( vtkCommand::PlacePointEvent, corr_cb );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::Image3DMPR::
+~Image3DMPR( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+SetImage( vtkImageData* image )
+{
+  this->m_Image = image;
+
+  // Outline
+  this->m_Outline->SetBounds( this->m_Image->GetBounds( ) );
+  this->m_OutlineMapper->
+    SetInputConnection( this->m_Outline->GetOutputPort( ) );
+  this->m_OutlineActor->SetMapper( this->m_OutlineMapper );
+  this->m_OutlineActor->GetProperty( )->SetColor( 1, 1, 1 );
+
+  // Local picker
+  this->m_Picker->SetTolerance( 0.005 );
+
+  // Image planes
+  this->m_WidgetX->DisplayTextOn( );
+  this->m_WidgetX->SetInputData( this->m_Image );
+  this->m_WidgetX->SetPlaneOrientationToXAxes( );
+  this->m_WidgetX->SetSliceIndex( this->m_Image->GetExtent( )[ 0 ] );
+  this->m_WidgetX->SetPicker( this->m_Picker );
+  this->m_WidgetX->SetKeyPressActivationValue( 'x' );
+  this->m_WidgetX->GetPlaneProperty( )->SetLineWidth( 3 );
+  this->m_WidgetX->GetPlaneProperty( )->SetColor( 0, 1, 1 );
+
+  this->m_WidgetY->DisplayTextOn( );
+  this->m_WidgetY->SetInputData( this->m_Image );
+  this->m_WidgetY->SetPlaneOrientationToYAxes( );
+  this->m_WidgetY->SetSliceIndex( this->m_Image->GetExtent( )[ 2 ] );
+  this->m_WidgetY->SetPicker( this->m_Picker );
+  this->m_WidgetY->SetKeyPressActivationValue( 'y' );
+  this->m_WidgetY->GetPlaneProperty( )->SetColor( 1, 0, 1 );
+  this->m_WidgetY->GetPlaneProperty( )->SetLineWidth( 3 );
+  this->m_WidgetY->SetLookupTable( this->m_WidgetX->GetLookupTable( ) );
+
+  this->m_WidgetZ->DisplayTextOn( );
+  this->m_WidgetZ->SetInputData( this->m_Image );
+  this->m_WidgetZ->SetPlaneOrientationToZAxes( );
+  this->m_WidgetZ->SetSliceIndex( this->m_Image->GetExtent( )[ 4 ] );
+  this->m_WidgetZ->SetPicker( this->m_Picker );
+  this->m_WidgetZ->SetKeyPressActivationValue( 'z' );
+  this->m_WidgetZ->GetPlaneProperty( )->SetColor( 1, 1, 0 );
+  this->m_WidgetZ->GetPlaneProperty( )->SetLineWidth( 3 );
+  this->m_WidgetZ->SetLookupTable( this->m_WidgetX->GetLookupTable( ) );
+
+  // Rendering stuff
+  this->m_Window->AddRenderer( this->m_Renderer );
+  this->m_Interactor->SetRenderWindow( this->m_Window );
+
+  // Command
+  double spac[ 3 ];
+  this->m_Image->GetSpacing( spac );
+  double min_spacing = spac[ 0 ];
+  for( unsigned int d = 1; d < 3; d++ )
+    min_spacing = ( spac[ d ] < min_spacing )? spac[ d ]: min_spacing;
+
+  vtkInteractorStyleSwitch* iswitch =
+    dynamic_cast< vtkInteractorStyleSwitch* >(
+      this->m_Interactor->GetInteractorStyle( )
+      );
+  if( iswitch != NULL )
+    iswitch->SetCurrentStyleToTrackballCamera( );
+
+  // Add actors
+  this->m_Renderer->AddActor( this->m_OutlineActor );
+
+  // Prepare widgets
+  this->m_WidgetX->SetInteractor( this->m_Interactor );
+  this->m_WidgetY->SetInteractor( this->m_Interactor );
+  this->m_WidgetZ->SetInteractor( this->m_Interactor );
+  this->m_SeedWidget->SetInteractor( this->m_Interactor );
+
+  this->m_WidgetX->On( );
+  this->m_WidgetY->On( );
+  this->m_WidgetZ->On( );
+  this->m_SeedWidget->On( );
+  this->m_SeedWidget->ProcessEventsOff( );
+  this->m_Interactor->SetPicker( this->m_Picker );
+  /*
+    this->m_Interactor->GetPickingManager( )->AddPicker( this->m_Picker );
+    this->m_Interactor->GetPickingManager( )->EnabledOn( );
+  */
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+SetBackground( double r, double g, double b )
+{
+  this->m_Renderer->SetBackground( r, g, b );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+SetSize( unsigned int w, unsigned int h )
+{
+  this->m_Window->SetSize( w, h );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+SetWindowLevel( double w, double l )
+{
+  this->m_WidgetX->SetWindowLevel( w, l );
+  this->m_WidgetY->SetWindowLevel( w, l );
+  this->m_WidgetZ->SetWindowLevel( w, l );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+AddPolyData( vtkPolyData* pd, double opacity )
+{
+  unsigned int i = this->m_PolyDatas.size( );
+
+  this->m_PolyDatas.push_back( pd );
+  this->m_Mappers.push_back( vtkSmartPointer< vtkPolyDataMapper >::New( ) );
+  this->m_Actors.push_back( vtkSmartPointer< vtkActor >::New( ) );
+
+  this->m_Mappers[ i ]->SetInputData( pd );
+  this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] );
+  this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity );
+  this->m_Actors[ i ]->GetProperty( )->SetLineWidth( 3 );
+  this->m_Actors[ i ]->GetProperty( )->SetPointSize( 5 );
+  this->m_Renderer->AddActor( this->m_Actors[ i ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+AddPolyData( vtkPolyData* pd, double r, double g, double b, double opacity )
+{
+  unsigned int i = this->m_PolyDatas.size( );
+
+  this->m_PolyDatas.push_back( pd );
+  this->m_Mappers.push_back( vtkSmartPointer< vtkPolyDataMapper >::New( ) );
+  this->m_Actors.push_back( vtkSmartPointer< vtkActor >::New( ) );
+
+  this->m_Mappers[ i ]->SetInputData( pd );
+  this->m_Mappers[ i ]->ScalarVisibilityOff( );
+  this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] );
+  this->m_Actors[ i ]->GetProperty( )->SetColor( r, g, b );
+  this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity );
+  this->m_Actors[ i ]->GetProperty( )->SetLineWidth( 3 );
+  this->m_Actors[ i ]->GetProperty( )->SetPointSize( 5 );
+  this->m_Renderer->AddActor( this->m_Actors[ i ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+AddPolyData( vtkPolyData* pd, vtkLookupTable* lut, double opacity )
+{
+  unsigned int i = this->m_PolyDatas.size( );
+
+  this->m_PolyDatas.push_back( pd );
+  this->m_Mappers.push_back( vtkSmartPointer< vtkPolyDataMapper >::New( ) );
+  this->m_Actors.push_back( vtkSmartPointer< vtkActor >::New( ) );
+
+  this->m_Mappers[ i ]->SetInputData( pd );
+  this->m_Mappers[ i ]->SetLookupTable( lut );
+  this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] );
+  this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity );
+  this->m_Renderer->AddActor( this->m_Actors[ i ] );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::Image3DMPR::
+GetNumberOfSeeds( ) const
+{
+  return( this->m_SeedRepresentation->GetNumberOfSeeds( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+GetSeed( int n, double* s ) const
+{
+  vtkHandleWidget* hWdg = this->m_SeedWidget->GetSeed( n );
+  if( hWdg == NULL )
+    return;
+  vtkHandleRepresentation* hRep =
+    dynamic_cast< vtkHandleRepresentation* >( hWdg->GetRepresentation( ) );
+  if( hRep == NULL )
+    return;
+  hRep->GetWorldPosition( s );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::Image3DMPR::
+AddSeed( const double& x, const double& y, const double& z ) const
+{
+  double pos[ 3 ] = { x, y, z };
+
+  int hnd_id = this->m_SeedRepresentation->CreateHandle( pos );
+  vtkHandleWidget* hnd = this->m_SeedWidget->CreateNewHandle( );
+  this->m_SeedRepresentation->GetHandleRepresentation( hnd_id )->
+    SetWorldPosition( pos );
+  hnd->SetEnabled( 1 );
+
+  return( this->GetNumberOfSeeds( ) - 1 );
+}
+
+// -------------------------------------------------------------------------
+vtkRenderWindow* cpExtensions::Visualization::Image3DMPR::
+GetWindow( ) const
+{
+  return( this->m_Window );
+}
+
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::Image3DMPR::
+GetRenderer( ) const
+{
+  return( this->m_Renderer );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+Start( )
+{
+  this->m_WidgetX->On( );
+  this->m_WidgetY->On( );
+  this->m_WidgetZ->On( );
+
+  this->m_Renderer->ResetCamera( );
+  this->m_Interactor->Initialize( );
+  this->m_Interactor->Start( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::Image3DMPR::
+Render( )
+{
+  this->m_Window->Render( );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/Image3DMPR.h b/lib/cpExtensions/Visualization/Image3DMPR.h
new file mode 100644 (file)
index 0000000..2cbb9b7
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGE3DMPR__H__
+#define __CPEXTENSIONS__VISUALIZATION__IMAGE3DMPR__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <vtkActor.h>
+#include <vtkCellPicker.h>
+#include <vtkHandleWidget.h>
+#include <vtkImageData.h>
+#include <vtkImagePlaneWidget.h>
+#include <vtkOutlineSource.h>
+#include <vtkPointHandleRepresentation3D.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkProperty.h>
+#include <vtkRenderer.h>
+#include <vtkRendererCollection.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkSeedRepresentation.h>
+#include <vtkSeedWidget.h>
+#include <vtkSmartPointer.h>
+#include <vtkSphereSource.h>
+#include <vtkLookupTable.h>
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    class cpExtensions_EXPORT Image3DMPR
+    {
+    public:
+      Image3DMPR( );
+      virtual ~Image3DMPR( );
+
+      void SetImage( vtkImageData* image );
+      void SetBackground( double r, double g, double b );
+      void SetSize( unsigned int w, unsigned int h );
+      void SetWindowLevel( double w, double l );
+
+      void AddPolyData( vtkPolyData* pd, double opacity = double( 1 ) );
+      void AddPolyData(
+        vtkPolyData* pd,
+        double r, double g, double b, double opacity = double( 1 )
+        );
+      void AddPolyData(
+        vtkPolyData* pd,
+        vtkLookupTable* lut,
+        double opacity = double( 1 )
+        );
+
+      unsigned int GetNumberOfSeeds( ) const;
+      void GetSeed( int n, double* s ) const;
+      unsigned int AddSeed(
+        const double& x, const double& y, const double& z
+        ) const;
+
+      vtkRenderWindow* GetWindow( ) const;
+      vtkRenderer* GetRenderer( ) const;
+
+      void Start( );
+      void Render( );
+
+    protected:
+      vtkSmartPointer< vtkImageData >              m_Image;
+      vtkSmartPointer< vtkOutlineSource >          m_Outline;
+      vtkSmartPointer< vtkPolyDataMapper >         m_OutlineMapper;
+      vtkSmartPointer< vtkActor >                  m_OutlineActor;
+      vtkSmartPointer< vtkCellPicker >             m_Picker;
+      vtkSmartPointer< vtkImagePlaneWidget >       m_WidgetX;
+      vtkSmartPointer< vtkImagePlaneWidget >       m_WidgetY;
+      vtkSmartPointer< vtkImagePlaneWidget >       m_WidgetZ;
+      vtkSmartPointer< vtkRenderer >               m_Renderer;
+      vtkSmartPointer< vtkRenderWindow >           m_Window;
+      vtkSmartPointer< vtkRenderWindowInteractor > m_Interactor;
+
+      std::vector< vtkSmartPointer< vtkPolyData > >       m_PolyDatas;
+      std::vector< vtkSmartPointer< vtkPolyDataMapper > > m_Mappers;
+      std::vector< vtkSmartPointer< vtkActor > >          m_Actors;
+
+      // Create the widget and its representation
+      vtkSmartPointer< vtkPointHandleRepresentation3D >
+        m_SeedHandleRepresentation;
+      vtkSmartPointer< vtkSeedRepresentation > m_SeedRepresentation;
+      vtkSmartPointer< vtkSeedWidget >         m_SeedWidget;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__VISUALIZATION__IMAGE3DMPR__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/ImageBlender.cxx b/lib/cpExtensions/Visualization/ImageBlender.cxx
new file mode 100644 (file)
index 0000000..44a08ab
--- /dev/null
@@ -0,0 +1,239 @@
+#include <cpExtensions/Visualization/ImageBlender.h>
+
+#include <vtkDataObject.h>
+#include <vtkImageData.h>
+#include <vtkImageIterator.h>
+#include <vtkImageProgressIterator.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::ImageBlender::
+Self* cpExtensions::Visualization::ImageBlender::
+New( )
+{
+  return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::ImageBlender::
+GetNumberOfInputs( )
+{
+  unsigned int np = this->GetNumberOfInputPorts( );
+  unsigned int ni = 0;
+  for( unsigned int p = 0; p < np; ++p )
+    ni += this->GetNumberOfInputConnections( p );
+  return( ni );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::ImageBlender::
+ImageBlender( )
+  : Superclass( )
+{
+  this->SetNumberOfInputPorts( 1 );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::ImageBlender::
+~ImageBlender( )
+{
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageBlender::
+RequestInformation(
+  vtkInformation* request,
+  vtkInformationVector** inputVector,
+  vtkInformationVector* outputVector
+  )
+{
+  if( this->GetNumberOfInputConnections( 0 ) == 0 )
+    return( 0 );
+
+  vtkDataObject::SetPointDataActiveScalarInfo(
+    outputVector->GetInformationObject( 0 ),
+    VTK_UNSIGNED_CHAR,
+    1
+    );
+  return( 1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageBlender::
+RequestData(
+  vtkInformation* request,
+  vtkInformationVector** inputVector,
+  vtkInformationVector* outputVector
+  )
+{
+  this->m_Ranges.clear( );
+  for( int i = 0; i < this->GetNumberOfInputPorts( ); ++i )
+  {
+    vtkInformationVector* portInfo = inputVector[ i ];
+    for( int j = 0; j < portInfo->GetNumberOfInformationObjects( ); ++j )
+    {
+      vtkInformation* info = portInfo->GetInformationObject( j );
+      vtkImageData* image = vtkImageData::SafeDownCast(
+        info->Get( vtkDataObject::DATA_OBJECT( ) )
+        );
+      if( image != NULL )
+      {
+        double r[ 2 ];
+        image->GetScalarRange( r );
+        this->m_Ranges.push_back( r[ 0 ] );
+        this->m_Ranges.push_back( r[ 1 ] );
+      }
+      else
+      {
+        this->m_Ranges.push_back( double( 0 ) );
+        this->m_Ranges.push_back( double( 0 ) );
+
+      } // fi
+
+    } // rof
+
+  } // rof
+  return(
+    this->Superclass::RequestData( request, inputVector, outputVector )
+    );
+}
+
+// -------------------------------------------------------------------------
+// Description:
+// This templated function executes the filter for any type of data.
+template< class T >
+void cpExtensions_Visualization_ImageBlender_Execute(
+  cpExtensions::Visualization::ImageBlender* self,
+  vtkImageData** inDatas, int numInputs,
+  const std::vector< double >& ranges, vtkImageData* outData,
+  int outExt[ 6 ], int id, T* really_not_used
+  )
+{
+  vtkImageIterator< T > inItsFast[ 256 ];
+  T* inSIFast[ 256 ];
+  vtkImageProgressIterator< T > outIt( outData, outExt, self, id );
+  vtkImageIterator< T >* inIts;
+  T** inSI;
+  if( numInputs < 256 )
+  {
+    inIts = inItsFast;
+    inSI = inSIFast;
+  }
+  else
+  {
+    inIts = new vtkImageIterator< T >[ numInputs ];
+    inSI = new T*[ numInputs ];
+
+  } // fi
+
+  // Loop through all input ImageData to initialize iterators
+  for( int i = 0; i < numInputs; ++i )
+    inIts[ i ].Initialize( inDatas[ i ], outExt );
+
+  // Loop through output pixels
+  while( !outIt.IsAtEnd( ) )
+  {
+    for( int j = 0; j < numInputs; ++j )
+      inSI[ j ] = inIts[ j ].BeginSpan( );
+
+    T* outSI = outIt.BeginSpan( );
+    T* outSIEnd = outIt.EndSpan( );
+
+    // Pixel operation
+    while( outSI != outSIEnd )
+    {
+      // Input 0 is ignored: it is just used to guarantee sizes all over
+      // the result
+      double vmax = double( 0 );
+      for( int k = 1; k < numInputs; ++k )
+      {
+        double v =
+          ( ( double( k ) * double( *inSI[ k ] ) ) - ranges[ k << 1 ] ) /
+          ( ranges[ ( k << 1 ) + 1 ] - ranges[ k << 1 ] );
+        vmax = ( vmax < v )? v: vmax;
+
+      } // rof
+      *outSI = static_cast< T >( vmax );
+      outSI++;
+      for( int l = 0; l < numInputs; ++l )
+        inSI[ l ]++;
+
+    } // elihw
+    for( int j = 0; j < numInputs; ++j )
+      inIts[ j ].NextSpan( );
+    outIt.NextSpan( );
+
+  } // elihw
+
+  if( numInputs >= 256)
+  {
+    delete [] inIts;
+    delete [] inSI;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageBlender::
+ThreadedRequestData(
+  vtkInformation* request,
+  vtkInformationVector** inputVector,
+  vtkInformationVector* outputVector,
+  vtkImageData*** inData, vtkImageData** outData,
+  int outExt[ 6 ], int id
+  )
+{
+  if( inData[ 0 ][ 0 ] == NULL )
+  {
+    vtkErrorMacro( << "Input " << 0 << " must be specified." );
+    return;
+
+  } // fi
+
+  int numInputs = this->GetNumberOfInputConnections( 0 );
+  int scalarType = inData[ 0 ][ 0 ]->GetScalarType( );
+  int numComp = inData[ 0 ][ 0 ]->GetNumberOfScalarComponents( );
+  for( int i = 1; i < numInputs; ++i )
+  {
+    int otherType = inData[ 0 ][ i ]->GetScalarType( );
+    int otherComp = inData[ 0 ][ i ]->GetNumberOfScalarComponents( );
+    if( otherType != scalarType || otherComp != numComp )
+    {
+      if( id == 0 )
+        vtkErrorMacro(
+          "ThreadedRequestData: Input " << i
+          << " has " << otherComp << " components of type "
+          << otherType << ", but input 0 has " << numComp
+          << " components of type " << scalarType
+          );
+      return;
+
+    } // fi
+
+  } // rof
+
+  switch( scalarType )
+  {
+    vtkTemplateMacro(
+      cpExtensions_Visualization_ImageBlender_Execute(
+        this, inData[ 0 ], numInputs, this->m_Ranges,
+        outData[ 0 ], outExt, id, static_cast< VTK_TT* >( 0 )
+        )
+      );
+  default:
+    if( id == 0 )
+      vtkErrorMacro( << "Execute: Unknown ScalarType" );
+    return;
+  } // hctiws
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageBlender::
+FillInputPortInformation( int i, vtkInformation* info )
+{
+  info->Set( vtkAlgorithm::INPUT_IS_REPEATABLE( ), 1 );
+  return( this->Superclass::FillInputPortInformation( i,info ) );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/ImageBlender.h b/lib/cpExtensions/Visualization/ImageBlender.h
new file mode 100644 (file)
index 0000000..e4bf27c
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGEBLENDER__H__
+#define __CPEXTENSIONS__VISUALIZATION__IMAGEBLENDER__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <vector>
+
+#include <vtkThreadedImageAlgorithm.h>
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     * @note: Based on vtkImageWeightedSum
+     */
+    class cpExtensions_EXPORT ImageBlender
+      : public vtkThreadedImageAlgorithm
+    {
+    public:
+      typedef ImageBlender Self;
+      vtkTypeMacro( ImageBlender, vtkThreadedImageAlgorithm );
+
+    public:
+      static Self* New( );
+
+      unsigned int GetNumberOfInputs( );
+
+    protected:
+      ImageBlender( );
+      virtual ~ImageBlender( );
+
+      int RequestInformation(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector
+        );
+      int RequestData(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector
+        );
+      void ThreadedRequestData(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector,
+        vtkImageData*** inData, vtkImageData** outData,
+        int outExt[ 6 ], int id
+        );
+      int FillInputPortInformation( int i, vtkInformation* info );
+
+    private:
+      // Purposely not implemented.
+      ImageBlender( const Self& other );
+      void operator=( const Self& other );
+
+    protected:
+      std::vector< double > m_Ranges;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif //  __CPEXTENSIONS__VISUALIZATION__IMAGEBLENDER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/ImageSliceActors.cxx b/lib/cpExtensions/Visualization/ImageSliceActors.cxx
new file mode 100644 (file)
index 0000000..024fbe0
--- /dev/null
@@ -0,0 +1,1323 @@
+#include <cpExtensions/Visualization/ImageSliceActors.h>
+
+#include <cstring>
+#include <sstream>
+
+#include <vtkAlgorithmOutput.h>
+#include <vtkCamera.h>
+#include <vtkCellArray.h>
+#include <vtkImageData.h>
+#include <vtkImageProperty.h>
+#include <vtkPoints.h>
+#include <vtkProperty.h>
+#include <vtkRenderer.h>
+#include <vtkRendererCollection.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkTextProperty.h>
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+m_PlaneColors[ 3 ][ 3 ] =
+{
+  { 1, 0, 0 },
+  { 0, 1, 0 },
+  { 0, 0, 1 }
+};
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::ImageSliceActors*
+cpExtensions::Visualization::ImageSliceActors::
+New( )
+{
+  return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetAxis( int axis )
+{
+  this->m_ImageMapper->SetOrientation( axis );
+  this->m_BlenderMapper->SetOrientation( axis );
+  this->m_ImageMapper->Update( );
+  this->m_BlenderMapper->Update( );
+  this->SetSliceNumber( this->GetSliceNumberMinValue( ) );
+  this->m_ImageActor->Modified( );
+  this->m_BlenderActor->Modified( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetInputConnection( vtkAlgorithmOutput* aout )
+{
+  // Get input vtkImageData
+  if( aout == NULL )
+    return;
+
+  // Create mapper and actors
+  this->m_ImageMapper->SetInputConnection( aout );
+  this->_ConfigureInputImage( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetInputImage( vtkImageData* data )
+{
+  // Get input vtkImageData
+  if( data == NULL )
+    return;
+
+  // Create mapper and actors
+  this->m_ImageMapper->SetInputData( data );
+  this->_ConfigureInputImage( );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageSliceActors::
+AddBinaryConnection(
+  vtkAlgorithmOutput* aout,
+  const double& r, const double& g, const double& b
+  )
+{
+  if( aout == NULL )
+    return( -1 );
+  this->m_Blender->AddInputConnection( aout );
+  this->_ConfigureBinaryImage( r, g, b );
+  return( this->m_Blender->GetNumberOfInputs( ) - 1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageSliceActors::
+AddBinaryImage(
+  vtkImageData* data,
+  const double& r, const double& g, const double& b
+  )
+{
+  if( data == NULL )
+    return( -1 );
+  this->m_Blender->AddInputData( data );
+  this->_ConfigureBinaryImage( r, g, b );
+  return( this->m_Blender->GetNumberOfInputs( ) - 1 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+Clear( )
+{
+  // Unbind from container
+  this->RemoveAllItems( );
+
+  // Filters and mappers
+  this->m_ImageMapper   = vtkSmartPointer< vtkImageSliceMapper >::New( );
+  this->m_ImageActor    = vtkSmartPointer< vtkImageActor >::New( );
+  this->m_Blender       = vtkSmartPointer< TBlender >::New( );
+  this->m_BlenderMapper = vtkSmartPointer< vtkImageSliceMapper >::New( );
+  this->m_BlenderLUT    = vtkSmartPointer< vtkLookupTable >::New( );
+  this->m_BlenderActor  = vtkSmartPointer< vtkImageActor >::New( );
+
+  this->m_ImageActor->SetMapper( this->m_ImageMapper );
+  this->m_BlenderMapper->
+    SetInputConnection( this->m_Blender->GetOutputPort( ) );
+
+  this->m_BlenderLUT->SetNumberOfTableValues( 1 );
+  this->m_BlenderLUT->SetTableRange( 0, 1 );
+  this->m_BlenderLUT->SetTableValue( 0, 0, 0, 0, 0 );
+  this->m_BlenderLUT->Build( );
+
+  this->m_BlenderActor->SetMapper( this->m_BlenderMapper );
+  this->m_BlenderActor->GetProperty( )->SetLookupTable( this->m_BlenderLUT );
+  this->m_BlenderActor->GetProperty( )->UseLookupTableScalarRangeOn( );
+
+  // White cursor
+  vtkSmartPointer< vtkPoints > cursor_points =
+    vtkSmartPointer< vtkPoints >::New( );
+  vtkSmartPointer< vtkCellArray > cursor_lines =
+    vtkSmartPointer< vtkCellArray >::New( );
+  cursor_points->InsertNextPoint( 0, 0, 0 );
+  cursor_points->InsertNextPoint( 0, 0, 0 );
+  cursor_points->InsertNextPoint( 0, 0, 0 );
+  cursor_points->InsertNextPoint( 0, 0, 0 );
+  cursor_lines->InsertNextCell( 2 );
+  cursor_lines->InsertCellPoint( 0 );
+  cursor_lines->InsertCellPoint( 1 );
+  cursor_lines->InsertNextCell( 2 );
+  cursor_lines->InsertCellPoint( 2 );
+  cursor_lines->InsertCellPoint( 3 );
+
+  this->m_Cursor = vtkSmartPointer< vtkPolyData >::New( );
+  this->m_CursorMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_CursorActor = vtkSmartPointer< vtkActor >::New( );
+
+  this->m_Cursor->SetPoints( cursor_points );
+  this->m_Cursor->SetLines( cursor_lines );
+  this->m_CursorMapper->SetInputData( this->m_Cursor );
+  this->m_CursorActor->SetMapper( this->m_CursorMapper );
+  this->m_CursorActor->GetProperty( )->SetColor( 1, 1, 0 );
+  this->m_CursorActor->GetProperty( )->SetLineWidth( 2 );
+
+  // Plane intersections
+  this->m_Axis1       = vtkSmartPointer< vtkPolyData >::New( );
+  this->m_Axis1Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_Axis1Actor  = vtkSmartPointer< vtkActor >::New( );
+
+  vtkSmartPointer< vtkPoints > h_points =
+    vtkSmartPointer< vtkPoints >::New( );
+  vtkSmartPointer< vtkCellArray > h_lines =
+    vtkSmartPointer< vtkCellArray >::New( );
+  h_points->InsertNextPoint( 0, 0, 0 );
+  h_points->InsertNextPoint( 0, 0, 0 );
+  h_lines->InsertNextCell( 2 );
+  h_lines->InsertCellPoint( 0 );
+  h_lines->InsertCellPoint( 1 );
+  this->m_Axis1->SetPoints( h_points );
+  this->m_Axis1->SetLines( h_lines );
+  this->m_Axis1Mapper->SetInputData( this->m_Axis1 );
+  this->m_Axis1Actor->SetMapper( this->m_Axis1Mapper );
+
+  this->m_Axis2       = vtkSmartPointer< vtkPolyData >::New( );
+  this->m_Axis2Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_Axis2Actor  = vtkSmartPointer< vtkActor >::New( );
+
+  vtkSmartPointer< vtkPoints > v_points =
+    vtkSmartPointer< vtkPoints >::New( );
+  vtkSmartPointer< vtkCellArray > v_lines =
+    vtkSmartPointer< vtkCellArray >::New( );
+  v_points->InsertNextPoint( 0, 0, 0 );
+  v_points->InsertNextPoint( 0, 0, 0 );
+  v_lines->InsertNextCell( 2 );
+  v_lines->InsertCellPoint( 0 );
+  v_lines->InsertCellPoint( 1 );
+  this->m_Axis2->SetPoints( v_points );
+  this->m_Axis2->SetLines( v_lines );
+  this->m_Axis2Mapper->SetInputData( this->m_Axis2 );
+  this->m_Axis2Actor->SetMapper( this->m_Axis2Mapper );
+
+  // Plane
+  this->m_Plane       = vtkSmartPointer< vtkPolyData >::New( );
+  this->m_PlaneMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
+  this->m_PlaneActor  = vtkSmartPointer< vtkActor >::New( );
+
+  vtkSmartPointer< vtkPoints > plane_points =
+    vtkSmartPointer< vtkPoints >::New( );
+  vtkSmartPointer< vtkCellArray > plane_lines =
+    vtkSmartPointer< vtkCellArray >::New( );
+  plane_points->InsertNextPoint( 0, 0, 0 );
+  plane_points->InsertNextPoint( 0, 1, 0 );
+  plane_points->InsertNextPoint( 1, 1, 0 );
+  plane_points->InsertNextPoint( 1, 0, 0 );
+  plane_lines->InsertNextCell( 5 );
+  plane_lines->InsertCellPoint( 0 );
+  plane_lines->InsertCellPoint( 1 );
+  plane_lines->InsertCellPoint( 2 );
+  plane_lines->InsertCellPoint( 3 );
+  plane_lines->InsertCellPoint( 0 );
+  this->m_Plane->SetPoints( plane_points );
+  this->m_Plane->SetLines( plane_lines );
+
+  this->m_PlaneMapper->SetInputData( this->m_Plane );
+  this->m_PlaneActor->SetMapper( this->m_PlaneMapper );
+
+  // Text actor
+  this->m_TextActor = vtkSmartPointer< vtkTextActor >::New( );
+  this->m_TextBuffer[ 0 ] = '\0';
+  this->m_TextActor->SetTextScaleModeToNone( );
+  vtkTextProperty* textprop = this->m_TextActor->GetTextProperty( );
+  textprop->SetColor( 1, 1, 0 );
+  textprop->SetFontFamilyToCourier( );
+  textprop->SetFontSize( 18 );
+  textprop->BoldOff( );
+  textprop->ItalicOff( );
+  textprop->ShadowOff( );
+  textprop->SetJustificationToLeft( );
+  textprop->SetVerticalJustificationToBottom( );
+  vtkCoordinate* coord = this->m_TextActor->GetPositionCoordinate( );
+  coord->SetCoordinateSystemToNormalizedViewport( );
+  coord->SetValue( 0.01, 0.01 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+AssociateSlice( Self* slice )
+{
+  this->m_AssociatedSlices.push_back( slice );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+vtkInteractorStyle* cpExtensions::Visualization::ImageSliceActors::
+GetStyle( )
+{
+  return( this->m_Style.GetPointer( ) );
+}
+
+// -------------------------------------------------------------------------
+const vtkInteractorStyle* cpExtensions::Visualization::ImageSliceActors::
+GetStyle( ) const
+{
+  return( this->m_Style.GetPointer( ) );
+}
+
+// -------------------------------------------------------------------------
+vtkImageData* cpExtensions::Visualization::ImageSliceActors::
+GetInputImage( )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetInput( ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const vtkImageData* cpExtensions::Visualization::ImageSliceActors::
+GetInputImage( ) const
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetInput( ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+PushActorsInto( vtkRenderWindow* window, bool force_style )
+{
+  this->m_Window = window;
+  if( window == NULL )
+    return;
+  vtkRenderWindowInteractor* rwi = window->GetInteractor( );
+  vtkRenderer* renderer = window->GetRenderers( )->GetFirstRenderer( );
+  if( rwi == NULL || renderer == NULL )
+    return;
+
+  // Update style
+  if( this->m_Style.GetPointer( ) != NULL && force_style )
+    rwi->SetInteractorStyle( this->m_Style );
+
+  // Update actors
+  renderer->AddViewProp( this->m_ImageActor );
+  renderer->AddViewProp( this->m_BlenderActor );
+  if( force_style )
+  {
+    renderer->AddViewProp( this->m_CursorActor );
+    renderer->AddViewProp( this->m_PlaneActor );
+    renderer->AddViewProp( this->m_TextActor );
+    renderer->AddViewProp( this->m_Axis1Actor );
+    renderer->AddViewProp( this->m_Axis2Actor );
+
+  } // fi
+
+  // Configure camera
+  vtkCamera* camera = renderer->GetActiveCamera( );
+  if( camera != NULL && force_style )
+  {
+    // Parallel projections are better when displaying 2D images
+    int axis = this->GetAxis( );
+    camera->ParallelProjectionOn( );
+    camera->SetFocalPoint( double( 0 ), double( 0 ), double( 0 ) );
+    if( axis == 0 )
+    {
+      camera->SetPosition( double( 1 ), double( 0 ), double( 0 ) );
+      camera->SetViewUp  ( double( 0 ), double( 0 ), double( 1 ) );
+    }
+    else if( axis == 1 )
+    {
+      camera->SetPosition( double( 0 ), double( -1 ), double( 0 ) );
+      camera->SetViewUp  ( double( 0 ), double(  0 ), double( 1 ) );
+    }
+    else // if( axis == 2 )
+    {
+      camera->SetPosition( double( 0 ), double(  0 ), double( -1 ) );
+      camera->SetViewUp  ( double( 0 ), double( -1 ), double(  0 ) );
+
+    } // fi
+
+  } // fi
+  renderer->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+PopActorsFrom( vtkRenderWindow* window )
+{
+  vtkRenderWindowInteractor* rwi = window->GetInteractor( );
+  vtkRenderer* renderer = window->GetRenderers( )->GetFirstRenderer( );
+  if( renderer != NULL )
+  {
+    renderer->RemoveViewProp( this->m_ImageActor );
+    renderer->RemoveViewProp( this->m_BlenderActor );
+    renderer->RemoveViewProp( this->m_CursorActor );
+    renderer->RemoveViewProp( this->m_PlaneActor );
+    renderer->RemoveViewProp( this->m_TextActor );
+    renderer->RemoveViewProp( this->m_Axis1Actor );
+    renderer->RemoveViewProp( this->m_Axis2Actor );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::ImageSliceActors::
+GetNumberOfImages( ) const
+{
+  return( this->m_Blender->GetNumberOfInputs( ) );
+}
+
+// -------------------------------------------------------------------------
+vtkImageActor* cpExtensions::Visualization::ImageSliceActors::
+GetImageActor( )
+{
+  return( this->m_ImageActor );
+}
+
+// -------------------------------------------------------------------------
+const vtkImageActor* cpExtensions::Visualization::ImageSliceActors::
+GetImageActor( ) const
+{
+  return( this->m_ImageActor );
+}
+
+// -------------------------------------------------------------------------
+vtkImageActor* cpExtensions::Visualization::ImageSliceActors::
+GetBinaryActor( )
+{
+  return( this->m_BlenderActor );
+}
+
+// -------------------------------------------------------------------------
+const vtkImageActor* cpExtensions::Visualization::ImageSliceActors::
+GetBinaryActor( ) const
+{
+  return( this->m_BlenderActor );
+}
+
+// -------------------------------------------------------------------------
+vtkTextActor* cpExtensions::Visualization::ImageSliceActors::
+GetTextActor( )
+{
+  return( this->m_TextActor );
+}
+
+// -------------------------------------------------------------------------
+const vtkTextActor* cpExtensions::Visualization::ImageSliceActors::
+GetTextActor( ) const
+{
+  return( this->m_TextActor );
+}
+
+// -------------------------------------------------------------------------
+vtkActor* cpExtensions::Visualization::ImageSliceActors::
+GetPlaneActor( )
+{
+  return( this->m_PlaneActor );
+}
+
+// -------------------------------------------------------------------------
+const vtkActor* cpExtensions::Visualization::ImageSliceActors::
+GetPlaneActor( ) const
+{
+  return( this->m_PlaneActor );
+}
+
+// -------------------------------------------------------------------------
+vtkPlane* cpExtensions::Visualization::ImageSliceActors::
+GetPlaneFunction( )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetSlicePlane( ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const vtkPlane* cpExtensions::Visualization::ImageSliceActors::
+GetPlaneFunction( ) const
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetSlicePlane( ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetInterpolate( bool v )
+{
+  if( this->m_Interpolate != v )
+  {
+    this->m_ImageActor->SetInterpolate( v );
+    this->m_BlenderActor->SetInterpolate( v );
+    this->m_Interpolate = v;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+InterpolateOn( )
+{
+  this->SetInterpolate( true );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+InterpolateOff( )
+{
+  this->SetInterpolate( false );
+}
+
+// -------------------------------------------------------------------------
+double* cpExtensions::Visualization::ImageSliceActors::
+GetDisplayBounds( ) const
+{
+  if( this->m_ImageActor.GetPointer( ) != NULL )
+    return( this->m_ImageActor->GetDisplayBounds( ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+GetDisplayBounds( double bounds[ 6 ] ) const
+{
+  if( this->m_ImageActor.GetPointer( ) == NULL )
+  {
+    bounds[ 0 ] = bounds[ 2 ] = bounds[ 4 ] = double(  0 );
+    bounds[ 1 ] = bounds[ 3 ] = bounds[ 5 ] = double( -1 );
+  }
+  else
+    this->m_ImageActor->GetDisplayBounds( bounds );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+ResetCursor( )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+  {
+    double pos[] =
+      {
+        this->m_VisibleBounds[ 0 ],
+        this->m_VisibleBounds[ 2 ],
+        this->m_VisibleBounds[ 4 ]
+      };
+    this->SetCursor( pos );
+  }
+  else
+  {
+    vtkPoints* points = this->m_Cursor->GetPoints( );
+    points->SetPoint( 0, 0, 0, 0 );
+    points->SetPoint( 1, 0, 0, 0 );
+    points->SetPoint( 2, 0, 0, 0 );
+    points->SetPoint( 3, 0, 0, 0 );
+    this->m_Cursor->Modified( );
+    this->m_CursorMapper->Modified( );
+    this->m_CursorActor->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetCursor( double pos[ 3 ] )
+{
+  if( this->m_ImageMapper.GetPointer( ) == NULL )
+    return;
+
+  // Get ordered axes
+  int a0 = this->GetAxis( );
+  int a1 = ( a0 + 1 ) % 3;
+  int a2 = ( a0 + 2 ) % 3;
+  int ma0 = a0 << 1;
+  int ma1 = a1 << 1;
+  int ma2 = a2 << 1;
+
+  // Update cross
+  double* bounds = this->m_VisibleBounds;
+  double p0[ 3 ], p1[ 3 ], p2[ 3 ], p3[ 3 ];
+
+  p0[ a2 ] = p1[ a2 ] = pos[ a2 ];
+  p2[ a1 ] = p3[ a1 ] = pos[ a1 ];
+  p0[ a0 ] = p1[ a0 ] = p2[ a0 ] = p3[ a0 ] = bounds[ ma0 ];
+  p0[ a1 ] = bounds[ ma1 ];
+  p1[ a1 ] = bounds[ ma1 + 1 ];
+  p2[ a2 ] = bounds[ ma2 ];
+  p3[ a2 ] = bounds[ ma2 + 1 ];
+
+  vtkPoints* points = this->m_Cursor->GetPoints( );
+  points->SetPoint( 0, p0 );
+  points->SetPoint( 1, p1 );
+  points->SetPoint( 2, p2 );
+  points->SetPoint( 3, p3 );
+  this->m_Cursor->Modified( );
+  this->m_CursorMapper->Modified( );
+  this->m_CursorActor->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+ResetAxesCursor( )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+  {
+    double pos[] =
+      {
+        this->m_VisibleBounds[ 0 ],
+        this->m_VisibleBounds[ 2 ],
+        this->m_VisibleBounds[ 4 ]
+      };
+    this->SetAxesCursor( pos );
+  }
+  else
+  {
+    vtkPoints* points = this->m_Axis1->GetPoints( );
+    points->SetPoint( 0, 0, 0, 0 );
+    points->SetPoint( 1, 0, 0, 0 );
+    this->m_Axis1->Modified( );
+    this->m_Axis1Mapper->Modified( );
+    this->m_Axis1Actor->Modified( );
+
+    points = this->m_Axis2->GetPoints( );
+    points->SetPoint( 0, 0, 0, 0 );
+    points->SetPoint( 1, 0, 0, 0 );
+    this->m_Axis2->Modified( );
+    this->m_Axis2Mapper->Modified( );
+    this->m_Axis2Actor->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetAxesCursor( double pos[ 3 ] )
+{
+  if( this->m_ImageMapper.GetPointer( ) == NULL )
+    return;
+
+  // Get ordered axes
+  int a0 = this->GetAxis( );
+  int a1 = ( a0 + 1 ) % 3;
+  int a2 = ( a0 + 2 ) % 3;
+  int ma0 = a0 << 1;
+  int ma1 = a1 << 1;
+  int ma2 = a2 << 1;
+
+  // Update cross
+  double* bounds = this->m_VisibleBounds;
+  double p0[ 3 ], p1[ 3 ], p2[ 3 ], p3[ 3 ];
+
+  p0[ a2 ] = p1[ a2 ] = pos[ a2 ];
+  p2[ a1 ] = p3[ a1 ] = pos[ a1 ];
+  p0[ a0 ] = p1[ a0 ] = p2[ a0 ] = p3[ a0 ] = bounds[ ma0 ];
+  p0[ a1 ] = bounds[ ma1 ];
+  p1[ a1 ] = bounds[ ma1 + 1 ];
+  p2[ a2 ] = bounds[ ma2 ];
+  p3[ a2 ] = bounds[ ma2 + 1 ];
+
+  vtkPoints* points1 = this->m_Axis1->GetPoints( );
+  points1->SetPoint( 0, p2 );
+  points1->SetPoint( 1, p3 );
+
+  vtkPoints* points2 = this->m_Axis2->GetPoints( );
+  points2->SetPoint( 0, p0 );
+  points2->SetPoint( 1, p1 );
+
+  this->m_Axis1->Modified( );
+  this->m_Axis1Mapper->Modified( );
+  this->m_Axis1Actor->Modified( );
+
+  this->m_Axis2->Modified( );
+  this->m_Axis2Mapper->Modified( );
+  this->m_Axis2Actor->Modified( );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMinWindow( ) const
+{
+  return( this->m_WLRange[ 0 ] );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMaxWindow( ) const
+{
+  return( this->m_WLRange[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMinLevel( ) const
+{
+  return( this->m_WLRange[ 2 ] );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetMaxLevel( ) const
+{
+  return( this->m_WLRange[ 3 ] );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetWindow( ) const
+{
+  if( this->m_ImageActor.GetPointer( ) != NULL )
+    return( this->m_ImageActor->GetProperty( )->GetColorWindow( ) );
+  else
+    return( double( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetLevel( ) const
+{
+  if( this->m_ImageActor.GetPointer( ) != NULL )
+    return( this->m_ImageActor->GetProperty( )->GetColorLevel( ) );
+  else
+    return( double( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetWindow( double w )
+{
+  if( this->m_ImageActor.GetPointer( ) == NULL )
+    return;
+  double v = ( w < this->m_WLRange[ 0 ] )? this->m_WLRange[ 0 ]: w;
+  v        = ( v > this->m_WLRange[ 1 ] )? this->m_WLRange[ 1 ]: v;
+  this->m_ImageActor->GetProperty( )->SetColorWindow( v );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetLevel( double l )
+{
+  if( this->m_ImageActor.GetPointer( ) == NULL )
+    return;
+  double v = ( l < this->m_WLRange[ 2 ] )? this->m_WLRange[ 2 ]: l;
+  v        = ( v > this->m_WLRange[ 3 ] )? this->m_WLRange[ 3 ]: v;
+  this->m_ImageActor->GetProperty( )->SetColorLevel( v );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetWindowLevel( double w, double l )
+{
+  if( this->m_ImageActor.GetPointer( ) == NULL )
+    return;
+  double a = ( w < this->m_WLRange[ 0 ] )? this->m_WLRange[ 0 ]: w;
+  a        = ( a > this->m_WLRange[ 1 ] )? this->m_WLRange[ 1 ]: a;
+  double b = ( l < this->m_WLRange[ 2 ] )? this->m_WLRange[ 2 ]: l;
+  b        = ( b > this->m_WLRange[ 3 ] )? this->m_WLRange[ 3 ]: b;
+  this->m_ImageActor->GetProperty( )->SetColorWindow( a );
+  this->m_ImageActor->GetProperty( )->SetColorLevel( b );
+  this->UpdateText( a, b );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+ResetWindowLevel( )
+{
+  this->SetWindowLevel(
+    this->m_WLRange[ 1 ] * double( 0.5 ),
+    ( this->m_WLRange[ 3 ] + this->m_WLRange[ 2 ] ) * double( 0.5 )
+    );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageSliceActors::
+GetAxis( ) const
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetOrientation( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageSliceActors::
+GetSliceNumber( ) const
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetSliceNumber( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageSliceActors::
+GetSliceNumberMinValue( ) const
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetSliceNumberMinValue( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::ImageSliceActors::
+GetSliceNumberMaxValue( ) const
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+    return( this->m_ImageMapper->GetSliceNumberMaxValue( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetSliceNumber( const int& slice )
+{
+  if( this->m_ImageMapper.GetPointer( ) == NULL )
+    return;
+
+  int axis = this->GetAxis( );
+  double prev_pos = this->m_VisibleBounds[ axis << 1 ];
+
+  // Update mappers and display bounds
+  this->m_ImageMapper->SetSliceNumber( slice );
+  this->m_BlenderMapper->SetSliceNumber( slice );
+  this->m_ImageMapper->Modified( );
+  this->m_BlenderMapper->Modified( );
+  this->m_ImageActor->Modified( );
+  this->m_BlenderActor->Modified( );
+
+  // Update display extent (this isn't done automatically)
+  this->m_ImageMapper->GetInput( )->GetExtent( this->m_VisibleExtent );
+  this->m_VisibleExtent[ axis << 1 ] = slice;
+  this->m_VisibleExtent[ ( axis << 1 ) + 1 ] = slice;
+  this->m_ImageActor->SetDisplayExtent( this->m_VisibleExtent );
+
+  // Prepare plane data
+  this->m_ImageMapper->GetBounds( this->m_VisibleBounds );
+  double x0[][ 3 ] =
+    {
+      {
+        this->m_VisibleBounds[ 0 ],
+        this->m_VisibleBounds[ 2 ],
+        this->m_VisibleBounds[ 4 ]
+      },
+      {
+        this->m_VisibleBounds[ 1 ],
+        this->m_VisibleBounds[ 3 ],
+        this->m_VisibleBounds[ 5 ]
+      }
+    };
+  double p0[ 2 ][ 3 ];
+
+  vtkPlane* plane = this->m_ImageMapper->GetSlicePlane( );
+  plane->GeneralizedProjectPoint( x0[ 0 ], p0[ 0 ] );
+  plane->GeneralizedProjectPoint( x0[ 1 ], p0[ 1 ] );
+
+  this->m_VisibleBounds[ 0 ] = p0[ 0 ][ 0 ];
+  this->m_VisibleBounds[ 1 ] = p0[ 1 ][ 0 ];
+  this->m_VisibleBounds[ 2 ] = p0[ 0 ][ 1 ];
+  this->m_VisibleBounds[ 3 ] = p0[ 1 ][ 1 ];
+  this->m_VisibleBounds[ 4 ] = p0[ 0 ][ 2 ];
+  this->m_VisibleBounds[ 5 ] = p0[ 1 ][ 2 ];
+  double* bnds = this->m_VisibleBounds;
+
+  // Configure visualization and implicit plane orientation
+  this->m_PlaneActor->GetProperty( )->SetRepresentationToWireframe( );
+  this->m_PlaneActor->GetProperty( )->SetLineWidth( 3 );
+  vtkPoints* plane_points = this->m_Plane->GetPoints( );
+  plane_points->SetPoint( 0, bnds[ 0 ], bnds[ 2 ], bnds[ 4 ] );
+  plane_points->SetPoint( 2, bnds[ 1 ], bnds[ 3 ], bnds[ 5 ] );
+  if( axis == 0 || axis == 2 ) // YZ, x-normal
+  {
+    plane_points->SetPoint( 1, bnds[ 1 ], bnds[ 2 ], bnds[ 5 ] );
+    plane_points->SetPoint( 3, bnds[ 0 ], bnds[ 3 ], bnds[ 4 ] );
+  }
+  else if( axis == 1 ) // ZX, y-normal
+  {
+    plane_points->SetPoint( 1, bnds[ 0 ], bnds[ 2 ], bnds[ 5 ] );
+    plane_points->SetPoint( 3, bnds[ 1 ], bnds[ 3 ], bnds[ 4 ] );
+
+  } // fi
+
+  // Set plane colors
+  this->m_PlaneActor->GetProperty( )->
+    SetColor( this->m_PlaneColors[ axis ] );
+  this->m_Axis1Actor->GetProperty( )->
+    SetColor( this->m_PlaneColors[ ( axis + 1 ) % 3 ] );
+  this->m_Axis2Actor->GetProperty( )->
+    SetColor( this->m_PlaneColors[ ( axis + 2 ) % 3 ] );
+
+  this->m_Plane->Modified( );
+  this->m_PlaneMapper->Modified( );
+  this->m_PlaneActor->Modified( );
+
+  this->m_Axis1->Modified( );
+  this->m_Axis1Mapper->Modified( );
+  this->m_Axis1Actor->Modified( );
+
+  this->m_Axis2->Modified( );
+  this->m_Axis2Mapper->Modified( );
+  this->m_Axis2Actor->Modified( );
+
+  // Update text
+  this->UpdateText( );
+
+  // Update camera position
+  if( this->m_Window == NULL )
+    return;
+  vtkRenderer* renderer =
+    this->m_Window->GetRenderers( )->GetFirstRenderer( );
+  if( renderer == NULL )
+    return;
+  vtkCamera* camera = renderer->GetActiveCamera( );
+  if( camera == NULL )
+    return;
+  double cam_pos[ 3 ];
+  camera->GetPosition( cam_pos );
+  cam_pos[ axis ] += this->m_VisibleBounds[ axis << 1 ] - prev_pos;
+  camera->SetPosition( cam_pos );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetSlice( double* pos )
+{
+  vtkImageData* image = this->GetInputImage( );
+  if( image == NULL )
+    return;
+
+  int ijk[ 3 ];
+  double pcoords[ 3 ];
+  image->ComputeStructuredCoordinates( pos, ijk, pcoords );
+  this->SetSliceNumber( ijk[ this->GetAxis( ) ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+UpdateText( )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+  {
+    char axis;
+    int axId = this->m_ImageMapper->GetOrientation( );
+    if     ( axId == 0 ) axis = 'X';
+    else if( axId == 1 ) axis = 'Y';
+    else if( axId == 2 ) axis = 'Z';
+
+#if defined(WIN32)
+    sprintf_s(
+      this->m_TextBuffer, 1024, "Axis: %c (%d)",
+      axis, this->m_ImageMapper->GetSliceNumber( )
+      );
+#else // defined(WIN32)
+    std::sprintf(
+      this->m_TextBuffer, "Axis: %c (%d)",
+      axis, this->m_ImageMapper->GetSliceNumber( )
+      );
+#endif // defined(WIN32)
+  }
+  else
+    this->m_TextBuffer[ 0 ] = '\0';
+  this->m_TextActor->SetInput( this->m_TextBuffer );
+  this->m_TextActor->Modified( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+UpdateText( double pos[ 3 ] )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+  {
+    char axis;
+    int axId = this->m_ImageMapper->GetOrientation( );
+    if     ( axId == 0 ) axis = 'X';
+    else if( axId == 1 ) axis = 'Y';
+    else if( axId == 2 ) axis = 'Z';
+    int slice = this->GetSliceNumber( );
+
+    vtkImageData* image = this->GetInputImage( );
+    int ijk[ 3 ];
+    double pcoords[ 3 ];
+    image->ComputeStructuredCoordinates( pos, ijk, pcoords );
+    ijk[ axId ] = slice;
+
+    int ext[ 6 ];
+    image->GetExtent( ext );
+    if(
+      ext[ 0 ] <= ijk[ 0 ] && ijk[ 0 ] <= ext[ 1 ] &&
+      ext[ 2 ] <= ijk[ 1 ] && ijk[ 1 ] <= ext[ 3 ] &&
+      ext[ 4 ] <= ijk[ 2 ] && ijk[ 2 ] <= ext[ 5 ]
+      )
+    {
+      int nScl = image->GetNumberOfScalarComponents( );
+      std::stringstream str;
+      str
+        << "[" << ijk[ 0 ]
+        << "," << ijk[ 1 ]
+        << "," << ijk[ 2 ] << "]=(";
+      str <<
+        image->GetScalarComponentAsFloat( ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], 0 );
+      for( int n = 1; n < nScl; ++n )
+        str
+          << " "
+          << image->GetScalarComponentAsFloat(
+            ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], n
+            );
+      str << ")";
+
+#if defined(WIN32)
+      sprintf_s(
+        this->m_TextBuffer, 1024, "Axis: %c (%d)\nPixel %s",
+        axis, slice, str.str( ).c_str( )
+        );
+#else // defined(WIN32)
+      std::sprintf(
+        this->m_TextBuffer, "Axis: %c (%d)\nPixel %s",
+        axis, slice, str.str( ).c_str( )
+        );
+#endif // defined(WIN32)
+    } // fi
+  }
+  else
+    this->m_TextBuffer[ 0 ] = '\0';
+  this->m_TextActor->SetInput( this->m_TextBuffer );
+  this->m_TextActor->Modified( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+UpdateText( const double& w, const double& l )
+{
+  if( this->m_ImageMapper.GetPointer( ) != NULL )
+  {
+    char axis;
+    int axId = this->m_ImageMapper->GetOrientation( );
+    if     ( axId == 0 ) axis = 'X';
+    else if( axId == 1 ) axis = 'Y';
+    else if( axId == 2 ) axis = 'Z';
+
+#if defined(WIN32)
+    sprintf_s(
+      this->m_TextBuffer, 1024, "Axis: %c (%d)\nW/L (%.2f/%.2f)",
+      axis, this->m_ImageMapper->GetSliceNumber( ), w, l
+      );
+#else // defined(WIN32)
+    std::sprintf(
+      this->m_TextBuffer, "Axis: %c (%d)\nW/L (%.2f/%.2f)",
+      axis, this->m_ImageMapper->GetSliceNumber( ), w, l
+      );
+#endif // defined(WIN32)
+  }
+  else
+    this->m_TextBuffer[ 0 ] = '\0';
+  this->m_TextActor->SetInput( this->m_TextBuffer );
+  this->m_TextActor->Modified( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+Render( )
+{
+  if( this->m_Window == NULL )
+    return;
+  vtkRenderer* renderer =
+    this->m_Window->GetRenderers( )->GetFirstRenderer( );
+  if( renderer == NULL )
+    return;
+  renderer->SetAllocatedRenderTime( 1e-3 );
+  this->m_Window->Render( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+ResetCamera( )
+{
+  if( this->m_Window == NULL )
+    return;
+  vtkRenderer* renderer =
+    this->m_Window->GetRenderers( )->GetFirstRenderer( );
+  if( renderer == NULL )
+    return;
+  renderer->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::ImageSliceActors::
+ImageSliceActors( )
+  : Superclass( ),
+    m_Window( NULL ),
+    m_Interpolate( false )
+{
+  this->Clear( );
+  this->_ConfigureStyle( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::ImageSliceActors::
+~ImageSliceActors( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_ConfigureStyle( )
+{
+  // Connect this view with a controller
+  this->m_Style = vtkSmartPointer< TStyle >::New( );
+  this->m_Style->SetAssociatedObject( this );
+  this->m_Style->AddMouseMoveCommand( Self::_MouseMoveCommand, this );
+  this->m_Style->AddMouseClickCommand( Self::_MouseClickCommand, this );
+  this->m_Style->AddMouseWheelCommand( Self::_MouseWheelCommand, this );
+  this->m_Style->AddKeyCommand( Self::_KeyCommand, this );
+  this->m_Style->AddEnterCommand( Self::_EnterCommand, this );
+  this->m_Style->AddLeaveCommand( Self::_LeaveCommand, this );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_ConfigureInputImage( )
+{
+  this->m_ImageMapper->SetOrientation( 0 );
+  this->m_ImageMapper->Update( );
+
+  // Create actor
+  this->m_ImageActor->SetInterpolate( this->m_Interpolate );
+  this->m_ImageActor->Modified( );
+
+  if( this->m_Style.GetPointer( ) != NULL )
+    this->m_Style->AssociateImageActor( this->m_ImageActor );
+  this->AddItem( this->m_ImageActor );
+
+  this->SetSliceNumber( this->GetSliceNumberMinValue( ) );
+  this->ResetCursor( );
+  this->Modified( );
+
+  // Reset cursors
+  this->ResetCursor( );
+  this->ResetAxesCursor( );
+
+  // Update window/level ranges
+  vtkImageData* data = this->GetInputImage( );
+  if( data != NULL )
+  {
+    double r[ 2 ];
+    data->GetScalarRange( r );
+    this->m_WLRange[ 0 ] = double( 0 );
+    this->m_WLRange[ 1 ] = r[ 1 ] - r[ 0 ];
+    this->m_WLRange[ 2 ] = r[ 0 ];
+    this->m_WLRange[ 3 ] = r[ 1 ];
+    this->ResetWindowLevel( );
+
+    // Configure blender
+    this->m_BlenderBase = vtkSmartPointer< vtkImageData >::New( );
+    this->m_BlenderBase->ShallowCopy( data );
+    this->m_BlenderBase->AllocateScalars( VTK_UNSIGNED_CHAR, 1 );
+    std::memset(
+      this->m_BlenderBase->GetScalarPointer( ), 0,
+      this->m_BlenderBase->GetActualMemorySize( )
+      );
+    this->m_Blender->AddInputData( this->m_BlenderBase );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_ConfigureBinaryImage( const double& r, const double& g, const double& b )
+{
+  unsigned int nValues = this->m_BlenderLUT->GetNumberOfTableValues( );
+  this->m_BlenderLUT->SetNumberOfTableValues( nValues + 1 );
+  this->m_BlenderLUT->SetTableRange( 0, nValues );
+  this->m_BlenderLUT->SetTableValue( nValues, r, g, b, 0.5 );
+  this->m_BlenderLUT->Build( );
+
+  this->m_BlenderLUT->Modified( );
+  this->m_Blender->Modified( );
+  this->m_Blender->Update( );
+
+  this->m_BlenderMapper->Modified( );
+  this->m_BlenderActor->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_MouseMoveCommand(
+  void* data, const TStyle::ButtonID& btn, int* idx, double* pos,
+  bool alt, bool ctr, bool sft
+  )
+{
+  ImageSliceActors* actors = reinterpret_cast< ImageSliceActors* >( data );
+  if( actors == NULL )
+    return;
+
+  if( btn == TStyle::ButtonID_None )
+  {
+    // Just show the pixel information
+    actors->SetCursor( pos );
+    actors->UpdateText( pos );
+    actors->Render( );
+  }
+  else if( btn == TStyle::ButtonID_Left )
+  {
+    if( !alt && ctr && !sft )
+    {
+      // Show axes in current renderer
+      actors->SetAxesCursor( pos );
+      actors->Render( );
+
+      // Interactively move slices
+      auto i = actors->m_SlicesCommands.begin( );
+      for( ; i != actors->m_SlicesCommands.end( ); ++i )
+        i->first( pos, actors->GetAxis( ), i->second );
+
+    } // fi
+  }
+  else if( btn == TStyle::ButtonID_Right )
+  {
+    if( !alt && !ctr && sft )
+    {
+      // Change image window level
+      double bounds[ 6 ];
+      actors->m_ImageMapper->GetBounds( bounds );
+
+      int a0 = actors->GetAxis( );
+      int a1 = ( a0 + 1 ) % 3;
+      int a2 = ( a0 + 2 ) % 3;
+      double dx = pos[ a1 ] - actors->m_StartWindowLevelPos[ a1 ];
+      double dy = pos[ a2 ] - actors->m_StartWindowLevelPos[ a2 ];
+      dx /= bounds[ ( a1 << 1 ) + 1 ] - bounds[ a1 << 1 ];
+      dy /= bounds[ ( a2 << 1 ) + 1 ] - bounds[ a2 << 1 ];
+
+      dx *= actors->m_StartWindowLevel[ 0 ];
+      dy *= actors->m_StartWindowLevel[ 1 ];
+      dx += actors->m_StartWindowLevel[ 0 ];
+      dy += actors->m_StartWindowLevel[ 1 ];
+      actors->SetWindowLevel( dx, dy );
+      actors->Render( );
+
+      // Associate objects
+      auto i = actors->m_WindowLevelCommands.begin( );
+      for( ; i != actors->m_WindowLevelCommands.end( ); ++i )
+        i->first( dx, dy, i->second );
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_MouseClickCommand(
+  void* data, const TStyle::ButtonID& btn, int* idx, double* pos,
+  bool alt, bool ctr, bool sft
+  )
+{
+  ImageSliceActors* actors = reinterpret_cast< ImageSliceActors* >( data );
+  if( actors == NULL )
+    return;
+
+  actors->m_StartWindowLevelPos[ 0 ] = pos[ 0 ];
+  actors->m_StartWindowLevelPos[ 1 ] = pos[ 1 ];
+  actors->m_StartWindowLevelPos[ 2 ] = pos[ 2 ];
+  actors->m_StartWindowLevel[ 0 ] = actors->GetWindow( );
+  actors->m_StartWindowLevel[ 1 ] = actors->GetLevel( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_MouseWheelCommand(
+  void* data, const int& dir,
+  bool alt, bool ctr, bool sft
+  )
+{
+  ImageSliceActors* actors = reinterpret_cast< ImageSliceActors* >( data );
+  if( actors == NULL )
+    return;
+
+  if( !alt && !ctr )
+  {
+    int slice = actors->GetSliceNumber( ) + ( dir * ( ( sft )? 10: 1 ) );
+    if( slice < actors->GetSliceNumberMinValue( ) )
+      slice = actors->GetSliceNumberMinValue( );
+    if( slice > actors->GetSliceNumberMaxValue( ) )
+      slice = actors->GetSliceNumberMaxValue( );
+    actors->SetSliceNumber( slice );
+    actors->Render( );
+
+    auto a = actors->m_AssociatedSlices.begin( );
+    for( ; a != actors->m_AssociatedSlices.end( ); ++a )
+      ( *a )->SetSliceNumber( slice );
+
+    // Associate objects
+    auto i = actors->m_RenderCommands.begin( );
+    for( ; i != actors->m_RenderCommands.end( ); ++i )
+      i->first( i->second );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_KeyCommand( void* data, const char& key )
+{
+  ImageSliceActors* actors = reinterpret_cast< ImageSliceActors* >( data );
+  if( actors == NULL )
+    return;
+
+  switch( key )
+  {
+  case 'r': case 'R':
+  {
+    actors->ResetCamera( );
+    actors->Render( );
+
+    // Associate objects
+    auto i = actors->m_RenderCommands.begin( );
+    for( ; i != actors->m_RenderCommands.end( ); ++i )
+      i->first( i->second );
+  }
+  break;
+  case 'w': case 'W':
+  {
+    actors->ResetWindowLevel( );
+    actors->Render( );
+
+    // Associate objects
+    auto i = actors->m_RenderCommands.begin( );
+    for( ; i != actors->m_RenderCommands.end( ); ++i )
+      i->first( i->second );
+  }
+  break;
+  default:
+    break;
+  } // hctiws
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_EnterCommand( void* data )
+{
+  ImageSliceActors* actors = reinterpret_cast< ImageSliceActors* >( data );
+  if( actors == NULL )
+    return;
+
+  actors->ResetCursor( );
+  actors->m_CursorActor->VisibilityOn( );
+  actors->Render( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_LeaveCommand( void* data )
+{
+  ImageSliceActors* actors = reinterpret_cast< ImageSliceActors* >( data );
+  if( actors == NULL )
+    return;
+
+  actors->ResetCursor( );
+  actors->m_CursorActor->VisibilityOff( );
+  actors->Render( );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/ImageSliceActors.h b/lib/cpExtensions/Visualization/ImageSliceActors.h
new file mode 100644 (file)
index 0000000..b4cec90
--- /dev/null
@@ -0,0 +1,236 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
+#define __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <vtkSmartPointer.h>
+#include <vtkActor.h>
+#include <vtkImageActor.h>
+#include <vtkImageSliceMapper.h>
+#include <vtkLookupTable.h>
+#include <vtkPlane.h>
+#include <vtkPolyData.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkPropCollection.h>
+#include <vtkTextActor.h>
+
+#include <cpExtensions/Interaction/ImageInteractorStyle.h>
+#include <cpExtensions/Visualization/ImageBlender.h>
+
+// -------------------------------------------------------------------------
+class vtkAlgorithmOutput;
+class vtkImageData;
+class vtkLookupTable;
+class vtkRenderer;
+
+// -------------------------------------------------------------------------
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    class cpExtensions_EXPORT ImageSliceActors
+      : public vtkPropCollection
+    {
+    public:
+      typedef ImageSliceActors Self;
+
+      typedef cpExtensions::Interaction::ImageInteractorStyle TStyle;
+      typedef TStyle::TMouseCommand            TMouseCommand;
+      typedef TStyle::TMouseWheelCommand       TMouseWheelCommand;
+      typedef TStyle::TKeyCommand              TKeyCommand;
+      typedef TStyle::TVoidCommand             TVoidCommand;
+      typedef TStyle::TMouseMoveCommand        TMouseMoveCommand;
+      typedef TStyle::TMouseClickCommand       TMouseClickCommand;
+      typedef TStyle::TMouseDoubleClickCommand TMouseDoubleClickCommand;
+      typedef TStyle::TExposeCommand           TExposeCommand;
+      typedef TStyle::TConfigureCommand        TConfigureCommand;
+      typedef TStyle::TEnterCommand            TEnterCommand;
+      typedef TStyle::TLeaveCommand            TLeaveCommand;
+      typedef void ( *TSlicesCommand )( double*, int, void* );
+      typedef void ( *TWindowLevelCommand )( double, double, void* );
+      typedef TVoidCommand TRenderCommand;
+
+      typedef cpExtensions::Visualization::ImageBlender TBlender;
+
+    public:
+      vtkTypeMacro( ImageSliceActors, vtkPropCollection );
+
+      cpExtensions_BaseInteractorStyle_Commands( Slices );
+      cpExtensions_BaseInteractorStyle_Commands( WindowLevel );
+      cpExtensions_BaseInteractorStyle_Commands( Render );
+
+    public:
+      // Creation
+      static ImageSliceActors* New( );
+
+      void SetAxis( int axis );
+      void SetInputConnection( vtkAlgorithmOutput* aout );
+      void SetInputImage( vtkImageData* data );
+      int AddBinaryConnection(
+        vtkAlgorithmOutput* aout,
+        const double& r, const double& g, const double& b
+        );
+      int AddBinaryImage(
+        vtkImageData* data,
+        const double& r, const double& g, const double& b
+        );
+      void Clear( );
+
+      void AssociateSlice( Self* slice );
+
+      vtkImageData* GetInputImage( );
+      const vtkImageData* GetInputImage( ) const;
+
+      vtkInteractorStyle* GetStyle( );
+      const vtkInteractorStyle* GetStyle( ) const;
+
+      void PushActorsInto( vtkRenderWindow* window, bool force_style = true );
+      void PopActorsFrom( vtkRenderWindow* window );
+      unsigned int GetNumberOfImages( ) const;
+
+      vtkImageActor* GetImageActor( );
+      const vtkImageActor* GetImageActor( ) const;
+      vtkImageActor* GetBinaryActor( );
+      const vtkImageActor* GetBinaryActor( ) const;
+      vtkTextActor* GetTextActor( );
+      const vtkTextActor* GetTextActor( ) const;
+      vtkActor* GetPlaneActor( );
+      const vtkActor* GetPlaneActor( ) const;
+      vtkPlane* GetPlaneFunction( );
+      const vtkPlane* GetPlaneFunction( ) const;
+
+      void SetInterpolate( bool v );
+      void InterpolateOn( );
+      void InterpolateOff( );
+
+      double* GetDisplayBounds( ) const;
+      void GetDisplayBounds( double bounds[ 6 ] ) const;
+
+      void ResetCursor( );
+      void SetCursor( double pos[ 3 ] );
+
+      void ResetAxesCursor( );
+      void SetAxesCursor( double pos[ 3 ] );
+
+      double GetMinWindow( ) const;
+      double GetMaxWindow( ) const;
+      double GetMinLevel( ) const;
+      double GetMaxLevel( ) const;
+      double GetWindow( ) const;
+      double GetLevel( ) const;
+      void SetWindow( double w );
+      void SetLevel( double l );
+      void SetWindowLevel( double w, double l );
+      void ResetWindowLevel( );
+
+      int GetAxis( ) const;
+      int GetSliceNumber( ) const;
+      int GetSliceNumberMinValue( ) const;
+      int GetSliceNumberMaxValue( ) const;
+      void SetSliceNumber( const int& slice );
+      void SetSlice( double* pos );
+      void UpdateText( );
+      void UpdateText( double pos[ 3 ] );
+      void UpdateText( const double& w, const double& l );
+
+      void Render( );
+      void ResetCamera( );
+
+    protected:
+      ImageSliceActors( );
+      virtual ~ImageSliceActors( );
+
+      void _ConfigureStyle( );
+      void _ConfigureInputImage( );
+      void _ConfigureBinaryImage(
+        const double& r, const double& g, const double& b
+        );
+
+      // Events
+      static void _MouseMoveCommand(
+        void* data,
+        const TStyle::ButtonID& btn,
+        int* idx, double* pos,
+        bool alt, bool ctr, bool sft
+        );
+      static void _MouseClickCommand(
+        void* data,
+        const TStyle::ButtonID& btn,
+        int* idx, double* pos,
+        bool alt, bool ctr, bool sft
+        );
+      static void _MouseWheelCommand(
+        void* data,
+        const int& dir, bool alt, bool ctr, bool sft
+        );
+      static void _KeyCommand(
+        void* data,
+        const char& key
+        );
+      static void _EnterCommand( void* data );
+      static void _LeaveCommand( void* data );
+
+    private:
+      // Purposely not implemented
+      ImageSliceActors( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      static double m_PlaneColors[ 3 ][ 3 ];
+
+      vtkSmartPointer< TStyle > m_Style;
+      vtkRenderWindow* m_Window;
+
+      // Multiple actors
+      vtkSmartPointer< vtkImageSliceMapper > m_ImageMapper;
+      vtkSmartPointer< vtkImageActor >       m_ImageActor;
+
+      vtkSmartPointer< vtkImageData >        m_BlenderBase;
+      vtkSmartPointer< TBlender >            m_Blender;
+      vtkSmartPointer< vtkImageSliceMapper > m_BlenderMapper;
+      vtkSmartPointer< vtkLookupTable >      m_BlenderLUT;
+      vtkSmartPointer< vtkImageActor >       m_BlenderActor;
+
+      bool m_Interpolate;
+
+      double m_WLRange[ 4 ];
+
+      int    m_VisibleExtent[ 6 ];
+      double m_VisibleBounds[ 6 ];
+
+      // Associated slices
+      std::vector< Self* > m_AssociatedSlices;
+
+      // Unique objects
+      vtkSmartPointer< vtkPolyData >       m_Cursor;
+      vtkSmartPointer< vtkPolyDataMapper > m_CursorMapper;
+      vtkSmartPointer< vtkActor >          m_CursorActor;
+
+      vtkSmartPointer< vtkPolyData >       m_Axis1;
+      vtkSmartPointer< vtkPolyDataMapper > m_Axis1Mapper;
+      vtkSmartPointer< vtkActor >          m_Axis1Actor;
+
+      vtkSmartPointer< vtkPolyData >       m_Axis2;
+      vtkSmartPointer< vtkPolyDataMapper > m_Axis2Mapper;
+      vtkSmartPointer< vtkActor >          m_Axis2Actor;
+
+      vtkSmartPointer< vtkPolyData >       m_Plane;
+      vtkSmartPointer< vtkPolyDataMapper > m_PlaneMapper;
+      vtkSmartPointer< vtkActor >          m_PlaneActor;
+
+      char                                 m_TextBuffer[ 1024 ];
+      vtkSmartPointer< vtkTextActor >      m_TextActor;
+
+      double m_StartWindowLevelPos[ 3 ];
+      double m_StartWindowLevel[ 2 ];
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif //  __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MPRActors.cxx b/lib/cpExtensions/Visualization/MPRActors.cxx
new file mode 100644 (file)
index 0000000..e26651b
--- /dev/null
@@ -0,0 +1,500 @@
+#include <cpExtensions/Visualization/MPRActors.h>
+
+#include <vtkAlgorithmOutput.h>
+#include <vtkImageData.h>
+#include <vtkOutlineSource.h>
+#include <vtkProperty.h>
+#include <vtkRenderer.h>
+#include <vtkRendererCollection.h>
+#include <vtkRenderWindow.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRActors*
+cpExtensions::Visualization::MPRActors::
+New( )
+{
+  return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::
+ImageSliceActors* cpExtensions::Visualization::MPRActors::
+GetSliceActors( const int& i ) const
+{
+  if( i < 3 )
+    return( this->Slices[ 0 ][ i ] );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetInputConnection( vtkAlgorithmOutput* aout )
+{
+  for( int i = 0; i < 2; ++i )
+  {
+    for( int j = 0; j < 3; ++j )
+    {
+      this->Slices[ i ][ j ]->SetInputConnection( aout );
+      this->Slices[ i ][ j ]->SetAxis( j );
+
+    } // rof
+
+  } // rof
+  this->_CreateBoundingBox( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetInputImage( vtkImageData* data )
+{
+  for( int i = 0; i < 2; ++i )
+  {
+    for( int j = 0; j < 3; ++j )
+    {
+      this->Slices[ i ][ j ]->SetInputImage( data );
+      this->Slices[ i ][ j ]->SetAxis( j );
+
+    } // rof
+
+  } // rof
+  this->_CreateBoundingBox( );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRActors::
+AddBinaryConnection(
+  vtkAlgorithmOutput* aout,
+  const double& r, const double& g, const double& b
+  )
+{
+  this->Slices[ 0 ][ 0 ]->AddBinaryConnection( aout, r, g, b );
+  this->Slices[ 0 ][ 1 ]->AddBinaryConnection( aout, r, g, b );
+  this->Slices[ 0 ][ 2 ]->AddBinaryConnection( aout, r, g, b );
+  this->Slices[ 1 ][ 0 ]->AddBinaryConnection( aout, r, g, b );
+  this->Slices[ 1 ][ 1 ]->AddBinaryConnection( aout, r, g, b );
+  return( this->Slices[ 1 ][ 2 ]->AddBinaryConnection( aout, r, g, b ) );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRActors::
+AddBinaryImage(
+  vtkImageData* data,
+  const double& r, const double& g, const double& b
+  )
+{
+  this->Slices[ 0 ][ 0 ]->AddBinaryImage( data, r, g, b );
+  this->Slices[ 0 ][ 1 ]->AddBinaryImage( data, r, g, b );
+  this->Slices[ 0 ][ 2 ]->AddBinaryImage( data, r, g, b );
+  this->Slices[ 1 ][ 0 ]->AddBinaryImage( data, r, g, b );
+  this->Slices[ 1 ][ 1 ]->AddBinaryImage( data, r, g, b );
+  return( this->Slices[ 1 ][ 2 ]->AddBinaryImage( data, r, g, b ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+Clear( )
+{
+  this->Slices[ 0 ][ 0 ]->Clear( );
+  this->Slices[ 0 ][ 1 ]->Clear( );
+  this->Slices[ 0 ][ 2 ]->Clear( );
+  this->Slices[ 1 ][ 0 ]->Clear( );
+  this->Slices[ 1 ][ 1 ]->Clear( );
+  this->Slices[ 1 ][ 2 ]->Clear( );
+}
+
+// -------------------------------------------------------------------------
+vtkImageData* cpExtensions::Visualization::MPRActors::
+GetInputImage( )
+{
+  return( this->Slices[ 0 ][ 0 ]->GetInputImage( ) );
+}
+
+// -------------------------------------------------------------------------
+const vtkImageData* cpExtensions::Visualization::MPRActors::
+GetInputImage( ) const
+{
+  return( this->Slices[ 0 ][ 0 ]->GetInputImage( ) );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::MPRActors::
+GetNumberOfImages( ) const
+{
+  return( this->Slices[ 0 ][ 0 ]->GetNumberOfImages( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetInterpolate( bool v )
+{
+  this->Slices[ 0 ][ 0 ]->SetInterpolate( v );
+  this->Slices[ 0 ][ 1 ]->SetInterpolate( v );
+  this->Slices[ 0 ][ 2 ]->SetInterpolate( v );
+  this->Slices[ 1 ][ 0 ]->SetInterpolate( v );
+  this->Slices[ 1 ][ 1 ]->SetInterpolate( v );
+  this->Slices[ 1 ][ 2 ]->SetInterpolate( v );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+InterpolateOn( )
+{
+  this->SetInterpolate( true );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+InterpolateOff( )
+{
+  this->SetInterpolate( false );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+PushActorsInto(
+  vtkRenderWindow* x,
+  vtkRenderWindow* y,
+  vtkRenderWindow* z,
+  vtkRenderWindow* w
+  )
+{
+  this->Slices[ 0 ][ 0 ]->PushActorsInto( x, true );
+  this->Slices[ 0 ][ 1 ]->PushActorsInto( y, true );
+  this->Slices[ 0 ][ 2 ]->PushActorsInto( z, true );
+  this->Slices[ 1 ][ 0 ]->PushActorsInto( w, false );
+  this->Slices[ 1 ][ 1 ]->PushActorsInto( w, false );
+  this->Slices[ 1 ][ 2 ]->PushActorsInto( w, false );
+
+  vtkRenderer* wren =
+    ( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL;
+  if( wren != NULL )
+  {
+    wren->AddViewProp( this->ImageOutlineActor );
+    wren->AddViewProp( this->Slices[ 1 ][ 0 ]->GetPlaneActor( ) );
+    wren->AddViewProp( this->Slices[ 1 ][ 1 ]->GetPlaneActor( ) );
+    wren->AddViewProp( this->Slices[ 1 ][ 2 ]->GetPlaneActor( ) );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+PopActorsFrom(
+  vtkRenderWindow* x,
+  vtkRenderWindow* y,
+  vtkRenderWindow* z,
+  vtkRenderWindow* w
+  )
+{
+  this->Slices[ 0 ][ 0 ]->PopActorsFrom( x );
+  this->Slices[ 0 ][ 1 ]->PopActorsFrom( y );
+  this->Slices[ 0 ][ 2 ]->PopActorsFrom( z );
+  this->Slices[ 1 ][ 0 ]->PopActorsFrom( w );
+  this->Slices[ 1 ][ 1 ]->PopActorsFrom( w );
+  this->Slices[ 1 ][ 2 ]->PopActorsFrom( w );
+
+  vtkRenderer* wren =
+    ( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL;
+  if( wren != NULL )
+  {
+    wren->RemoveViewProp( this->ImageOutlineActor );
+    wren->RemoveViewProp( this->Slices[ 1 ][ 0 ]->GetPlaneActor( ) );
+    wren->RemoveViewProp( this->Slices[ 1 ][ 1 ]->GetPlaneActor( ) );
+    wren->RemoveViewProp( this->Slices[ 1 ][ 2 ]->GetPlaneActor( ) );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRActors::
+GetMinWindow( ) const
+{
+  return( this->Slices[ 0 ][ 0 ]->GetMinWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRActors::
+GetMaxWindow( ) const
+{
+  return( this->Slices[ 0 ][ 0 ]->GetMaxWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRActors::
+GetMinLevel( ) const
+{
+  return( this->Slices[ 0 ][ 0 ]->GetMinLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRActors::
+GetMaxLevel( ) const
+{
+  return( this->Slices[ 0 ][ 0 ]->GetMaxLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRActors::
+GetWindow( )
+{
+  return( this->Slices[ 0 ][ 0 ]->GetWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRActors::
+GetLevel( )
+{
+  return( this->Slices[ 0 ][ 0 ]->GetLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetWindow( double w )
+{
+  this->Slices[ 0 ][ 0 ]->SetWindow( w );
+  this->Slices[ 0 ][ 1 ]->SetWindow( w );
+  this->Slices[ 0 ][ 2 ]->SetWindow( w );
+  this->Slices[ 1 ][ 0 ]->SetWindow( w );
+  this->Slices[ 1 ][ 1 ]->SetWindow( w );
+  this->Slices[ 1 ][ 2 ]->SetWindow( w );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetLevel( double l )
+{
+  this->Slices[ 0 ][ 0 ]->SetLevel( l );
+  this->Slices[ 0 ][ 1 ]->SetLevel( l );
+  this->Slices[ 0 ][ 2 ]->SetLevel( l );
+  this->Slices[ 1 ][ 0 ]->SetLevel( l );
+  this->Slices[ 1 ][ 1 ]->SetLevel( l );
+  this->Slices[ 1 ][ 2 ]->SetLevel( l );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetWindowLevel( double w, double l )
+{
+  this->Slices[ 0 ][ 0 ]->SetWindowLevel( w, l );
+  this->Slices[ 0 ][ 1 ]->SetWindowLevel( w, l );
+  this->Slices[ 0 ][ 2 ]->SetWindowLevel( w, l );
+  this->Slices[ 1 ][ 0 ]->SetWindowLevel( w, l );
+  this->Slices[ 1 ][ 1 ]->SetWindowLevel( w, l );
+  this->Slices[ 1 ][ 2 ]->SetWindowLevel( w, l );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+ResetWindowLevel( )
+{
+  this->Slices[ 0 ][ 0 ]->ResetWindowLevel( );
+  this->Slices[ 0 ][ 1 ]->ResetWindowLevel( );
+  this->Slices[ 0 ][ 2 ]->ResetWindowLevel( );
+  this->Slices[ 1 ][ 0 ]->ResetWindowLevel( );
+  this->Slices[ 1 ][ 1 ]->ResetWindowLevel( );
+  this->Slices[ 1 ][ 2 ]->ResetWindowLevel( );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRActors::
+GetSliceNumber( const int& axis ) const
+{
+  if( axis < 3 )
+    return( this->Slices[ 0 ][ axis ]->GetSliceNumber( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRActors::
+GetSliceNumberMinValue( const int& axis ) const
+{
+  if( axis < 3 )
+    return( this->Slices[ 0 ][ axis ]->GetSliceNumberMinValue( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRActors::
+GetSliceNumberMaxValue( const int& axis ) const
+{
+  if( axis < 3 )
+    return( this->Slices[ 0 ][ axis ]->GetSliceNumberMaxValue( ) );
+  else
+    return( -1 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetSliceNumber( const int& axis, const int& slice )
+{
+  if( axis < 3 )
+  {
+    this->Slices[ 0 ][ axis ]->SetSliceNumber( slice );
+    this->Slices[ 1 ][ axis ]->SetSliceNumber( slice );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetSlice( const int& axis, double* pos )
+{
+  if( axis < 3 )
+  {
+    this->Slices[ 0 ][ axis ]->SetSlice( pos );
+    this->Slices[ 1 ][ axis ]->SetSlice( pos );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetAxesCursor( const int& axis, double* pos )
+{
+  if( axis < 3 )
+    this->Slices[ 0 ][ axis ]->SetAxesCursor( pos );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+Render( const int& axis )
+{
+  if( axis < 3 )
+  {
+    this->Slices[ 0 ][ axis ]->Render( );
+    this->Slices[ 1 ][ axis ]->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+Render( )
+{
+  this->Render( 0 );
+  this->Render( 1 );
+  this->Render( 2 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+ResetCamera( const int& axis )
+{
+  if( axis < 3 )
+    this->Slices[ 0 ][ axis ]->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+ResetCameras( )
+{
+  this->ResetCamera( 0 );
+  this->ResetCamera( 1 );
+  this->ResetCamera( 2 );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRActors::
+MPRActors( )
+  : Superclass( )
+{
+  this->ImageOutlineActor = vtkSmartPointer< vtkActor >::New( );
+  for( unsigned int i = 0; i < 2; ++i )
+    for( unsigned int j = 0; j < 3; ++j )
+      this->Slices[ i ][ j ] = vtkSmartPointer< ImageSliceActors >::New( );
+
+  this->Slices[ 0 ][ 0 ]->AssociateSlice( this->Slices[ 1 ][ 0 ] );
+  this->Slices[ 0 ][ 1 ]->AssociateSlice( this->Slices[ 1 ][ 1 ] );
+  this->Slices[ 0 ][ 2 ]->AssociateSlice( this->Slices[ 1 ][ 2 ] );
+
+  for( unsigned int i = 0; i < 3; ++ i )
+  {
+    this->Slices[ 0 ][ i ]->AddRenderCommand(
+      Self::_RenderCommand, this
+      );
+    this->Slices[ 0 ][ i ]->AddWindowLevelCommand(
+      Self::_WindowLevelCommand, this
+      );
+    this->Slices[ 0 ][ i ]->AddSlicesCommand( Self::_SlicesCommand, this );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRActors::
+~MPRActors( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+_CreateBoundingBox( )
+{
+  vtkImageData* image =
+    dynamic_cast< vtkImageData* >( this->Slices[ 0 ][ 0 ]->GetInputImage( ) );
+  if( image == NULL )
+    return;
+
+  // Create 3D outline
+  double bb[ 6 ];
+  image->GetBounds( bb );
+
+  vtkSmartPointer< vtkOutlineSource > img_ol =
+    vtkSmartPointer< vtkOutlineSource >::New( );
+  img_ol->SetBounds( bb );
+
+  vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper =
+    vtkSmartPointer< vtkPolyDataMapper >::New( );
+  img_ol_mapper->SetInputConnection( img_ol->GetOutputPort( ) );
+  this->ImageOutlineActor->SetMapper( img_ol_mapper );
+  this->ImageOutlineActor->GetProperty( )->SetColor( 1, 1, 1 );
+  this->ImageOutlineActor->GetProperty( )->SetLineWidth( 1 );
+
+  this->AddItem( this->ImageOutlineActor );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+_SlicesCommand( double* pos, int axis, void* data )
+{
+  MPRActors* actors = reinterpret_cast< MPRActors* >( data );
+  if( actors == NULL )
+    return;
+  for( unsigned int j = 0; j < 3; ++j )
+  {
+    if( actors->Slices[ 0 ][ j ]->GetAxis( ) != axis )
+    {
+      actors->SetSlice( j, pos );
+      actors->SetAxesCursor( j, pos );
+      actors->Render( j );
+
+    } // fi
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+_WindowLevelCommand( double window, double level, void* data )
+{
+  MPRActors* actors = reinterpret_cast< MPRActors* >( data );
+  if( actors == NULL )
+    return;
+  actors->SetWindowLevel( window, level );
+  actors->Render( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+_RenderCommand( void* data )
+{
+  MPRActors* actors = reinterpret_cast< MPRActors* >( data );
+  if( actors == NULL )
+    return;
+  actors->Render( );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MPRActors.h b/lib/cpExtensions/Visualization/MPRActors.h
new file mode 100644 (file)
index 0000000..91c0b50
--- /dev/null
@@ -0,0 +1,128 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
+#define __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions/Visualization/ImageSliceActors.h>
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    class cpExtensions_EXPORT MPRActors
+      : public vtkPropCollection
+    {
+    public:
+      typedef MPRActors Self;
+
+      typedef ImageSliceActors::TStyle                   TStyle;
+      typedef ImageSliceActors::TMouseCommand            TMouseCommand;
+      typedef ImageSliceActors::TMouseWheelCommand       TMouseWheelCommand;
+      typedef ImageSliceActors::TKeyCommand              TKeyCommand;
+      typedef ImageSliceActors::TVoidCommand             TVoidCommand;
+      typedef ImageSliceActors::TMouseMoveCommand        TMouseMoveCommand;
+      typedef ImageSliceActors::TMouseClickCommand       TMouseClickCommand;
+      typedef ImageSliceActors::TMouseDoubleClickCommand TMouseDoubleClickCommand;
+      typedef ImageSliceActors::TExposeCommand           TExposeCommand;
+      typedef ImageSliceActors::TConfigureCommand        TConfigureCommand;
+      typedef ImageSliceActors::TEnterCommand            TEnterCommand;
+      typedef ImageSliceActors::TLeaveCommand            TLeaveCommand;
+
+    public:
+      vtkTypeMacro( MPRActors, vtkPropCollection );
+
+    public:
+      // Creation
+      static MPRActors* New( );
+
+      ImageSliceActors* GetSliceActors( const int& i ) const;
+
+      void SetInputConnection( vtkAlgorithmOutput* aout );
+      void SetInputImage( vtkImageData* data );
+      int AddBinaryConnection(
+        vtkAlgorithmOutput* aout,
+        const double& r, const double& g, const double& b
+        );
+      int AddBinaryImage(
+        vtkImageData* data,
+        const double& r, const double& g, const double& b
+        );
+      void Clear( );
+
+      vtkImageData* GetInputImage( );
+      const vtkImageData* GetInputImage( ) const;
+
+      unsigned int GetNumberOfImages( ) const;
+
+      void SetInterpolate( bool v );
+      void InterpolateOn( );
+      void InterpolateOff( );
+
+      void PushActorsInto(
+        vtkRenderWindow* x,
+        vtkRenderWindow* y,
+        vtkRenderWindow* z,
+        vtkRenderWindow* w
+        );
+      void PopActorsFrom(
+        vtkRenderWindow* x,
+        vtkRenderWindow* y,
+        vtkRenderWindow* z,
+        vtkRenderWindow* w
+        );
+
+      double GetMinWindow( ) const;
+      double GetMaxWindow( ) const;
+      double GetMinLevel( ) const;
+      double GetMaxLevel( ) const;
+      double GetWindow( );
+      double GetLevel( );
+      void SetWindow( double w );
+      void SetLevel( double l );
+      void SetWindowLevel( double w, double l );
+      void ResetWindowLevel( );
+
+      // Slice access
+      int GetSliceNumber( const int& axis ) const;
+      int GetSliceNumberMinValue( const int& axis ) const;
+      int GetSliceNumberMaxValue( const int& axis ) const;
+      void SetSliceNumber( const int& axis, const int& slice );
+      void SetSlice( const int& axis, double* pos );
+      void SetAxesCursor( const int& axis, double* pos );
+
+      // Rendering controls
+      void Render( const int& axis );
+      void Render( );
+      void ResetCamera( const int& axis );
+      void ResetCameras( );
+
+    protected:
+      MPRActors( );
+      virtual ~MPRActors( );
+
+      void _CreateBoundingBox( );
+
+      static void _SlicesCommand( double* pos, int axis, void* data );
+      static void _WindowLevelCommand(
+        double window, double level, void* data
+        );
+      static void _RenderCommand( void* data );
+
+    private:
+      // Purposely not implemented
+      MPRActors( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      vtkSmartPointer< vtkActor >         ImageOutlineActor;
+      vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ];
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif //  __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MPRObjects.cxx b/lib/cpExtensions/Visualization/MPRObjects.cxx
new file mode 100644 (file)
index 0000000..0727f22
--- /dev/null
@@ -0,0 +1,519 @@
+#include <cpExtensions/Visualization/MPRObjects.h>
+
+#include <cmath>
+#include <vtkImageData.h>
+#include <vtkLookupTable.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects*
+cpExtensions::Visualization::MPRObjects::
+New( )
+{
+  return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetRenderWindows(
+  vtkRenderWindow* x, vtkRenderWindow* y,
+  vtkRenderWindow* z, vtkRenderWindow* w
+  )
+{
+  this->m_Windows[ 0 ] = x;
+  this->m_Windows[ 1 ] = y;
+  this->m_Windows[ 2 ] = z;
+  this->m_Windows[ 3 ] = w;
+
+  // Prepare 2D renderers
+  for( int i = 0; i < 4; ++i )
+  {
+    // Create renderer, if render window exists
+    if( this->m_Windows[ i ] != NULL )
+    {
+      this->m_Renderers[ i ] = vtkSmartPointer< vtkRenderer >::New( );
+      this->m_Renderers[ i ]->SetBackground( 0.3, 0.3, 0.3 );
+      this->m_Windows[ i ]->AddRenderer( this->m_Renderers[ i ] );
+    }
+    else
+      this->m_Renderers[ i ] = NULL;
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetInputConnection( vtkAlgorithmOutput* aout )
+{
+  this->m_MPRActors->SetInputConnection( aout );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetInputImage( vtkImageData* data )
+{
+  this->m_MPRActors->SetInputImage( data );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRObjects::
+AddBinaryConnection(
+  vtkAlgorithmOutput* aout,
+  const double& r, const double& g, const double& b
+  )
+{
+  return( this->m_MPRActors->AddBinaryConnection( aout, r, g, b ) );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRObjects::
+AddBinaryImage(
+  vtkImageData* data,
+  const double& r, const double& g, const double& b
+  )
+{
+  return( this->m_MPRActors->AddBinaryImage( data, r, g, b ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+Show( )
+{
+  this->m_MPRActors->PushActorsInto(
+    this->m_Windows[ 0 ],
+    this->m_Windows[ 1 ],
+    this->m_Windows[ 2 ],
+    this->m_Windows[ 3 ]
+    );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+Hide( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+Clear( )
+{
+  this->m_MPRActors->Clear( );
+}
+
+// -------------------------------------------------------------------------
+vtkImageData* cpExtensions::Visualization::MPRObjects::
+GetInputImage( )
+{
+  return( this->m_MPRActors->GetInputImage( ) );
+}
+
+// -------------------------------------------------------------------------
+const vtkImageData* cpExtensions::Visualization::MPRObjects::
+GetInputImage( ) const
+{
+  return( this->m_MPRActors->GetInputImage( ) );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::MPRObjects::
+GetNumberOfImages( ) const
+{
+  return( this->m_MPRActors->GetNumberOfImages( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetInterpolate( bool v )
+{
+  this->m_MPRActors->SetInterpolate( v );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+InterpolateOn( )
+{
+  this->m_MPRActors->InterpolateOn( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+InterpolateOff( )
+{
+  this->m_MPRActors->InterpolateOff( );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetMinWindow( ) const
+{
+  return( this->m_MPRActors->GetMinWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetMaxWindow( ) const
+{
+  return( this->m_MPRActors->GetMaxWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetMinLevel( ) const
+{
+  return( this->m_MPRActors->GetMinLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetMaxLevel( ) const
+{
+  return( this->m_MPRActors->GetMaxLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetWindow( ) const
+{
+  return( this->m_MPRActors->GetWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetLevel( ) const
+{
+  return( this->m_MPRActors->GetLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetWindow( double w )
+{
+  this->m_MPRActors->SetWindow( w );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetLevel( double l )
+{
+  this->m_MPRActors->SetLevel( l );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetWindowLevel( double w, double l )
+{
+  this->m_MPRActors->SetWindowLevel( w, l );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+ResetWindowLevel( )
+{
+  this->m_MPRActors->ResetWindowLevel( );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRObjects::
+GetSliceNumber( const int& axis ) const
+{
+  return( this->m_MPRActors->GetSliceNumber( axis ) );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRObjects::
+GetSliceNumberMinValue( const int& axis ) const
+{
+  return( this->m_MPRActors->GetSliceNumberMinValue( axis ) );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::Visualization::MPRObjects::
+GetSliceNumberMaxValue( const int& axis ) const
+{
+  return( this->m_MPRActors->GetSliceNumberMaxValue( axis ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetSliceNumber( const int& axis, const int& slice )
+{
+  this->m_MPRActors->SetSliceNumber( axis, slice );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetSlice( const int& axis, double* pos )
+{
+  this->m_MPRActors->SetSlice( axis, pos );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+Render( const double& t )
+{
+  this->Render( 0, t );
+  this->Render( 1, t );
+  this->Render( 2, t );
+  this->Render( 3, t );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+Render( const int& axis, const double& t )
+{
+  if( axis < 4 )
+  {
+    if( this->m_Windows[ axis ].GetPointer( ) != NULL )
+    {
+      if( this->m_Renderers[ axis ].GetPointer( ) != NULL )
+        this->m_Renderers[ axis ]->SetAllocatedRenderTime( t );
+      this->m_Windows[ axis ]->Render( );
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+ResetCamera( const int& axis )
+{
+  if( axis < 4 )
+    if( this->m_Renderers[ axis ].GetPointer( ) != NULL )
+      this->m_Renderers[ axis ]->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+ResetCameras( )
+{
+  this->ResetCamera( 0 );
+  this->ResetCamera( 1 );
+  this->ResetCamera( 2 );
+  this->ResetCamera( 3 );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects::
+MPRObjects( )
+  : vtkObject( )
+{
+  this->m_MPRActors = vtkSmartPointer< MPRActors >::New( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects::
+~MPRObjects( )
+{
+}
+
+
+
+
+/*
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+SetRenderWindows(
+  vtkRenderWindow* wx, vtkRenderWindow* wy,
+  vtkRenderWindow* wz, vtkRenderWindow* w3D
+  )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+AddImage( vtkImageData* image )
+{
+  this->m_MPRActors->AddInputData( image );
+  this->m_MPRActors->PushActorsInto(
+    this->m_Windows[ 0 ],
+    this->m_Windows[ 1 ],
+    this->m_Windows[ 2 ],
+    this->m_Windows[ 3 ]
+    );
+
+  // First rendering
+  if( this->m_MPRActors->GetNumberOfImages( ) == 1 )
+  {
+    this->m_MPRActors->ResetSlices( );
+    this->ResetCameras( );
+
+  } // fi
+  this->RenderAll( 1e-3 );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpExtensions::Visualization::MPRObjects::
+GetNumberOfImages( ) const
+{
+  return( this->m_MPRActors->GetNumberOfImages( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+ClearAll( )
+{
+  this->m_MPRActors->PopActorsFrom(
+    this->m_Windows[ 0 ],
+    this->m_Windows[ 1 ],
+    this->m_Windows[ 2 ],
+    this->m_Windows[ 3 ]
+    );
+  this->ResetCameras( );
+  this->RenderAll( 1e-3 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+ResetCamera( const int& id )
+{
+  if( id < 4 )
+    if( this->m_Windows[ id ] != NULL )
+      this->m_Renderers[ id ]->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+ResetCameras( )
+{
+  for( int i = 0; i < 4; ++i )
+    if( this->m_Windows[ i ] != NULL )
+      this->m_Renderers[ i ]->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+Render( const int& id, const double& t )
+{
+  if( id < 4 )
+  {
+    if( this->m_Windows[ id ] != NULL )
+    {
+      if( this->m_Renderers[ id ] != NULL )
+        this->m_Renderers[ id ]->SetAllocatedRenderTime( t );
+      this->m_Windows[ id ]->Render( );
+      
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+RenderAll( const double& t )
+{
+  for( int i = 0; i < 4; ++i )
+  {
+    if( this->m_Windows[ i ] != NULL )
+    {
+      if( this->m_Renderers[ i ] != NULL )
+        this->m_Renderers[ i ]->SetAllocatedRenderTime( t );
+      this->m_Windows[ i ]->Render( );
+
+    } // fi
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetXRenderer( )
+{
+  return( this->m_Renderers[ 0 ] );
+}
+
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetYRenderer( )
+{
+  return( this->m_Renderers[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetZRenderer( )
+{
+  return( this->m_Renderers[ 2 ] );
+}
+
+// -------------------------------------------------------------------------
+vtkRenderer* cpExtensions::Visualization::MPRObjects::
+Get3DRenderer( )
+{
+  return( this->m_Renderers[ 3 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetXRenderer( ) const
+{
+  return( this->m_Renderers[ 0 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetYRenderer( ) const
+{
+  return( this->m_Renderers[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+GetZRenderer( ) const
+{
+  return( this->m_Renderers[ 2 ] );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderer* cpExtensions::Visualization::MPRObjects::
+Get3DRenderer( ) const
+{
+  return( this->m_Renderers[ 3 ] );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::
+MPRActors* cpExtensions::Visualization::MPRObjects::
+GetMPRActors( )
+{
+  return( this->m_MPRActors );
+}
+
+// -------------------------------------------------------------------------
+const cpExtensions::Visualization::
+MPRActors* cpExtensions::Visualization::MPRObjects::
+GetMPRActors( ) const
+{
+  return( this->m_MPRActors );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetWindow( ) const
+{
+  return( this->m_MPRActors->GetWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::MPRObjects::
+GetLevel( ) const
+{
+  return( this->m_MPRActors->GetLevel( ) );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects::
+MPRObjects( )
+  : vtkObject( )
+{
+  // Prepare actors
+  this->m_MPRActors = vtkSmartPointer< MPRActors >::New( );
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::MPRObjects::
+~MPRObjects( )
+{
+}
+*/
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MPRObjects.h b/lib/cpExtensions/Visualization/MPRObjects.h
new file mode 100644 (file)
index 0000000..c800fc1
--- /dev/null
@@ -0,0 +1,137 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
+#define __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions/Visualization/MPRActors.h>
+
+#include <vtkObject.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+
+// -------------------------------------------------------------------------
+#define cpExtensions_MPRObjects_Renderer( DIR )                         \
+  inline vtkRenderer* Get##DIR##Renderer( )                             \
+  { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); }         \
+  inline const vtkRenderer* Get##DIR##Renderer( ) const                 \
+  { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); }
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    class cpExtensions_EXPORT MPRObjects
+      : public vtkObject
+    {
+    public:
+      typedef MPRObjects Self;
+
+      typedef MPRActors::TStyle                   TStyle;
+      typedef MPRActors::TMouseCommand            TMouseCommand;
+      typedef MPRActors::TMouseWheelCommand       TMouseWheelCommand;
+      typedef MPRActors::TKeyCommand              TKeyCommand;
+      typedef MPRActors::TVoidCommand             TVoidCommand;
+      typedef MPRActors::TMouseMoveCommand        TMouseMoveCommand;
+      typedef MPRActors::TMouseClickCommand       TMouseClickCommand;
+      typedef MPRActors::TMouseDoubleClickCommand TMouseDoubleClickCommand;
+      typedef MPRActors::TExposeCommand           TExposeCommand;
+      typedef MPRActors::TConfigureCommand        TConfigureCommand;
+      typedef MPRActors::TEnterCommand            TEnterCommand;
+      typedef MPRActors::TLeaveCommand            TLeaveCommand;
+
+      enum MPRDirections
+      {
+        MPRDirections_X = 0,
+        MPRDirections_Y = 1,
+        MPRDirections_Z = 2,
+        MPRDirections_W = 3
+      };
+
+    public:
+      vtkTypeMacro( MPRObjects, vtkObject );
+
+      cpExtensions_MPRObjects_Renderer( X );
+      cpExtensions_MPRObjects_Renderer( Y );
+      cpExtensions_MPRObjects_Renderer( Z );
+      cpExtensions_MPRObjects_Renderer( W );
+
+    public:
+      // Creation
+      static MPRObjects* New( );
+
+      // Association
+      void SetRenderWindows(
+        vtkRenderWindow* x, vtkRenderWindow* y,
+        vtkRenderWindow* z, vtkRenderWindow* w
+        );
+
+      void SetInputConnection( vtkAlgorithmOutput* aout );
+      void SetInputImage( vtkImageData* data );
+      int AddBinaryConnection(
+        vtkAlgorithmOutput* aout,
+        const double& r, const double& g, const double& b
+        );
+      int AddBinaryImage(
+        vtkImageData* data,
+        const double& r, const double& g, const double& b
+        );
+      void Show( );
+      void Hide( );
+      void Clear( );
+
+      vtkImageData* GetInputImage( );
+      const vtkImageData* GetInputImage( ) const;
+      unsigned int GetNumberOfImages( ) const;
+
+      void SetInterpolate( bool v );
+      void InterpolateOn( );
+      void InterpolateOff( );
+
+      double GetMinWindow( ) const;
+      double GetMaxWindow( ) const;
+      double GetMinLevel( ) const;
+      double GetMaxLevel( ) const;
+      double GetWindow( ) const;
+      double GetLevel( ) const;
+      void SetWindow( double w );
+      void SetLevel( double l );
+      void SetWindowLevel( double w, double l );
+      void ResetWindowLevel( );
+
+      int GetSliceNumber( const int& axis ) const;
+      int GetSliceNumberMinValue( const int& axis ) const;
+      int GetSliceNumberMaxValue( const int& axis ) const;
+      void SetSliceNumber( const int& axis, const int& slice );
+      void SetSlice( const int& axis, double* pos );
+
+      void Render( const double& t );
+      void Render( const int& axis, const double& t );
+      void ResetCamera( const int& axis );
+      void ResetCameras( );
+
+    protected:
+      MPRObjects( );
+      virtual ~MPRObjects( );
+
+    private:
+      // Purposely not implemented
+      MPRObjects( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      // Inputs
+      vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
+
+      // Internal pipelines
+      vtkSmartPointer< MPRActors >   m_MPRActors;
+      vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif //  __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MeshMapper.h b/lib/cpExtensions/Visualization/MeshMapper.h
new file mode 100644 (file)
index 0000000..c6aee51
--- /dev/null
@@ -0,0 +1,105 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__MESHMAPPER__H__
+#define __CPEXTENSIONS__VISUALIZATION__MESHMAPPER__H__
+
+#include <itkConceptChecking.h>
+#include <vtkMapper.h>
+
+class vtkActor;
+class vtkInformation;
+class vtkRenderer;
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    template< class M >
+    class MeshMapper
+      : public vtkMapper
+    {
+    public:
+      typedef MeshMapper Self;
+      vtkTypeMacro( MeshMapper, vtkMapper );
+
+      typedef M                             TMesh;
+      typedef typename M::PointType         TPoint;
+      typedef typename TPoint::VectorType   TVector;
+      typedef typename TPoint::CoordRepType TScalar;
+      itkStaticConstMacro( Dimension, unsigned int, M::PointDimension );
+
+      // Begin concept checking
+#ifdef ITK_USE_CONCEPT_CHECKING
+      /* TODO
+         itkConceptMacro(
+         InputMeshIsTwoOrThreeimensionalCheck,
+         ( itk::Concept::SameDimensionOrMinusOne< Self::Dimension, 3 > )
+         );
+         itkConceptMacro(
+         ScalarTypeHasFloatResolution,
+         ( itk::Concept::IsFloatingPoint< TScalar > )
+         );
+      */
+#endif
+      // End concept checking
+
+    public:
+      // TODO: static Self* New( );
+      virtual void ShallowCopy( vtkAbstractMapper* m );
+
+      virtual void SetInputData( M* in );
+      virtual M* GetInput( );
+      virtual const M* GetInput( ) const;
+
+      virtual double* GetBounds( );
+      virtual void GetBounds( double bounds[ 6 ] );
+
+      virtual void RenderPiece( vtkRenderer* aren, vtkActor* act ) = 0;
+      virtual void Render( vtkRenderer* aren, vtkActor* act );
+      virtual void Update( );
+      virtual void Update( int port );
+
+      virtual void MapDataArrayToVertexAttribute(
+        const char* vertexAttributeName,
+        const char* dataArrayName,
+        int fieldAssociation,
+        int componentno = -1
+        );
+      virtual void MapDataArrayToMultiTextureAttribute(
+        int unit,
+        const char* dataArrayName,
+        int fieldAssociation,
+        int componentno = -1
+        );
+      virtual void RemoveVertexAttributeMapping(
+        const char* vertexAttributeName
+        );
+      virtual void RemoveAllVertexAttributeMappings( );
+
+    protected:
+      MeshMapper( );
+      virtual ~MeshMapper( );
+
+      virtual void ComputeBounds( );
+      virtual int FillInputPortInformation( int port, vtkInformation* info );
+
+    private:
+      // These methods aren't supposed to be implemented
+      MeshMapper( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      typename M::Pointer Mesh;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Visualization/MeshMapper.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__VISUALIZATION__MESHMAPPER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/MeshMapper.hxx b/lib/cpExtensions/Visualization/MeshMapper.hxx
new file mode 100644 (file)
index 0000000..4374ffe
--- /dev/null
@@ -0,0 +1,224 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__MESHMAPPER__HXX__
+#define __CPEXTENSIONS__VISUALIZATION__MESHMAPPER__HXX__
+
+#include <vtkInformation.h>
+#include <vtkMath.h>
+
+// TODO: #include <cpExtensions/Visualization/OpenGLMeshMapper.h>
+
+// -------------------------------------------------------------------------
+/* TODO
+   template< class M >
+   typename cpExtensions::Visualization::MeshMapper< M >::
+   Self* cpExtensions::Visualization::MeshMapper< M >::
+   New( )
+   {
+   return(
+   cpExtensions::Visualization::OpenGLMeshMapper< M >::New( )
+   );
+   }
+*/
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+ShallowCopy( vtkAbstractMapper* m )
+{
+  Self* mapper = Self::SafeDownCast( m );
+  if( m != NULL )
+    this->SetInputData( mapper->GetInput( ) );
+  this->vtkMapper::ShallowCopy( m );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+SetInputData( M* in )
+{
+  if( this->Mesh != in )
+  {
+    this->Mesh = in;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+M* cpExtensions::Visualization::MeshMapper< M >::
+GetInput( )
+{
+  return( this->Mesh );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+const M* cpExtensions::Visualization::MeshMapper< M >::
+GetInput( ) const
+{
+  return( this->Mesh );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+double* cpExtensions::Visualization::MeshMapper< M >::
+GetBounds( )
+{
+  // do we have an input
+  if( this->Mesh.IsNull( ) )
+  {
+    vtkMath::UninitializeBounds( this->Bounds );
+    return( this->Bounds );
+  }
+  else
+  {
+    this->Mesh->Update( );
+    this->ComputeBounds( );
+
+    if( !vtkMath::AreBoundsInitialized( this->Bounds ) )
+      return( NULL );
+    return( this->Bounds );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+GetBounds( double bounds[ 6 ] )
+{
+  this->Superclass::GetBounds( bounds );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+Render( vtkRenderer* aren, vtkActor* act )
+{
+  if( this->Mesh.IsNull( ) )
+  {
+    vtkErrorMacro( "Mapper has no input." );
+    return;
+
+  } // fi
+  this->RenderPiece( aren, act );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+Update( )
+{
+  // TODO:
+  std::cout << "Update( )" << std::endl;
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+Update( int port )
+{
+  // TODO:
+  std::cout << "Update( port = " << port << " ) "<< std::endl;
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+MapDataArrayToVertexAttribute(
+  const char* vertexAttributeName,
+  const char* dataArrayName,
+  int fieldAssociation,
+  int componentno
+  )
+{
+  vtkErrorMacro( "Not implemented at this level..." );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+MapDataArrayToMultiTextureAttribute(
+  int unit,
+  const char* dataArrayName,
+  int fieldAssociation,
+  int componentno
+  )
+{
+  vtkErrorMacro( "Not implemented at this level..." );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+RemoveVertexAttributeMapping( const char* vertexAttributeName )
+{
+  vtkErrorMacro( "Not implemented at this level..." );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+RemoveAllVertexAttributeMappings( )
+{
+  vtkErrorMacro( "Not implemented at this level..." );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+cpExtensions::Visualization::MeshMapper< M >::
+MeshMapper( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+cpExtensions::Visualization::MeshMapper< M >::
+~MeshMapper( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::MeshMapper< M >::
+ComputeBounds( )
+{
+  static const TScalar _0 = TScalar( 0 );
+  if( this->Mesh.IsNotNull( ) )
+  {
+    const typename M::BoundingBoxType* bb = this->Mesh->GetBoundingBox( );
+    TPoint minP = bb->GetMinimum( );
+    TPoint maxP = bb->GetMaximum( );
+    this->Bounds[ 0 ] = double( ( Self::Dimension >= 1 )? minP[ 0 ]: _0 );
+    this->Bounds[ 1 ] = double( ( Self::Dimension >= 1 )? maxP[ 0 ]: _0 );
+    this->Bounds[ 2 ] = double( ( Self::Dimension >= 2 )? minP[ 1 ]: _0 );
+    this->Bounds[ 3 ] = double( ( Self::Dimension >= 2 )? maxP[ 1 ]: _0 );
+    this->Bounds[ 4 ] = double( ( Self::Dimension >= 3 )? minP[ 2 ]: _0 );
+    this->Bounds[ 5 ] = double( ( Self::Dimension >= 3 )? maxP[ 2 ]: _0 );
+  }
+  else
+  {
+    this->Bounds[ 0 ] =
+      this->Bounds[ 1 ] =
+      this->Bounds[ 2 ] =
+      this->Bounds[ 3 ] =
+      this->Bounds[ 4 ] =
+      this->Bounds[ 5 ] =
+      double( 0 );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+int cpExtensions::Visualization::MeshMapper< M >::
+FillInputPortInformation( int port, vtkInformation* info )
+{
+  info->Set( vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE( ), "itk::Mesh" );
+  return( 1 );
+}
+
+#endif // __CPEXTENSIONS__VISUALIZATION__MESHMAPPER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/OpenGLMeshMapper.h b/lib/cpExtensions/Visualization/OpenGLMeshMapper.h
new file mode 100644 (file)
index 0000000..ff80ce3
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__H__
+#define __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__H__
+
+#include <vector>
+
+#include <cpExtensions/Visualization/MeshMapper.h>
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    template< class M >
+    class OpenGLMeshMapper
+      : public MeshMapper< M >
+    {
+    public:
+      typedef OpenGLMeshMapper Self;
+      vtkTypeMacro( OpenGLMeshMapper, MeshMapper< M > );
+
+      typedef typename Superclass::TMesh   TMesh;
+      typedef typename Superclass::TPoint  TPoint;
+      typedef typename Superclass::TVector TVector;
+      typedef typename Superclass::TScalar TScalar;
+
+    protected:
+      typedef unsigned int                            TIndex;
+      typedef typename M::CellType                    TCell;
+      typedef typename M::CellsContainer              TCellsContainer;
+      typedef typename TCellsContainer::ConstIterator TCellIt;
+
+    public:
+      virtual const char* GetNameOfClass( ) const
+        { return( "cpExtensions::OpenGLMeshMapper" ); }
+      static Self* New( );
+
+      virtual void RenderPiece( vtkRenderer* aren, vtkActor* act );
+      virtual void ReleaseGraphicsResources( vtkWindow* win );
+      virtual int Draw( vtkRenderer* aren, vtkActor* act );
+
+    protected:
+      OpenGLMeshMapper( );
+      virtual ~OpenGLMeshMapper( );
+
+      bool _ConfigureOpenGL( );
+
+    private:
+      // Purposely not implemented
+      OpenGLMeshMapper( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      vtkIdType TotalCells;
+      // TODO: vtkSmartPointer< vtkOpenGLTexture > InternalColorTexture;
+
+      bool FirstRendering;
+
+      bool VBOSupported;
+      unsigned int VBOID1, VBOID2;
+
+      std::vector< unsigned int > Sizes;
+      std::vector< TIndex > Indices;
+      long IndexElementType;
+      long ElementValueType;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Visualization/OpenGLMeshMapper.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/OpenGLMeshMapper.hxx b/lib/cpExtensions/Visualization/OpenGLMeshMapper.hxx
new file mode 100644 (file)
index 0000000..ab2fc60
--- /dev/null
@@ -0,0 +1,672 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__HXX__
+#define __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__HXX__
+
+#include <algorithm>
+#include <string>
+
+#include <vtkCommand.h>
+#include <vtkImageData.h>
+#include <vtkOpenGLRenderer.h>
+#include <vtkProperty.h>
+#include <vtkRenderWindow.h>
+#include <vtkTimerLog.h>
+#include <vtkUnsignedCharArray.h>
+
+#include <vtkOpenGL.h>
+#include <vtkOpenGLError.h>
+#define GL_GLEXT_PROTOTYPES
+#include <GL/glext.h>
+
+#ifdef _WIN32
+
+PFNGLGENBUFFERSARBPROC           pglGenBuffers = 0;
+PFNGLBINDBUFFERARBPROC           pglBindBuffer = 0;
+PFNGLBUFFERDATAARBPROC           pglBufferData = 0;
+PFNGLBUFFERSUBDATAARBPROC        pglBufferSubData = 0;
+PFNGLDELETEBUFFERSARBPROC        pglDeleteBuffers = 0;
+PFNGLGETBUFFERPARAMETERIVARBPROC pglGetBufferParameteriv = 0;
+PFNGLMAPBUFFERARBPROC            pglMapBuffer = 0;
+PFNGLUNMAPBUFFERARBPROC          pglUnmapBuffer = 0;
+
+#define glGenBuffers           pglGenBuffers
+#define glBindBuffer           pglBindBuffer
+#define glBufferData           pglBufferData
+#define glBufferSubData        pglBufferSubData
+#define glDeleteBuffers        pglDeleteBuffers
+#define glGetBufferParameteriv pglGetBufferParameteriv
+#define glMapBuffer            pglMapBuffer
+#define glUnmapBuffer          pglUnmapBuffer
+
+#endif // _WIN32
+
+// some definitions for what the polydata has in it
+#define CPPLUGINS_VTK_PDM_NORMALS            0x0001
+#define CPPLUGINS_VTK_PDM_COLORS             0x0002
+#define CPPLUGINS_VTK_PDM_TCOORDS            0x0004
+#define CPPLUGINS_VTK_PDM_CELL_COLORS        0x0008
+#define CPPLUGINS_VTK_PDM_CELL_NORMALS       0x0010
+#define CPPLUGINS_VTK_PDM_POINT_TYPE_FLOAT   0x0020
+#define CPPLUGINS_VTK_PDM_POINT_TYPE_DOUBLE  0x0040
+#define CPPLUGINS_VTK_PDM_NORMAL_TYPE_FLOAT  0x0080
+#define CPPLUGINS_VTK_PDM_NORMAL_TYPE_DOUBLE 0x0100
+#define CPPLUGINS_VTK_PDM_TCOORD_TYPE_FLOAT  0x0200
+#define CPPLUGINS_VTK_PDM_TCOORD_TYPE_DOUBLE 0x0400
+#define CPPLUGINS_VTK_PDM_TCOORD_1D          0x0800
+#define CPPLUGINS_VTK_PDM_OPAQUE_COLORS      0x1000
+#define CPPLUGINS_VTK_PDM_USE_FIELD_DATA     0x2000
+
+// -------------------------------------------------------------------------
+template< class M >
+typename cpExtensions::Visualization::OpenGLMeshMapper< M >::
+Self* cpExtensions::Visualization::OpenGLMeshMapper< M >::
+New( )
+{
+  return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::OpenGLMeshMapper< M >::
+RenderPiece( vtkRenderer* aren, vtkActor* act )
+{
+  vtkOpenGLClearErrorMacro( );
+
+  // Is the renderer correctly initialized?
+  if( aren->GetRenderWindow( )->CheckAbortStatus( ) )
+    return;
+
+  // Get input mesh ( and check it )
+  M* in = this->GetInput( );
+  if( !in )
+  {
+    vtkErrorMacro( << "No input!" );
+    return;
+
+  } // fi
+  unsigned long numPts = in->GetNumberOfPoints( );
+  if( numPts == 0 )
+  {
+    vtkDebugMacro( << "No points!" );
+    return;
+
+  } // fi
+
+  // Update input, if needed
+  this->InvokeEvent( vtkCommand::StartEvent, NULL );
+  if( !this->Static )
+    in->Update( );
+  this->InvokeEvent( vtkCommand::EndEvent, NULL );
+
+  // Update some visualization objects
+  if( !this->LookupTable )
+    this->CreateDefaultLookupTable( );
+  aren->GetRenderWindow( )->MakeCurrent( );
+
+  // Check clipping planes
+  int numClipPlanes = this->GetNumberOfClippingPlanes( );
+  if( numClipPlanes > 6 )
+  {
+    vtkErrorMacro( << "OpenGL has a limit of 6 clipping planes" );
+    numClipPlanes = 6;
+
+  } // fi
+
+  // Add all the clipping planes
+  double eq[ 4 ];
+  GLenum clipPlaneId;
+  for( int i = 0; i < numClipPlanes; i++ )
+  {
+    this->GetClippingPlaneInDataCoords( act->GetMatrix( ), i, eq );
+
+    clipPlaneId = static_cast< GLenum >( GL_CLIP_PLANE0 + i );
+    glEnable( clipPlaneId );
+    glClipPlane( clipPlaneId, eq );
+
+  } // rof
+
+  // Configure opacity
+  this->MapScalars( act->GetProperty( )->GetOpacity( ) );
+
+  // Configure textures
+  if( this->ColorTextureMap )
+  {
+    /* TODO
+       if( !this->InternalColorTexture )
+       {
+       this->InternalColorTexture =
+       vtkSmartPointer< vtkOpenGLTexture >::New( );
+       this->InternalColorTexture->RepeatOff( );
+
+       } // fi
+       this->InternalColorTexture->SetInputData( this->ColorTextureMap );
+    */
+
+    // Keep color from interacting with texture.
+    float info[ 4 ] = { float( 1 ), float( 1 ), float( 1 ), float( 1 ) };
+    glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, info );
+
+  } // fi
+
+  int noAbort = 1;
+  bool renderNeeded = !this->ImmediateModeRendering;
+  renderNeeded     &= !this->GetGlobalImmediateModeRendering( );
+
+  // Something has changed in the pipeline?
+  if(
+    this->GetMTime( ) > this->BuildTime ||
+    in->GetMTime( ) > this->BuildTime ||
+    act->GetProperty( )->GetMTime( ) > this->BuildTime ||
+    aren->GetRenderWindow( ) != this->LastWindow
+    )
+  {
+    // Update visualization objects
+    this->ReleaseGraphicsResources( aren->GetRenderWindow( ) );
+    this->LastWindow = aren->GetRenderWindow( );
+
+    if( renderNeeded )
+    {
+      // Load textures
+      /* TODO
+         if( this->ColorTextureMap )
+         this->InternalColorTexture->Load( aren );
+      */
+
+      // Time the actual drawing
+      this->Timer->StartTimer( );
+      noAbort = this->Draw( aren, act );
+      this->Timer->StopTimer( );
+
+    } // fi
+
+    if( noAbort )
+      this->BuildTime.Modified( );
+  }
+  else
+  {
+    // If nothing changed, just draw the mapped mesh
+    if( renderNeeded )
+    {
+      // Load textures
+      /* TODO
+         if( this->ColorTextureMap )
+         this->InternalColorTexture->Load( aren );
+      */
+
+      // Time the actual drawing
+      this->Timer->StartTimer( );
+      this->Draw( aren, act );
+      this->Timer->StopTimer( );
+
+    } // fi
+
+  } // fi
+
+  // if we are in immediate mode rendering we always
+  // want to draw the primitives here
+  if( !renderNeeded )
+  {
+    // Load textures
+    /* TODO
+       if( this->ColorTextureMap )
+       this->InternalColorTexture->Load( aren );
+    */
+
+    // Time the actual drawing
+    this->Timer->StartTimer( );
+    this->Draw( aren, act );
+    this->Timer->StopTimer( );
+
+  } // fi
+  this->TimeToDraw = this->Timer->GetElapsedTime( );
+
+  // If the timer is not accurate enough, set it to a small
+  // time so that it is not zero
+  if( this->TimeToDraw == double( 0 ) )
+    this->TimeToDraw = double( 1e-3 );
+
+  for( int c = 0; c < numClipPlanes; c++ )
+  {
+    GLenum clipPlaneId = static_cast< GLenum >( GL_CLIP_PLANE0 + c );
+    glDisable( clipPlaneId );
+
+  } // rof
+  vtkOpenGLCheckErrorMacro( "failed after RenderPiece\n" );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+void cpExtensions::Visualization::OpenGLMeshMapper< M >::
+ReleaseGraphicsResources( vtkWindow* win )
+{
+  if( win && win->GetMapped( ) )
+  {
+    win->MakeCurrent( );
+    vtkOpenGLCheckErrorMacro( "failed after ReleaseGraphicsResources" );
+
+  } // fi
+  this->LastWindow = NULL;
+
+  // TAKEN FROM BASIC vtkOpenGLPolyDataMapper:
+  // We may not want to do this here.
+  /* TODO
+     if( this->InternalColorTexture )
+     this->InternalColorTexture->ReleaseGraphicsResources( win );
+  */
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+int cpExtensions::Visualization::OpenGLMeshMapper< M >::
+Draw( vtkRenderer* aren, vtkActor* act )
+{
+  vtkOpenGLClearErrorMacro( );
+
+  // First and second initialization check
+  if( this->FirstRendering )
+    this->FirstRendering = !( this->_ConfigureOpenGL( ) );
+  if( this->FirstRendering )
+    return( 0 );
+
+  vtkOpenGLRenderer* ren = static_cast< vtkOpenGLRenderer* >( aren );
+  int rep, interpolation;
+  float tran;
+  vtkProperty* prop;
+  vtkUnsignedCharArray* c = NULL;
+  int tDim;
+  int noAbort = 1;
+  M* input = this->GetInput( );
+  int cellScalars = 0;
+  vtkIdType cellNum = 0;
+  int cellNormals;
+  int resolve = 0, zResolve = 0;
+  double zRes = 0.0;
+
+  // get the property
+  prop = act->GetProperty( );
+
+  // get the transparency
+  tran = prop->GetOpacity( );
+
+  // if the primitives are invisable then get out of here
+  if( tran <= 0.0 )
+    return( noAbort );
+
+  // get the representation ( e.g., surface / wireframe / points )
+  rep = prop->GetRepresentation( );
+
+  // get the shading interpolation
+  interpolation = prop->GetInterpolation( );
+
+  // are they cell or point scalars
+  if( this->Colors )
+  {
+    c = this->Colors;
+    if(
+      (
+        this->ScalarMode == VTK_SCALAR_MODE_USE_CELL_DATA ||
+        this->ScalarMode == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA ||
+        this->ScalarMode == VTK_SCALAR_MODE_USE_FIELD_DATA ||
+        !input->GetPointData( )
+        ) &&
+      this->ScalarMode != VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
+      )
+      cellScalars = 1;
+
+  } // fi
+
+  cellNormals = 1;
+
+  // if we are doing vertex colors then set lmcolor to adjust
+  // the current materials ambient and diffuse values using
+  // vertex color commands otherwise tell it not to.
+  glDisable( GL_COLOR_MATERIAL );
+  if( c )
+  {
+    GLenum lmcolorMode;
+    if( this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT )
+    {
+      if( prop->GetAmbient( ) > prop->GetDiffuse( ) )
+        lmcolorMode = GL_AMBIENT;
+      else
+        lmcolorMode = GL_DIFFUSE;
+    }
+    else if( this->ScalarMaterialMode == VTK_MATERIALMODE_AMBIENT_AND_DIFFUSE )
+      lmcolorMode = GL_AMBIENT_AND_DIFFUSE;
+    else if( this->ScalarMaterialMode == VTK_MATERIALMODE_AMBIENT )
+      lmcolorMode = GL_AMBIENT;
+    else // if( this->ScalarMaterialMode == VTK_MATERIALMODE_DIFFUSE )
+      lmcolorMode = GL_DIFFUSE;
+    glColorMaterial( GL_FRONT_AND_BACK, lmcolorMode );
+    glEnable( GL_COLOR_MATERIAL );
+
+  } // fi
+
+  unsigned long idx = 0;
+  if( c )
+  {
+    idx |= CPPLUGINS_VTK_PDM_COLORS;
+    if( c->GetName( ) )
+      idx |= CPPLUGINS_VTK_PDM_OPAQUE_COLORS;
+  } // fi
+  if( cellScalars )
+    idx |= CPPLUGINS_VTK_PDM_CELL_COLORS;
+  if( cellNormals )
+    idx |= CPPLUGINS_VTK_PDM_CELL_NORMALS;
+  if( this->ScalarMode == VTK_SCALAR_MODE_USE_FIELD_DATA )
+    idx |= CPPLUGINS_VTK_PDM_USE_FIELD_DATA;
+
+  // store the types in the index
+  if( typeid( typename M::CoordRepType ) == typeid( float ) )
+    idx |= CPPLUGINS_VTK_PDM_POINT_TYPE_FLOAT;
+  else if( typeid( typename M::CoordRepType ) == typeid( double ) )
+    idx |= CPPLUGINS_VTK_PDM_POINT_TYPE_DOUBLE;
+
+  if( typeid( typename M::CoordRepType ) == typeid( float ) )
+    idx |= CPPLUGINS_VTK_PDM_NORMAL_TYPE_FLOAT;
+  else if( typeid( typename M::CoordRepType ) == typeid( double ) )
+    idx |= CPPLUGINS_VTK_PDM_NORMAL_TYPE_DOUBLE;
+
+  if( this->GetResolveCoincidentTopology( ) )
+  {
+    resolve = 1;
+    if( this->GetResolveCoincidentTopology( ) == VTK_RESOLVE_SHIFT_ZBUFFER )
+    {
+      zResolve = 1;
+      zRes = this->GetResolveCoincidentTopologyZShift( );
+    }
+    else
+    {
+#ifdef GL_VERSION_1_1
+      double f, u;
+      glEnable( GL_POLYGON_OFFSET_FILL );
+      this->GetResolveCoincidentTopologyPolygonOffsetParameters( f, u );
+      glPolygonOffset( f, u );
+#endif
+    } // fi
+
+  } // fi
+
+  // we need to know the total number of cells so that we can
+  // report progress
+  this->TotalCells = input->GetNumberOfCells( );
+
+  // Actual render
+  if( this->VBOSupported )
+  {
+    glBindBuffer( GL_ARRAY_BUFFER, GLuint( this->VBOID1 ) );
+
+    void* ptr = glMapBuffer( GL_ARRAY_BUFFER, GL_READ_WRITE );
+    if( ptr != NULL )
+    {
+      // Copy source points to OpenGL buffer
+      const TPoint* src =
+        input->GetPoints( )->CastToSTLContainer( ).data( );
+      TPoint* dest = reinterpret_cast< TPoint* >( ptr );
+      if( dest != NULL )
+        std::copy( src, src + input->GetNumberOfPoints( ), dest );
+      glUnmapBuffer( GL_ARRAY_BUFFER );
+
+    } // fi
+
+    std::size_t pSize = input->GetNumberOfPoints( ) * sizeof( TPoint );
+
+    // Bind vertices, normals and indices
+    glNormalPointer( this->ElementValueType, 0, ( void* )( pSize ) );
+    glVertexPointer( 3, this->ElementValueType, 0, 0 );
+    glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, GLuint( this->VBOID2 ) );
+
+    // Prepare to render polygons
+    glEnableClientState( GL_NORMAL_ARRAY );
+    glEnableClientState( GL_VERTEX_ARRAY );
+
+    // Iterate over all input cells
+    unsigned int accum = 0;
+    const TCellsContainer* cells = input->GetCells( );
+    TCellIt cIt = cells->Begin( );
+    for( unsigned int nCell = 0; cIt != cells->End( ); nCell++, cIt++ )
+    {
+      const TCell* cell = cIt.Value( );
+      unsigned int nPoints = this->Sizes[ nCell ];
+
+      // Infere rendering mode
+      GLenum mode;
+      switch( prop->GetRepresentation( ) )
+      {
+      case VTK_SURFACE:
+      {
+        switch( nPoints )
+        {
+        case  1: mode = GL_POINTS;    break;
+        case  2: mode = GL_LINES;     break;
+        case  3: mode = GL_TRIANGLES; break;
+        case  4: mode = GL_QUADS;     break;
+        default: mode = GL_POLYGON;   break;
+        } // hctiws
+        // TODO: GL_LINE_STRIP,
+        // TODO: GL_LINE_LOOP,
+        // TODO: GL_TRIANGLE_STRIP,
+        // TODO: GL_TRIANGLE_FAN,
+        // TODO: GL_QUAD_STRIP,
+      }
+      break;
+      case VTK_WIREFRAME: mode = GL_LINE_LOOP; break;
+      case VTK_POINTS: default: mode = GL_POINTS; break;
+      } // hctiws
+
+      // Actual draw all elements
+      if( nPoints < 3 )
+        glDisable( GL_LIGHTING );
+
+      if( nPoints == 2 && zResolve )
+        glDepthRange( zRes, 1. );
+
+      glDrawElements(
+        mode, nPoints, this->IndexElementType, ( GLuint* )( 0 ) + accum
+        );
+      accum += nPoints;
+
+      if( nPoints < 3 )
+        glEnable( GL_LIGHTING );
+
+    } // rof
+
+    glDisableClientState( GL_VERTEX_ARRAY );
+    glDisableClientState( GL_NORMAL_ARRAY );
+
+    glBindBuffer( GL_ARRAY_BUFFER, 0 );
+    glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 );
+  }
+  else
+  {
+    std::cout << "Not VBO rendering!!!" << std::endl;
+
+  } // fi
+
+  if( resolve )
+  {
+    if( zResolve )
+      glDepthRange( 0., 1. );
+    else
+    {
+#ifdef GL_VERSION_1_1
+      glDisable( GL_POLYGON_OFFSET_FILL );
+#endif
+    } // fi
+
+  } // fi
+  vtkOpenGLCheckErrorMacro( "failed after Draw" );
+  this->UpdateProgress( 1.0 );
+  return( noAbort );
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+cpExtensions::Visualization::OpenGLMeshMapper< M >::
+OpenGLMeshMapper( )
+  : Superclass( ),
+    TotalCells( 0 ),
+    FirstRendering( true ),
+    VBOID1( 0 ),
+    VBOID2( 0 )
+{
+  // Infere index element type
+  switch( sizeof( TIndex ) )
+  {
+  case 1 : this->IndexElementType = GL_UNSIGNED_BYTE;  break;
+  case 2 : this->IndexElementType = GL_UNSIGNED_SHORT; break;
+  case 4 : this->IndexElementType = GL_UNSIGNED_INT;   break;
+  default: this->IndexElementType = GL_UNSIGNED_BYTE;  break;
+  } // hctiws
+
+  // Infere point value type
+  if( typeid( TScalar ) == typeid( float ) )
+    this->ElementValueType = GL_FLOAT;
+  else
+    this->ElementValueType = GL_DOUBLE;
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+cpExtensions::Visualization::OpenGLMeshMapper< M >::
+~OpenGLMeshMapper( )
+{
+  if( this->LastWindow )
+    this->ReleaseGraphicsResources( this->LastWindow );
+  if( this->VBOSupported )
+  {
+    GLuint id1 = GLuint( this->VBOID1 );
+    GLuint id2 = GLuint( this->VBOID2 );
+    if( id1 != GLuint( 0 ) ) glDeleteBuffers( 1, &id1 );
+    if( id2 != GLuint( 0 ) ) glDeleteBuffers( 1, &id2 );
+    this->VBOID1 = this->VBOID2 = 0;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class M >
+bool cpExtensions::Visualization::OpenGLMeshMapper< M >::
+_ConfigureOpenGL( )
+{
+  M* input = this->GetInput( );
+  if( input == NULL )
+    return( false );
+
+#ifdef _WIN32
+  // Get pointers to GL functions
+  glGenBuffers = reinterpret_cast< PFNGLGENBUFFERSARBPROC >
+    ( wglGetProcAddress( "glGenBuffers" ) );
+  glBindBuffer = reinterpret_cast< PFNGLBINDBUFFERARBPROC >
+    ( wglGetProcAddress( "glBindBuffer" ) );
+  glBufferData = reinterpret_cast< PFNGLBUFFERDATAARBPROC >
+    ( wglGetProcAddress( "glBufferData" ) );
+  glBufferSubData = reinterpret_cast< PFNGLBUFFERSUBDATAARBPROC >
+    ( wglGetProcAddress( "glBufferSubData" ) );
+  glDeleteBuffers = reinterpret_cast< PFNGLDELETEBUFFERSARBPROC >
+    ( wglGetProcAddress( "glDeleteBuffers" ) );
+  glGetBufferParameteriv =
+    reinterpret_cast< PFNGLGETBUFFERPARAMETERIVARBPROC >
+    ( wglGetProcAddress( "glGetBufferParameteriv" ) );
+  glMapBuffer = reinterpret_cast< PFNGLMAPBUFFERARBPROC >
+    ( wglGetProcAddress( "glMapBuffer" ) );
+  glUnmapBuffer = reinterpret_cast< PFNGLUNMAPBUFFERARBPROC >
+    ( wglGetProcAddress( "glUnmapBuffer" ) );
+
+  // Check once again VBO extension
+  if(
+    glGenBuffers != NULL &&
+    glBindBuffer != NULL &&
+    glBufferData != NULL &&
+    glBufferSubData != NULL &&
+    glMapBuffer != NULL &&
+    glUnmapBuffer != NULL &&
+    glDeleteBuffers != NULL &&
+    glGetBufferParameteriv != NULL
+    )
+    this->VBOSupported = true;
+  else
+    this->VBOSupported = false;
+#else // _WIN32
+  // Check if VBO ( Vertex Buffer Object ) is supported
+  std::string str = ( const char* )( glGetString( GL_EXTENSIONS ) );
+  this->VBOSupported =
+    ( str.find( "GL_ARB_vertex_buffer_object" ) != std::string::npos );
+#endif // _WIN32 
+
+  if( this->VBOSupported )
+  {
+    // Create points and normals buffers
+    GLuint id1;
+    std::size_t pSize = input->GetNumberOfPoints( ) * sizeof( TPoint );
+    std::size_t nSize =
+      input->GetPointNormalsContainer( ).size( ) * sizeof( TVector );
+    const TPoint* verts =
+      input->GetPoints( )->CastToSTLContainer( ).data( );
+    const TVector* norms = input->GetPointNormalsContainer( ).data( );
+    glGenBuffers( 1, &id1 );
+    glBindBuffer( GL_ARRAY_BUFFER, id1 );
+    glBufferData( GL_ARRAY_BUFFER, pSize + nSize, 0, GL_STREAM_DRAW );
+    glBufferSubData( GL_ARRAY_BUFFER, 0, pSize, verts );
+    glBufferSubData( GL_ARRAY_BUFFER, pSize, nSize, norms );
+    this->VBOID1 = ( unsigned int )( id1 );
+
+    // Create indices buffer
+    const TCellsContainer* cells = input->GetCells( );
+    if( cells == NULL )
+    {
+      itkExceptionMacro(
+        << "This QuadEdgeMesh does not have any cells!"
+        );
+
+    } // fi
+
+    TCellIt cIt;
+    unsigned int cellPointsCount = 0;
+    this->Sizes.clear( );
+    for( cIt = cells->Begin( ); cIt != cells->End( ); cIt++ )
+    {
+      this->Sizes.push_back( cIt.Value( )->GetNumberOfPoints( ) );
+      cellPointsCount += this->Sizes.back( );
+
+    } // rof
+    this->Indices.resize( cellPointsCount );
+    unsigned int indId = 0;
+    for( cIt = cells->Begin( ); cIt != cells->End( ); cIt++ )
+    {
+      const typename M::TQuadEdgeCell* cell =
+        dynamic_cast< const typename M::TQuadEdgeCell* >( cIt.Value( ) );
+      const typename M::TPrimalEdge* edge =
+        cell->GetEntryPrimalEdge( );
+      typename M::TPrimalEdge::ConstIterator iIt = edge->BeginLnext( );
+      for( ; iIt != edge->EndLnext( ); ++iIt )
+        this->Indices[ indId++ ] = ( *iIt )->GetOrigin( );
+
+    } // fi
+
+    // Attach index buffer to VBO
+    std::size_t iSize = std::size_t( this->Indices.size( ) );
+    iSize            *= sizeof( TIndex );
+    const unsigned int* indices = this->Indices.data( );
+    GLuint id2;
+    glGenBuffers( 1, &id2 );
+    glBindBuffer( GL_ARRAY_BUFFER, id2 );
+    glBufferData( GL_ARRAY_BUFFER, iSize, indices, GL_STATIC_DRAW );
+
+    int bSize;
+    glGetBufferParameteriv( GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &bSize );
+    if( iSize != bSize )
+    {
+      glDeleteBuffers( 1, &id2 );
+      id2 = 0;
+      vtkErrorMacro( << "Data size mismatch with input array" );
+
+    } // fi
+    this->VBOID2 = ( unsigned int )( id2 );
+
+  } // fi
+  return( true );
+}
+
+#endif // __CPEXTENSIONS__VISUALIZATION__OPENGLMESHMAPPER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/SeedWidgetCorrector.cxx b/lib/cpExtensions/Visualization/SeedWidgetCorrector.cxx
new file mode 100644 (file)
index 0000000..f76cc9f
--- /dev/null
@@ -0,0 +1,79 @@
+#include <cpExtensions/Visualization/SeedWidgetCorrector.h>
+
+#include <vtkCellPicker.h>
+#include <vtkSeedWidget.h>
+
+#include <vtkHandleRepresentation.h>
+#include <vtkHandleWidget.h>
+#include <vtkRenderWindowInteractor.h>
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::SeedWidgetCorrector*
+cpExtensions::Visualization::SeedWidgetCorrector::
+New( )
+{
+  return( new cpExtensions::Visualization::SeedWidgetCorrector );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::SeedWidgetCorrector::
+Configure( vtkCellPicker* picker )
+{
+  this->m_Picker = picker;
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::SeedWidgetCorrector::
+Execute( vtkObject* caller, unsigned long eventId, void* arguments )
+{
+  vtkSeedWidget* wdg = dynamic_cast< vtkSeedWidget* >( caller );
+  if( wdg == NULL || this->m_Picker == NULL )
+    return;
+
+  if( eventId == vtkCommand::PlacePointEvent )
+  {
+    // Get newly added handle and its associated objects
+    int hId = *( reinterpret_cast< int* >( arguments ) );
+    vtkHandleWidget* hWdg = wdg->GetSeed( hId );
+    if( hWdg == NULL )
+      return;
+    vtkHandleRepresentation* hRep =
+      dynamic_cast< vtkHandleRepresentation* >( hWdg->GetRepresentation( ) );
+    if( hRep == NULL )
+      return;
+
+    // Get clicked point and 3D scene
+    double p[ 3 ];
+    hRep->GetDisplayPosition( p );
+    vtkRenderWindowInteractor* iren = wdg->GetInteractor( );
+    if( iren == NULL )
+      return;
+    vtkRenderer* ren =
+      iren->FindPokedRenderer( int( p[ 0 ] ), int( p[ 1 ] ) );
+    if( ren == NULL )
+      return;
+
+    // Correct point with given picker
+    double q[ 3 ];
+    this->m_Picker->Pick( p[ 0 ], p[ 1 ], p[ 2 ], ren );
+    this->m_Picker->GetPickPosition( q );
+    hRep->SetWorldPosition( q );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::SeedWidgetCorrector::
+SeedWidgetCorrector( )
+  : vtkCommand( ),
+    m_Picker( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpExtensions::Visualization::SeedWidgetCorrector::
+~SeedWidgetCorrector( )
+{
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/SeedWidgetCorrector.h b/lib/cpExtensions/Visualization/SeedWidgetCorrector.h
new file mode 100644 (file)
index 0000000..541d60c
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__SEEDWIDGETCORRECTOR__H__
+#define __CPEXTENSIONS__VISUALIZATION__SEEDWIDGETCORRECTOR__H__
+
+#include <cpExtensions/cpExtensions_Export.h>
+
+#include <vtkCommand.h>
+
+class vtkCellPicker;
+class vtkSeedWidget;
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    class cpExtensions_EXPORT SeedWidgetCorrector
+      : public vtkCommand
+    {
+    public:
+      static SeedWidgetCorrector* New( );
+
+      void Configure( vtkCellPicker* picker );
+
+      virtual void Execute(
+        vtkObject* caller,
+        unsigned long eventId,
+        void* arguments
+        );
+
+    protected:
+      SeedWidgetCorrector( );
+      virtual ~SeedWidgetCorrector( );
+
+    protected:
+      vtkCellPicker* m_Picker;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__VISUALIZATION__SEEDWIDGETCORRECTOR__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPipelineEditor/Block.cxx b/lib/cpPipelineEditor/Block.cxx
new file mode 100644 (file)
index 0000000..cd32453
--- /dev/null
@@ -0,0 +1,301 @@
+#include "Block.h"\r
+\r
+#include <QPen>\r
+#include <QGraphicsScene>\r
+#include <QGraphicsSceneContextMenuEvent>\r
+#include <QFontMetrics>\r
+#include <QMenu>\r
+#include <QPainter>\r
+#include <QStyleOptionGraphicsItem>\r
+#include <QGraphicsWidget>\r
+\r
+#include <cpPlugins/ParametersQtDialog.h>\r
+\r
+#include "Port.h"\r
+#include "Connection.h"\r
+#include "Editor.h"\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Block::\r
+Block(\r
+  TFilter* filter, const QString& name,\r
+  QGraphicsItem* parent, QGraphicsScene* scene\r
+  )\r
+  : Superclass( parent, scene ),\r
+    m_HorzMargin( 20 ),\r
+    m_VertMargin( 5 ),\r
+    m_NamePort( NULL ),\r
+    m_Filter( filter ),\r
+    m_Editor( NULL )\r
+{\r
+  QPainterPath p;\r
+  p.addRoundedRect( -50, -15, 100, 30, 5, 5 );\r
+\r
+  this->setPath( p );\r
+  this->setPen( QPen( Qt::darkGreen ) );\r
+  this->setBrush( Qt::green );\r
+  this->setFlag( QGraphicsItem::ItemIsMovable );\r
+  this->setFlag( QGraphicsItem::ItemIsSelectable );\r
+\r
+  this->m_Width = this->m_HorzMargin;\r
+  this->m_Height = this->m_VertMargin;\r
+\r
+  // Configure names\r
+  this->setNamePort( name );\r
+  this->_setTypeInfo( this->m_Filter->GetClassName( ) );\r
+\r
+  // Add input ports\r
+  auto inputs = this->m_Filter->GetInputsNames( );\r
+  for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )\r
+    this->addInputPort( iIt->c_str( ) );\r
+\r
+  // Add output ports\r
+  auto outputs = this->m_Filter->GetOutputsNames( );\r
+  for( auto oIt = outputs.begin( ); oIt != outputs.end( ); ++oIt )\r
+    this->addOutputPort( oIt->c_str( ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Block::\r
+~Block( )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Editor* cpPipelineEditor::Block::\r
+editor( )\r
+{\r
+  return( this->m_Editor );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+const cpPipelineEditor::Editor* cpPipelineEditor::Block::\r
+editor( ) const\r
+{\r
+  return( this->m_Editor );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+setEditor( cpPipelineEditor::Editor* editor )\r
+{\r
+  this->m_Editor = editor;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+setNamePort( const QString& txt )\r
+{\r
+  if( this->m_NamePort == NULL )\r
+    this->m_NamePort = new NamePort( this );\r
+  this->m_NamePort->setName( txt );\r
+  this->_configPort( this->m_NamePort );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::InputPort* cpPipelineEditor::Block::\r
+addInputPort( const QString& txt )\r
+{\r
+  InputPort* ip = new InputPort( this );\r
+  ip->setExtendedName(\r
+    (\r
+      txt.toStdString( ) +\r
+      std::string( "@" ) +\r
+      this->namePort( ).toStdString( )\r
+      ).c_str( )\r
+    );\r
+  ip->setName( txt );\r
+  this->m_InputPorts[ txt.toStdString( ) ] = ip;\r
+  this->_configPort( ip );\r
+  return( ip );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::OutputPort* cpPipelineEditor::Block::\r
+addOutputPort( const QString& txt )\r
+{\r
+  OutputPort* op = new OutputPort( this );\r
+  op->setExtendedName(\r
+    (\r
+      txt.toStdString( ) +\r
+      std::string( "@" ) +\r
+      this->namePort( ).toStdString( )\r
+      ).c_str( )\r
+    );\r
+  op->setName( txt );\r
+  this->m_OutputPorts[ txt.toStdString( ) ] = op;\r
+  this->_configPort( op );\r
+  return( op );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::InputPort* cpPipelineEditor::Block::\r
+inputPort( const QString& txt )\r
+{\r
+  auto i = this->m_InputPorts.find( txt.toStdString( ) );\r
+  if( i != this->m_InputPorts.end( ) )\r
+    return( i->second );\r
+  else\r
+    return( NULL );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::OutputPort* cpPipelineEditor::Block::\r
+outputPort( const QString& txt )\r
+{\r
+  auto o = this->m_OutputPorts.find( txt.toStdString( ) );\r
+  if( o != this->m_OutputPorts.end( ) )\r
+    return( o->second );\r
+  else\r
+    return( NULL );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+QString cpPipelineEditor::Block::\r
+namePort( ) const\r
+{\r
+  return( this->m_NamePort->name( ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+const cpPipelineEditor::InputPort* cpPipelineEditor::Block::\r
+inputPort( const QString& txt ) const\r
+{\r
+  auto i = this->m_InputPorts.find( txt.toStdString( ) );\r
+  if( i != this->m_InputPorts.end( ) )\r
+    return( i->second );\r
+  else\r
+    return( NULL );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+const cpPipelineEditor::OutputPort* cpPipelineEditor::Block::\r
+outputPort( const QString& txt ) const\r
+{\r
+  auto o = this->m_OutputPorts.find( txt.toStdString( ) );\r
+  if( o != this->m_OutputPorts.end( ) )\r
+    return( o->second );\r
+  else\r
+    return( NULL );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+paint(\r
+  QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget\r
+  )\r
+{\r
+  Q_UNUSED( option );\r
+  Q_UNUSED( widget );\r
+\r
+  if( this->isSelected( ) )\r
+  {\r
+    painter->setPen( QPen( Qt::darkYellow ) );\r
+    painter->setBrush( Qt::yellow );\r
+  }\r
+  else\r
+  {\r
+    painter->setPen( QPen( Qt::darkGreen ) );\r
+    painter->setBrush( Qt::green );\r
+\r
+  } // fi\r
+  painter->drawPath( this->path( ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+QVariant cpPipelineEditor::Block::\r
+itemChange( GraphicsItemChange change, const QVariant& value )\r
+{\r
+  return( value );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+_setTypeInfo( const QString& txt )\r
+{\r
+  this->setToolTip( txt );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+_configPort( Port* port )\r
+{\r
+  port->setBlock( this );\r
+\r
+  QFontMetrics fm( this->scene( )->font( ) );\r
+  this->m_Width = 0;\r
+  foreach( QGraphicsItem* i, this->children( ) )\r
+  {\r
+    Port* p = dynamic_cast< Port* >( i );\r
+    if( p == NULL )\r
+      continue;\r
+    int w = fm.width( p->name( ) ) + ( 4 * p->radius( ) );\r
+    if( w > this->m_Width - this->m_HorzMargin )\r
+      this->m_Width = w + this->m_HorzMargin;\r
+\r
+  } // rof\r
+  int h = fm.height( );\r
+  this->m_Height = this->m_InputPorts.size( ) + this->m_OutputPorts.size( );\r
+  this->m_Height += 3;\r
+  this->m_Height *= h;\r
+\r
+  QPainterPath pth;\r
+  pth.addRoundedRect(\r
+    -this->m_Width / 2,\r
+    -this->m_Height / 2,\r
+    this->m_Width,\r
+    this->m_Height, 5, 5\r
+    );\r
+  this->setPath( pth );\r
+\r
+  int y = -this->m_Height / 2 + this->m_VertMargin + port->radius( );\r
+  foreach( QGraphicsItem* i, this->children( ) )\r
+  {\r
+    Port* p = dynamic_cast< Port* >( i );\r
+    if( p == NULL )\r
+      continue;\r
+\r
+    if( dynamic_cast< NamePort* >( i ) != NULL )\r
+    {\r
+      i->setPos( -this->m_Width / 2 + port->radius( ), y );\r
+      y += h;\r
+    }\r
+    else if( dynamic_cast< InputPort* >( i ) != NULL )\r
+      i->setPos( -this->m_Width / 2 - 2 * port->radius( ), y );\r
+    else if( dynamic_cast< OutputPort* >( i ) != NULL )\r
+      i->setPos( this->m_Width / 2, y );\r
+    y += h;\r
+\r
+  } // rof\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+mouseReleaseEvent( QGraphicsSceneMouseEvent* evt )\r
+{\r
+  if( this->m_Filter != NULL )\r
+    this->m_Filter->SetViewCoords(\r
+      this->scenePos( ).x( ), this->scenePos( ).y( )\r
+      );\r
+  this->Superclass::mouseReleaseEvent( evt );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Block::\r
+contextMenuEvent( QGraphicsSceneContextMenuEvent* evt )\r
+{\r
+  QMenu menu;\r
+  QAction* configureAction = menu.addAction( "Configure" );\r
+  QAction* updateAction = menu.addAction( "Update" );\r
+  QAction* selectedAction = menu.exec( evt->screenPos( ) );\r
+\r
+  if( selectedAction == configureAction )\r
+  {\r
+    auto dlg = this->m_Filter->CreateQtDialog( );\r
+    dlg->exec( );\r
+  }\r
+  else if( selectedAction == updateAction )\r
+    this->m_Editor->updateFilter( this->namePort( ).toStdString( ) );\r
+}\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/Block.h b/lib/cpPipelineEditor/Block.h
new file mode 100644 (file)
index 0000000..2ace7b7
--- /dev/null
@@ -0,0 +1,85 @@
+#ifndef __CPPIPELINEEDITOR__BLOCK__H__\r
+#define __CPPIPELINEEDITOR__BLOCK__H__\r
+\r
+#include <cpPipelineEditor/cpPipelineEditor_Export.h>\r
+#include <QGraphicsPathItem>\r
+#include <cpPlugins/ProcessObject.h>\r
+\r
+namespace cpPipelineEditor\r
+{\r
+  class Editor;\r
+  class Port;\r
+  class NamePort;\r
+  class InputPort;\r
+  class OutputPort;\r
+\r
+  /**\r
+   */\r
+  class cpPipelineEditor_EXPORT Block\r
+    : public QGraphicsPathItem\r
+  {\r
+  public:\r
+    typedef Block                    Self;\r
+    typedef QGraphicsPathItem        Superclass;\r
+    typedef cpPlugins::ProcessObject TFilter;\r
+  \r
+  public:\r
+    enum { Type = QGraphicsItem::UserType + 6 };\r
+\r
+    Block(\r
+      TFilter* filter, const QString& name,\r
+      QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL\r
+      );\r
+    virtual ~Block( );\r
+\r
+    Editor* editor( );\r
+    const Editor* editor( ) const;\r
+    void setEditor( Editor* editor );\r
+\r
+    void setNamePort( const QString& txt );\r
+    InputPort* addInputPort( const QString& txt );\r
+    OutputPort* addOutputPort( const QString& txt );\r
+\r
+    InputPort* inputPort( const QString& txt );\r
+    OutputPort* outputPort( const QString& txt );\r
+\r
+    QString namePort( ) const;\r
+    const InputPort* inputPort( const QString& txt ) const;\r
+    const OutputPort* outputPort( const QString& txt ) const;\r
+\r
+    inline int type( ) const\r
+      { return( this->Type ); }\r
+\r
+    virtual void paint(\r
+      QPainter* painter,\r
+      const QStyleOptionGraphicsItem* option,\r
+      QWidget* widget\r
+      );\r
+\r
+  protected:\r
+    QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
+    void _setTypeInfo( const QString& txt );\r
+    void _configPort( Port* port );\r
+\r
+    virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent* evt );\r
+    virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* evt );\r
+\r
+  private:\r
+    int m_HorzMargin;\r
+    int m_VertMargin;\r
+    int m_Width;\r
+    int m_Height;\r
+\r
+    NamePort* m_NamePort;\r
+    std::map< std::string, InputPort* >  m_InputPorts;\r
+    std::map< std::string, OutputPort* > m_OutputPorts;\r
+\r
+    TFilter* m_Filter;\r
+    Editor*  m_Editor;\r
+  };\r
+\r
+} // ecapseman\r
+\r
+#endif // __CPPIPELINEEDITOR__BLOCK__H__\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/CMakeLists.txt b/lib/cpPipelineEditor/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7943a91
--- /dev/null
@@ -0,0 +1,55 @@
+SET(lib_NAME cpPipelineEditor)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB lib_HEADERS_H   "*.h")
+FILE(GLOB lib_HEADERS_HPP "*.hpp")
+FILE(GLOB lib_HEADERS_HXX "*.hxx")
+FILE(GLOB lib_SOURCES_C   "*.c")
+FILE(GLOB lib_SOURCES_CPP "*.cpp")
+FILE(GLOB lib_SOURCES_CXX "*.cxx")
+SET(
+  lib_QT_Headers
+  Canvas.h
+  Editor.h
+  )
+
+## =====================
+## = Compilation rules =
+## =====================
+
+QT4_WRAP_CPP(lib_QT_Wrapped_MOC_Sources ${lib_QT_Headers})
+
+ADD_LIBRARY(
+  ${lib_NAME}
+  SHARED
+  ${lib_SOURCES_C}
+  ${lib_SOURCES_CPP}
+  ${lib_SOURCES_CXX}
+  ${lib_QT_Wrapped_MOC_Sources}
+  )
+SET_TARGET_PROPERTIES(
+  ${lib_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${lib_NAME}
+  BASE_NAME ${lib_NAME}
+  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/${lib_NAME}/${lib_NAME}_Export.h
+  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(
+  ${lib_NAME}
+  ${QT_LIBRARIES}
+  cpPlugins
+  )
+
+## ========================
+## -- Installation rules --
+## ========================
+
+## eof - $RCSfile$
diff --git a/lib/cpPipelineEditor/Canvas.cxx b/lib/cpPipelineEditor/Canvas.cxx
new file mode 100644 (file)
index 0000000..90f1285
--- /dev/null
@@ -0,0 +1,160 @@
+#include "Canvas.h"
+#include "Editor.h"
+#include "Block.h"
+#include "Connection.h"
+#include "Port.h"
+
+#include <QDragEnterEvent>
+#include <QWheelEvent>
+#include <QTreeWidget>
+
+// -------------------------------------------------------------------------
+cpPipelineEditor::Canvas::
+Canvas( QWidget* parent )
+  : QGraphicsView( parent )
+{
+  QGraphicsScene* scene = new QGraphicsScene( this );
+  this->setScene( scene );
+  this->setRenderHint( QPainter::Antialiasing );
+  this->setAcceptDrops( true );
+
+  this->m_Editor = new Editor( this );
+  this->m_Editor->install( scene );
+}
+
+// -------------------------------------------------------------------------
+cpPipelineEditor::Canvas::
+~Canvas( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPipelineEditor::
+Editor* cpPipelineEditor::Canvas::
+editor( )
+{
+  return( this->m_Editor );
+}
+
+// -------------------------------------------------------------------------
+const cpPipelineEditor::
+Editor* cpPipelineEditor::Canvas::
+editor( ) const
+{
+  return( this->m_Editor );
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+keyPressEvent( QKeyEvent* event )
+{
+  static const int del_key = 16777223;
+  if( event->key( ) == del_key )
+  {
+    auto _items = this->items( );
+    auto i = _items.begin( );
+    while( i != _items.end( ) )
+    {
+      if( ( *i )->isSelected( ) )
+      {
+        Block* b = dynamic_cast< Block* >( *i );
+        Connection* c = dynamic_cast< Connection* >( *i );
+        if( b != NULL )
+        {
+          if( this->m_Editor->deleteFilter( b->namePort( ).toStdString( ) ) )
+            delete b;
+        }
+        else if( c != NULL )
+        {
+          if(
+            this->m_Editor->deleteConnection(
+              c->port1( )->block( )->namePort( ).toStdString( ),
+              c->port2( )->block( )->namePort( ).toStdString( ),
+              c->port1( )->name( ).toStdString( ),
+              c->port2( )->name( ).toStdString( )
+              )
+            )
+            delete c;
+
+        } // fi
+        i = _items.end( );
+      }
+      else
+        i++;
+
+    } // elihw
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+wheelEvent( QWheelEvent* event )
+{
+  this->_scaleView(
+    std::pow( double( 2 ), event->delta( ) / double( 240 ) )
+    );
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+dragEnterEvent( QDragEnterEvent* event )
+{
+  const QMimeData* mime = event->mimeData( );
+  if( mime->hasFormat( "application/x-qabstractitemmodeldatalist" ) )
+    event->acceptProposedAction( );
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+dragLeaveEvent( QDragLeaveEvent* event )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+dragMoveEvent( QDragMoveEvent* event )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+dropEvent( QDropEvent* event )
+{
+  const QMimeData* mime = event->mimeData( );
+  if( !( mime->hasFormat( "application/x-qabstractitemmodeldatalist" ) ) )
+    return;
+
+  event->acceptProposedAction( );
+  auto tree = dynamic_cast< QTreeWidget* >( event->source( ) );
+  if( tree == NULL )
+    return;
+
+  QList< QTreeWidgetItem* > items = tree->selectedItems( );
+  for( auto iIt = items.begin( ); iIt != items.end( ); ++iIt )
+  {
+    auto parent = ( *iIt )->parent( );
+    if( parent != NULL )
+      this->m_Editor->createFilter(
+        parent->text( 0 ).toStdString( ),
+        ( *iIt )->text( 0 ).toStdString( ),
+        this->mapToScene( event->pos( ) )
+        );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Canvas::
+_scaleView( qreal scaleFactor )
+{
+  qreal factor = this->transform( ).
+    scale( scaleFactor, scaleFactor ).
+    mapRect( QRectF( 0, 0, 1, 1 ) ).
+    width( );
+  if( factor < qreal( 0.07 ) || factor > qreal( 100 ) )
+    return;
+  this->scale( scaleFactor, scaleFactor );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPipelineEditor/Canvas.h b/lib/cpPipelineEditor/Canvas.h
new file mode 100644 (file)
index 0000000..eb57a23
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __CPPIPELINEEDITOR__CANVAS__H__
+#define __CPPIPELINEEDITOR__CANVAS__H__
+
+#include <cpPipelineEditor/cpPipelineEditor_Export.h>
+#include <QtGui/QGraphicsView>
+
+namespace cpPipelineEditor
+{
+  // Some other forward declarations
+  class Block;
+  class Connection;
+  class Editor;
+
+  /**
+   */
+  class cpPipelineEditor_EXPORT Canvas
+    : public QGraphicsView
+  {
+    Q_OBJECT;
+
+  public:
+    Canvas( QWidget* parent = 0 );
+    virtual ~Canvas( );
+
+    Editor* editor( );
+    const Editor* editor( ) const;
+
+  protected:
+    /* TODO
+       void timerEvent( QTimerEvent* event );
+    */
+    void keyPressEvent( QKeyEvent* event );
+    void wheelEvent( QWheelEvent* event );
+
+    void dragEnterEvent( QDragEnterEvent* event );
+    void dragLeaveEvent( QDragLeaveEvent* event );
+    void dragMoveEvent( QDragMoveEvent* event );
+    void dropEvent( QDropEvent* event );
+
+    void _scaleView( qreal scaleFactor );
+
+  protected:
+    Editor* m_Editor;
+  };
+
+} // ecapseman
+
+#endif // __CPPIPELINEEDITOR__CANVAS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPipelineEditor/Connection.cxx b/lib/cpPipelineEditor/Connection.cxx
new file mode 100644 (file)
index 0000000..0d5eea2
--- /dev/null
@@ -0,0 +1,140 @@
+#include "Connection.h"\r
+#include "Port.h"\r
+\r
+#include <QBrush>\r
+#include <QPen>\r
+#include <QGraphicsScene>\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Connection::\r
+Connection( QGraphicsItem* parent, QGraphicsScene* scene )\r
+  : Superclass( parent, scene )\r
+{\r
+  this->setPen( QPen( Qt::black, 2 ) );\r
+  this->setBrush( Qt::NoBrush );\r
+  this->setZValue( -1 );\r
+  this->m_Port1 = NULL;\r
+  this->m_Port2 = NULL;\r
+  this->setFlag( QGraphicsItem::ItemIsSelectable );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Connection::\r
+~Connection( )\r
+{\r
+  if( this->m_Port1 != NULL )\r
+    this->m_Port1->connections( ).\r
+      remove( this->m_Port1->connections( ).indexOf( this ) );\r
+\r
+  if( this->m_Port2 != NULL )\r
+    this->m_Port2->setConnection( NULL );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+setPos1( const QPointF& p )\r
+{\r
+  this->m_Pos1 = p;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+setPos2( const QPointF& p )\r
+{\r
+  this->m_Pos2 = p;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+setPort1( OutputPort* p )\r
+{\r
+  if( p != NULL )\r
+  {\r
+    p->connections( ).append( this );\r
+    this->m_Port1 = p;\r
+\r
+  } // fi\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+setPort2( InputPort* p )\r
+{\r
+  if( p != NULL )\r
+  {\r
+    if( p->connection( ) == NULL )\r
+    {\r
+      p->setConnection( this );\r
+      this->m_Port2 = p;\r
+\r
+    } // fi\r
+\r
+  } // fi\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+updatePosFromPorts( )\r
+{\r
+  if( this->m_Port1 != NULL )\r
+    this->m_Pos1 =\r
+      this->m_Port1->scenePos( ) +\r
+      QPointF( this->m_Port1->radius( ), this->m_Port1->radius( ) );\r
+  if( this->m_Port2 != NULL )\r
+    this->m_Pos2 =\r
+      this->m_Port2->scenePos( ) +\r
+      QPointF( this->m_Port2->radius( ), this->m_Port2->radius( ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+updatePath( )\r
+{\r
+  QPainterPath p;\r
+  p.moveTo( this->m_Pos1 );\r
+\r
+  qreal dx = this->m_Pos2.x( ) - this->m_Pos1.x( );\r
+  qreal dy = this->m_Pos2.y( ) - this->m_Pos1.y( );\r
+  QPointF c1( this->m_Pos1.x( ) + dx * 0.25, this->m_Pos1.y( ) + dy * 0.1 );\r
+  QPointF c2( this->m_Pos1.x( ) + dx * 0.75, this->m_Pos1.y( ) + dy * 0.9 );\r
+  p.cubicTo( c1, c2, this->m_Pos2 );\r
+\r
+  this->setPath( p );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::OutputPort* cpPipelineEditor::Connection::\r
+port1( ) const\r
+{\r
+  return( this->m_Port1 );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::InputPort* cpPipelineEditor::Connection::\r
+port2( ) const\r
+{\r
+  return( this->m_Port2 );\r
+}\r
+\r
+#include <QPainter>\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Connection::\r
+paint(\r
+  QPainter* painter,\r
+  const QStyleOptionGraphicsItem* option,\r
+  QWidget* widget\r
+  )\r
+{\r
+  Q_UNUSED( option );\r
+  Q_UNUSED( widget );\r
+\r
+  if( this->isSelected( ) )\r
+    painter->setPen( QPen( Qt::red, 5 ) );\r
+  else\r
+    painter->setPen( QPen( Qt::black, 2 ) );\r
+  this->setBrush( Qt::NoBrush );\r
+  painter->drawPath( this->path( ) );\r
+}\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/Connection.h b/lib/cpPipelineEditor/Connection.h
new file mode 100644 (file)
index 0000000..94b8676
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef __CPPIPELINEEDITOR__CONNECTION__H__\r
+#define __CPPIPELINEEDITOR__CONNECTION__H__\r
+\r
+#include <cpPipelineEditor/cpPipelineEditor_Export.h>\r
+#include <QGraphicsPathItem>\r
+\r
+namespace cpPipelineEditor\r
+{\r
+  class InputPort;\r
+  class OutputPort;\r
+\r
+  /**\r
+   */\r
+  class cpPipelineEditor_EXPORT Connection\r
+    : public QGraphicsPathItem\r
+  {\r
+  public:\r
+    typedef Connection     Self;\r
+    typedef QGraphicsPathItem Superclass;\r
+\r
+  public:\r
+    enum { Type = QGraphicsItem::UserType + 5 };\r
+\r
+    Connection( QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );\r
+    virtual ~Connection( );\r
+\r
+    void setPos1( const QPointF& p );\r
+    void setPos2( const QPointF& p );\r
+    void setPort1( OutputPort* p );\r
+    void setPort2( InputPort* p );\r
+    void updatePosFromPorts( );\r
+    void updatePath( );\r
+    OutputPort* port1( ) const;\r
+    InputPort* port2( ) const;\r
+\r
+    inline int type( ) const\r
+      { return( this->Type ); }\r
+\r
+    virtual void paint(\r
+      QPainter* painter,\r
+      const QStyleOptionGraphicsItem* option,\r
+      QWidget* widget\r
+      );\r
+\r
+  private:\r
+    QPointF m_Pos1;\r
+    QPointF m_Pos2;\r
+    OutputPort* m_Port1;\r
+    InputPort*  m_Port2;\r
+  };\r
+\r
+} // ecapseman\r
+\r
+#endif // __CPPIPELINEEDITOR__CONNECTION__H__\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/Editor.cxx b/lib/cpPipelineEditor/Editor.cxx
new file mode 100644 (file)
index 0000000..319edb5
--- /dev/null
@@ -0,0 +1,598 @@
+#include "Editor.h"\r
+\r
+#include <QGraphicsScene>\r
+#include <QEvent>\r
+#include <QGraphicsSceneContextMenuEvent>\r
+#include <QGraphicsSceneDragDropEvent>\r
+#include <QGraphicsSceneHelpEvent>\r
+#include <QGraphicsSceneHoverEvent>\r
+#include <QGraphicsSceneMouseEvent>\r
+#include <QGraphicsSceneMoveEvent>\r
+#include <QGraphicsSceneResizeEvent>\r
+#include <QGraphicsSceneWheelEvent>\r
+#include <QInputDialog>\r
+#include <QMessageBox>\r
+\r
+#include "Port.h"\r
+#include "Connection.h"\r
+#include "Block.h"\r
+\r
+// -------------------------------------------------------------------------\r
+#define cpPipelineEditor_Editor_Callback_SWITCH( E, e )                 \\r
+  case QEvent::GraphicsScene##E:                                        \\r
+  {                                                                     \\r
+    QGraphicsScene##E##Event* evt =                                     \\r
+      dynamic_cast< QGraphicsScene##E##Event* >( e );                   \\r
+    if( evt != NULL )                                                   \\r
+      this->_##E##_cbk( evt );                                          \\r
+  }                                                                     \\r
+  break;\r
+\r
+// -------------------------------------------------------------------------\r
+#define cpPipelineEditor_Editor_Callback_CODE( E )                      \\r
+  void cpPipelineEditor::Editor::_##E##_cbk( QGraphicsScene##E##Event* evt )\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Editor::\r
+Editor( QObject* parent )\r
+  : Superclass( parent ),\r
+    m_ActualConnection( NULL ),\r
+    m_Workspace( NULL )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Editor::\r
+~Editor( )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Editor::\r
+TWorkspace* cpPipelineEditor::Editor::\r
+workspace( )\r
+{\r
+  return( this->m_Workspace );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+const cpPipelineEditor::Editor::\r
+TWorkspace* cpPipelineEditor::Editor::\r
+workspace( ) const\r
+{\r
+  return( this->m_Workspace );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Editor::\r
+setWorkspace( TWorkspace* ws )\r
+{\r
+  this->m_Workspace = ws;\r
+  this->m_Graph = TGraph::New( );\r
+\r
+  // Create blocks\r
+  auto vIt = this->m_Workspace->GetGraph( )->BeginVertices( );\r
+  auto vIt_end = this->m_Workspace->GetGraph( )->EndVertices( );\r
+  for( ; vIt != vIt_end; ++vIt )\r
+  {\r
+    auto b = this->_createBlock(\r
+      dynamic_cast< TFilter* >( vIt->second.GetPointer( ) ),\r
+      vIt->first.c_str( ),\r
+      QPointF( vIt->second->GetViewX( ), vIt->second->GetViewY( ) )\r
+      );\r
+    if( b != NULL )\r
+      this->m_Graph->SetVertex( vIt->first, b );\r
+\r
+  } // rof\r
+\r
+  // Add edges\r
+  auto rIt = this->m_Workspace->GetGraph( )->BeginEdgesRows( );\r
+  auto rIt_end = this->m_Workspace->GetGraph( )->EndEdgesRows( );\r
+  for( ; rIt != rIt_end; ++rIt )\r
+  {\r
+    Block* orig = this->m_Graph->GetVertex( rIt->first );\r
+    auto cIt = rIt->second.begin( );\r
+    for( ; cIt != rIt->second.end( ); ++cIt )\r
+    {\r
+      Block* dest = this->m_Graph->GetVertex( cIt->first );\r
+      auto eIt = cIt->second.begin( );\r
+      for( ; eIt != cIt->second.end( ); ++eIt )\r
+      {\r
+        OutputPort* op = orig->outputPort( eIt->first.c_str( ) );\r
+        InputPort* ip = dest->inputPort( eIt->second.c_str( ) );\r
+        if( op == NULL || ip == NULL )\r
+          continue;\r
+\r
+        Connection* c = new Connection( 0, this->m_Scene );\r
+        c->setPort1( op );\r
+        c->setPort2( ip );\r
+        c->updatePosFromPorts( );\r
+        c->updatePath( );\r
+        this->m_Graph->AddEdge( rIt->first, cIt->first, c );\r
+\r
+      } // rof\r
+\r
+    } // rof\r
+\r
+  } // rof\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+std::string cpPipelineEditor::Editor::\r
+createFilter(\r
+  const std::string& category,\r
+  const std::string& filter,\r
+  const QPointF& pnt\r
+  )\r
+{\r
+  std::string name = filter;\r
+  while( this->m_Workspace->HasFilter( name ) )\r
+    name += std::string( "_" );\r
+  if( this->m_Workspace->CreateFilter( category, filter, name ) )\r
+  {\r
+    auto b = this->_createBlock(\r
+      this->m_Workspace->GetFilter( name ),\r
+      name.c_str( ),\r
+      pnt\r
+      );\r
+    return( name );\r
+  }\r
+  else\r
+    return( "" );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+bool cpPipelineEditor::Editor::\r
+deleteFilter( const std::string& name )\r
+{\r
+  std::cout << name << std::endl;\r
+  return( false );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+bool cpPipelineEditor::Editor::\r
+deleteConnection(\r
+  const std::string& src, const std::string& des,\r
+  const std::string& in, const std::string& out\r
+  )\r
+{\r
+  std::cout\r
+    << src << " "\r
+    << des << " "\r
+    << in << " "\r
+    << out << std::endl;\r
+  return( false );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Editor::\r
+install( QGraphicsScene* s )\r
+{\r
+  s->installEventFilter( this );\r
+  this->m_Scene = s;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+QGraphicsItem* cpPipelineEditor::Editor::\r
+itemAt( const QPointF& pos )\r
+{\r
+  QList< QGraphicsItem* > items =\r
+    this->m_Scene->items( QRectF( pos - QPointF( 1, 1 ), QSize( 3, 3 ) ) );\r
+\r
+  foreach( QGraphicsItem* item, items )\r
+    if( item->type( ) > QGraphicsItem::UserType )\r
+      return( item );\r
+  return( NULL );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Block* cpPipelineEditor::Editor::\r
+_createBlock( TFilter* f, const QString& name, const QPointF& pnt )\r
+{\r
+  if( f == NULL )\r
+    return( NULL );\r
+\r
+  // Add block\r
+  Block* b = new Block( f, name, 0, this->m_Scene );\r
+  b->setEditor( this );\r
+  b->setPos( pnt );\r
+\r
+  // Mark exposed inputs\r
+  auto& e_in = this->m_Workspace->GetExposedInputPorts( );\r
+  auto f_in = f->GetInputsNames( );\r
+  for( auto iIt = f_in.begin( ); iIt != f_in.end( ); ++iIt )\r
+  {\r
+    auto eIt = e_in.begin( );\r
+    auto fIt = e_in.end( );\r
+    for( ; eIt != e_in.end( ) && fIt == e_in.end( ); ++eIt )\r
+      if( eIt->second.second == *iIt )\r
+        fIt = eIt;\r
+    if( fIt == e_in.end( ) )\r
+      continue;\r
+    \r
+    auto port = b->inputPort( iIt->c_str( ) );\r
+    port->setExtendedName( fIt->first.c_str( ) );\r
+    port->setExtend( true );\r
+\r
+  } // rof\r
+\r
+  // Mark exposed outputs\r
+  auto& e_out = this->m_Workspace->GetExposedOutputPorts( );\r
+  auto f_out = f->GetOutputsNames( );\r
+  for( auto iIt = f_out.begin( ); iIt != f_out.end( ); ++iIt )\r
+  {\r
+    auto eIt = e_out.begin( );\r
+    auto fIt = e_out.end( );\r
+    for( ; eIt != e_out.end( ) && fIt == e_out.end( ); ++eIt )\r
+      if( eIt->second.second == *iIt )\r
+        fIt = eIt;\r
+    if( fIt == e_out.end( ) )\r
+      continue;\r
+    \r
+    auto port = b->outputPort( iIt->c_str( ) );\r
+    port->setExtendedName( fIt->first.c_str( ) );\r
+    port->setExtend( true );\r
+\r
+  } // rof\r
+\r
+  return( b );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+bool cpPipelineEditor::Editor::\r
+eventFilter( QObject* o, QEvent* e )\r
+{\r
+  // Event type\r
+  switch( int( e->type( ) ) )\r
+  {\r
+    cpPipelineEditor_Editor_Callback_SWITCH( ContextMenu, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( DragEnter, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( DragLeave, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( DragMove, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( Drop, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( Help, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( HoverEnter, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( HoverLeave, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( HoverMove, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( MouseDoubleClick, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( MouseMove, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( MousePress, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( MouseRelease, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( Move, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( Resize, e );\r
+    cpPipelineEditor_Editor_Callback_SWITCH( Wheel, e );\r
+  default:\r
+    break;\r
+  } // hctiws\r
+  return( this->Superclass::eventFilter( o, e ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Editor::\r
+updateFilter( const std::string& filter_name )\r
+{\r
+  emit execFilter( filter_name );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Editor::\r
+showOutputData(\r
+  const std::string& filter_name, const std::string& output_name\r
+  )\r
+{\r
+  emit showFilterOutput( filter_name, output_name );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( ContextMenu )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( DragEnter )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( DragLeave )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( DragMove )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( Drop )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( Help )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( HoverEnter )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( HoverLeave )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( HoverMove )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( MouseDoubleClick )\r
+{\r
+  QGraphicsItem* item = this->itemAt( evt->scenePos( ) );\r
+  if( item == NULL )\r
+    return;\r
+\r
+  switch( evt->button( ) )\r
+  {\r
+  case Qt::LeftButton:\r
+  {\r
+    Block* block = dynamic_cast< Block* >( item );\r
+    Port* port = dynamic_cast< Port* >( item );\r
+    Connection* conn = dynamic_cast< Connection* >( item );\r
+\r
+    if( block != NULL )\r
+    {\r
+      QString old_name = block->namePort( );\r
+      bool ok;\r
+      QString new_name =\r
+        QInputDialog::getText(\r
+          dynamic_cast< QWidget* >( this->parent( ) ),\r
+          "Change filter name",\r
+          "Filter name:",\r
+          QLineEdit::Normal,\r
+          old_name,\r
+          &ok\r
+          );\r
+      if( ok && !new_name.isEmpty( ) && old_name != new_name )\r
+      {\r
+        ok = this->m_Graph->RenameVertex(\r
+          old_name.toStdString( ),\r
+          new_name.toStdString( )\r
+          );\r
+        block->setNamePort( new_name );\r
+        this->m_Workspace->RenameFilter(\r
+          old_name.toStdString( ),\r
+          new_name.toStdString( )\r
+          );\r
+\r
+      } // fi\r
+    }\r
+    else if( port != NULL )\r
+    {\r
+      if( evt->modifiers( ) == Qt::ControlModifier )\r
+      {\r
+        port->setExtend( !( port->isExtended( ) ) );\r
+        InputPort* in_port = dynamic_cast< InputPort* >( port );\r
+        OutputPort* out_port = dynamic_cast< OutputPort* >( port );\r
+        if( port->isExtended( ) )\r
+        {\r
+          if( in_port != NULL )\r
+          {\r
+            this->m_Workspace->ExposeInputPort(\r
+              in_port->extendedName( ).toStdString( ),\r
+              in_port->block( )->namePort( ).toStdString( ),\r
+              in_port->name( ).toStdString( )\r
+              );\r
+          }\r
+          else if( out_port != NULL )\r
+          {\r
+            this->m_Workspace->ExposeOutputPort(\r
+              out_port->extendedName( ).toStdString( ),\r
+              out_port->block( )->namePort( ).toStdString( ),\r
+              out_port->name( ).toStdString( )\r
+              );\r
+\r
+          } // fi\r
+        }\r
+        else\r
+        {\r
+          if( in_port != NULL )\r
+            this->m_Workspace->HideInputPort(\r
+              in_port->extendedName( ).toStdString( )\r
+              );\r
+          else if( out_port != NULL )\r
+            this->m_Workspace->HideOutputPort(\r
+              out_port->extendedName( ).toStdString( )\r
+              );\r
+\r
+        } // fi\r
+        this->m_Scene->update( );\r
+      }\r
+      else if( evt->modifiers( ) == Qt::NoModifier )\r
+      {\r
+        if( port->isExtended( ) )\r
+        {\r
+          QString old_name = port->extendedName( );\r
+          bool ok;\r
+          QString new_name =\r
+            QInputDialog::getText(\r
+              dynamic_cast< QWidget* >( this->parent( ) ),\r
+              "Change filter name",\r
+              "Filter name:",\r
+              QLineEdit::Normal,\r
+              old_name,\r
+              &ok\r
+              );\r
+          if( ok && !new_name.isEmpty( ) && old_name != new_name )\r
+          {\r
+            port->setExtendedName( new_name );\r
+            InputPort* in_port = dynamic_cast< InputPort* >( port );\r
+            OutputPort* out_port = dynamic_cast< OutputPort* >( port );\r
+            if( in_port != NULL )\r
+              this->m_Workspace->\r
+                RenameExposedInputPort(\r
+                  old_name.toStdString( ),\r
+                  new_name.toStdString( )\r
+                  );\r
+            else if( out_port != NULL )\r
+              this->m_Workspace->\r
+                RenameExposedOutputPort(\r
+                  old_name.toStdString( ),\r
+                  new_name.toStdString( )\r
+                  );\r
+            this->m_Scene->update( );\r
+\r
+          } // fi\r
+\r
+        } // fi\r
+\r
+      } // fi\r
+    }\r
+    else if( conn != NULL )\r
+    {\r
+    } // fi\r
+  }\r
+  break;\r
+  /* TODO:\r
+     case Qt::RightButton:\r
+     {\r
+     }\r
+     break;\r
+     case Qt::MiddleButton:\r
+     {\r
+     }\r
+     break;\r
+  */\r
+  default:\r
+    break;\r
+  } // hctiws\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( MouseMove )\r
+{\r
+  if( this->m_ActualConnection != NULL )\r
+  {\r
+    if( this->m_ActualConnection->port1( ) == NULL )\r
+      this->m_ActualConnection->setPos1( evt->scenePos( ) );\r
+    else if( this->m_ActualConnection->port2( ) == NULL )\r
+      this->m_ActualConnection->setPos2( evt->scenePos( ) );\r
+    this->m_ActualConnection->updatePath( );\r
+\r
+  } // fi\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( MousePress )\r
+{\r
+  InputPort* in_port =\r
+    dynamic_cast< InputPort* >( this->itemAt( evt->scenePos( ) ) );\r
+  OutputPort* out_port =\r
+    dynamic_cast< OutputPort* >( this->itemAt( evt->scenePos( ) ) );\r
+  if( in_port == NULL && out_port == NULL )\r
+    return;\r
+\r
+  switch( evt->button( ) )\r
+  {\r
+  case Qt::LeftButton:\r
+  {\r
+    if( out_port != NULL )\r
+    {\r
+      if( out_port->block( ) != NULL )\r
+      {\r
+        // Start new connection\r
+        this->m_ActualConnection = new Connection( 0, this->m_Scene );\r
+        this->m_ActualConnection->setPort1( out_port );\r
+        this->m_ActualConnection->setPos1( out_port->scenePos( ) );\r
+        this->m_ActualConnection->setPos2( evt->scenePos( ) );\r
+        this->m_ActualConnection->updatePosFromPorts( );\r
+        this->m_ActualConnection->updatePath( );\r
+\r
+      } // fi\r
+\r
+    } // fi\r
+  }\r
+  break;\r
+  default:\r
+    break;\r
+\r
+  } // hctiws\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( MouseRelease )\r
+{\r
+  if( this->m_ActualConnection == NULL )\r
+    return;\r
+\r
+  switch( evt->button( ) )\r
+  {\r
+  case Qt::LeftButton:\r
+  {\r
+    InputPort* port2 =\r
+      dynamic_cast< InputPort* >( this->itemAt( evt->scenePos( ) ) );\r
+    if( port2 != NULL )\r
+    {\r
+      OutputPort* port1 =\r
+        dynamic_cast< OutputPort* >( this->m_ActualConnection->port1( ) );\r
+      if( port1 != NULL )\r
+      {\r
+        if(\r
+          port1->block( ) != port2->block( ) &&\r
+          !port2->hasConnection( ) &&\r
+          !port1->isConnected( port2 ) &&\r
+          !port2->isExtended( )\r
+          )\r
+        {\r
+          this->m_ActualConnection->setPos2( port2->scenePos( ) );\r
+          this->m_ActualConnection->setPort2( port2 );\r
+          this->m_ActualConnection->updatePosFromPorts( );\r
+          this->m_ActualConnection->updatePath( );\r
+\r
+          this->m_Workspace->Connect(\r
+            port1->block( )->namePort( ).toStdString( ),\r
+            port2->block( )->namePort( ).toStdString( ),\r
+            port1->name( ).toStdString( ),\r
+            port2->name( ).toStdString( )\r
+            );\r
+          this->m_Graph->AddEdge(\r
+            port1->block( )->namePort( ).toStdString( ),\r
+            port2->block( )->namePort( ).toStdString( ),\r
+            this->m_ActualConnection\r
+            );\r
+        }\r
+        else\r
+          delete this->m_ActualConnection;\r
+      }\r
+      else\r
+        delete this->m_ActualConnection;\r
+    }\r
+    else\r
+      delete this->m_ActualConnection;\r
+    this->m_ActualConnection = NULL;\r
+  }\r
+  break;\r
+  default:\r
+    break;\r
+  } // hctisw\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( Move )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( Resize )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor_Editor_Callback_CODE( Wheel )\r
+{\r
+}\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/Editor.h b/lib/cpPipelineEditor/Editor.h
new file mode 100644 (file)
index 0000000..3429477
--- /dev/null
@@ -0,0 +1,131 @@
+#ifndef __CPPIPELINEEDITOR__EDITOR__H__\r
+#define __CPPIPELINEEDITOR__EDITOR__H__\r
+\r
+#include <cpPipelineEditor/cpPipelineEditor_Export.h>\r
+#include <cpExtensions/DataStructures/Graph.h>\r
+#include <cpPlugins/Workspace.h>\r
+#include <QObject>\r
+#include <QPointF>\r
+\r
+class QGraphicsScene;\r
+class QGraphicsSceneMouseEvent;\r
+class QGraphicsItem;\r
+class QGraphicsSceneContextMenuEvent;\r
+class QGraphicsSceneDragDropEvent;\r
+class QGraphicsSceneHelpEvent;\r
+class QGraphicsSceneHoverEvent;\r
+class QGraphicsSceneMouseEvent;\r
+class QGraphicsSceneMoveEvent;\r
+class QGraphicsSceneResizeEvent;\r
+class QGraphicsSceneWheelEvent;\r
+\r
+// -------------------------------------------------------------------------\r
+#define cpPipelineEditor_Editor_Callback_DCL( E )       \\r
+  void _##E##_cbk( QGraphicsScene##E##Event* e );\r
+\r
+namespace cpPipelineEditor\r
+{\r
+  class Connection;\r
+  class Block;\r
+\r
+  /**\r
+   */\r
+  class cpPipelineEditor_EXPORT Editor\r
+    : public QObject\r
+  {\r
+    Q_OBJECT;\r
+\r
+  public:\r
+    typedef Editor Self;\r
+    typedef QObject      Superclass;\r
+\r
+    typedef cpPlugins::Workspace     TWorkspace;\r
+    typedef cpPlugins::ProcessObject TFilter;\r
+    typedef\r
+      cpExtensions::DataStructures::\r
+      Graph< Block*, Connection*, std::string > TGraph;\r
+\r
+  public:\r
+    explicit Editor( QObject* parent = 0 );\r
+    virtual ~Editor( );\r
+\r
+    TWorkspace* workspace( );\r
+    const TWorkspace* workspace( ) const;\r
+    void setWorkspace( TWorkspace* ws );\r
+\r
+    std::string createFilter(\r
+      const std::string& category, const std::string& filter,\r
+      const QPointF& pnt = QPointF( qreal( 0 ), qreal( 0 ) )\r
+      );\r
+    bool deleteFilter( const std::string& name );\r
+    bool deleteConnection(\r
+      const std::string& src, const std::string& des,\r
+      const std::string& in, const std::string& out\r
+      );\r
+\r
+    void install( QGraphicsScene* s );\r
+    bool eventFilter( QObject* o, QEvent* e );\r
+\r
+    void updateFilter( const std::string& filter_name );\r
+    void showOutputData(\r
+      const std::string& filter_name,\r
+      const std::string& output_name\r
+      );\r
+\r
+  signals:\r
+    void execFilter( const std::string& filter_name );\r
+    void showFilterOutput(\r
+      const std::string& filter_name,\r
+      const std::string& output_name\r
+      );\r
+\r
+  private:\r
+    QGraphicsItem* itemAt( const QPointF& pos );\r
+\r
+    inline Block* _createBlock(\r
+      TFilter* f, const QString& name, const QPointF& pnt\r
+      );\r
+\r
+  protected:\r
+    typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragEnterEvent;\r
+    typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragLeaveEvent;\r
+    typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragMoveEvent;\r
+    typedef QGraphicsSceneDragDropEvent QGraphicsSceneDropEvent;\r
+    typedef QGraphicsSceneHoverEvent    QGraphicsSceneHoverEnterEvent;\r
+    typedef QGraphicsSceneHoverEvent    QGraphicsSceneHoverMoveEvent;\r
+    typedef QGraphicsSceneHoverEvent    QGraphicsSceneHoverLeaveEvent;\r
+    typedef QGraphicsSceneMouseEvent    QGraphicsSceneMouseDoubleClickEvent;\r
+    typedef QGraphicsSceneMouseEvent    QGraphicsSceneMouseMoveEvent;\r
+    typedef QGraphicsSceneMouseEvent    QGraphicsSceneMousePressEvent;\r
+    typedef QGraphicsSceneMouseEvent    QGraphicsSceneMouseReleaseEvent;\r
+\r
+    cpPipelineEditor_Editor_Callback_DCL( ContextMenu );\r
+    cpPipelineEditor_Editor_Callback_DCL( DragEnter );\r
+    cpPipelineEditor_Editor_Callback_DCL( DragLeave );\r
+    cpPipelineEditor_Editor_Callback_DCL( DragMove );\r
+    cpPipelineEditor_Editor_Callback_DCL( Drop );\r
+    cpPipelineEditor_Editor_Callback_DCL( Help );\r
+    cpPipelineEditor_Editor_Callback_DCL( HoverEnter );\r
+    cpPipelineEditor_Editor_Callback_DCL( HoverLeave );\r
+    cpPipelineEditor_Editor_Callback_DCL( HoverMove );\r
+    cpPipelineEditor_Editor_Callback_DCL( MouseDoubleClick );\r
+    cpPipelineEditor_Editor_Callback_DCL( MouseMove );\r
+    cpPipelineEditor_Editor_Callback_DCL( MousePress );\r
+    cpPipelineEditor_Editor_Callback_DCL( MouseRelease );\r
+    cpPipelineEditor_Editor_Callback_DCL( Move );\r
+    cpPipelineEditor_Editor_Callback_DCL( Resize );\r
+    cpPipelineEditor_Editor_Callback_DCL( Wheel );\r
+\r
+  private:\r
+    QGraphicsScene* m_Scene;\r
+    Connection* m_ActualConnection;\r
+\r
+    TWorkspace* m_Workspace;\r
+    TGraph::Pointer m_Graph;\r
+  };\r
+\r
+} // ecapseman\r
+\r
+#endif // __CPPIPELINEEDITOR__EDITOR__H__\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/Port.cxx b/lib/cpPipelineEditor/Port.cxx
new file mode 100644 (file)
index 0000000..b447b0a
--- /dev/null
@@ -0,0 +1,292 @@
+#include "Port.h"\r
+#include "Connection.h"\r
+#include "Block.h"\r
+#include "Editor.h"\r
+\r
+#include <QGraphicsScene>\r
+#include <QGraphicsSceneContextMenuEvent>\r
+#include <QFontMetrics>\r
+#include <QMenu>\r
+#include <QPainter>\r
+#include <QPen>\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Port::\r
+Port( QGraphicsItem* parent, QGraphicsScene* scene )\r
+  : Superclass( parent, scene ),\r
+    m_Radius( 5 ),\r
+    m_Margin( 2 )\r
+{\r
+  this->m_Label = new QGraphicsTextItem( this );\r
+  this->m_ExtendedLabel = new QGraphicsTextItem( this );\r
+  this->setExtend( false );\r
+\r
+  QPainterPath p;\r
+  p.addEllipse( 0, 0, 2 * this->m_Radius, 2 * this->m_Radius );\r
+\r
+  this->setPath( p );\r
+  this->setPen( QPen( Qt::darkRed ) );\r
+  this->setBrush( Qt::red );\r
+  this->setFlag( QGraphicsItem::ItemSendsScenePositionChanges );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::Port::\r
+~Port( )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Port::\r
+setBlock( Block* b )\r
+{\r
+  this->m_Block = b;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Port::\r
+setName( const QString& n )\r
+{\r
+  this->m_Label->setPlainText( n );\r
+  this->_updateLabels( );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Port::\r
+setExtendedName( const QString& n )\r
+{\r
+  this->m_ExtendedLabel->setPlainText( n );\r
+  this->_updateLabels( );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Port::\r
+setExtend( bool extend )\r
+{\r
+  // Do nothing!\r
+  this->m_IsExtended = false;\r
+  this->m_ExtendedLabel->setVisible( false );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::Port::\r
+paint(\r
+  QPainter* painter,\r
+  const QStyleOptionGraphicsItem* option,\r
+  QWidget* widget\r
+  )\r
+{\r
+  Q_UNUSED( option );\r
+  Q_UNUSED( widget );\r
+\r
+  if( this->isExtended( ) )\r
+  {\r
+    painter->setPen( QPen( Qt::darkBlue ) );\r
+    painter->setBrush( Qt::blue );\r
+  }\r
+  else\r
+  {\r
+    painter->setPen( QPen( Qt::darkRed ) );\r
+    painter->setBrush( Qt::red );\r
+\r
+  } // fi\r
+  painter->drawPath( this->path( ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::NamePort::\r
+NamePort( QGraphicsItem* parent, QGraphicsScene* scene )\r
+  : Superclass( parent, scene )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::NamePort::\r
+~NamePort( )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::NamePort::\r
+_updateLabels( )\r
+{\r
+  QFont font( this->scene( )->font( ) );\r
+  font.setBold( true );\r
+  this->m_Label->setFont( font );\r
+  this->m_ExtendedLabel->setFont( font );\r
+  this->setPath( QPainterPath( ) );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+bool cpPipelineEditor::NamePort::\r
+isConnected( Port* other )\r
+{\r
+  return( false );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::InputPort::\r
+InputPort( QGraphicsItem* parent, QGraphicsScene* scene )\r
+  : Superclass( parent, scene ),\r
+    m_Connection( NULL )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::InputPort::\r
+~InputPort( )\r
+{\r
+  if( this->m_Connection != NULL )\r
+    delete this->m_Connection;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::InputPort::\r
+_updateLabels( )\r
+{\r
+  QFontMetrics fm( this->scene( )->font( ) );\r
+  this->m_Label->setPos( this->m_Radius * 2, -fm.height( ) / 2 );\r
+  this->m_ExtendedLabel->setPos(\r
+    -fm.width( this->extendedName( ) ) - this->m_Radius * 2,\r
+    -fm.height( ) / 2\r
+    );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::InputPort::\r
+setExtend( bool extend )\r
+{\r
+  if( this->m_Connection == NULL )\r
+  {\r
+    this->m_IsExtended = extend;\r
+    this->m_ExtendedLabel->setVisible( extend );\r
+  }\r
+  else\r
+    this->Superclass::setExtend( false );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+bool cpPipelineEditor::InputPort::\r
+isConnected( Port* other )\r
+{\r
+  if( this->m_Connection != NULL )\r
+    return(\r
+      this->m_Connection->port1( ) == other &&\r
+      this->m_Connection->port2( ) == this\r
+      );\r
+  else\r
+    return( false );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::InputPort::\r
+setConnection( Connection* c )\r
+{\r
+  this->m_Connection = c;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+QVariant cpPipelineEditor::InputPort::\r
+itemChange( GraphicsItemChange change, const QVariant& value )\r
+{\r
+  if( change == ItemScenePositionHasChanged )\r
+  {\r
+    if( this->m_Connection != NULL )\r
+    {\r
+      this->m_Connection->updatePosFromPorts( );\r
+      this->m_Connection->updatePath( );\r
+\r
+    } // fi\r
+\r
+  } // fi\r
+  return( value );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::OutputPort::\r
+OutputPort( QGraphicsItem* parent, QGraphicsScene* scene )\r
+  : Superclass( parent, scene )\r
+{\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+cpPipelineEditor::OutputPort::\r
+~OutputPort( )\r
+{\r
+  foreach( Connection* conn, this->m_Connections )\r
+    delete conn;\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::OutputPort::\r
+_updateLabels( )\r
+{\r
+  QFontMetrics fm( this->scene( )->font( ) );\r
+  this->m_Label->setPos(\r
+    -fm.width( this->name( ) ) - this->m_Radius * 2, -fm.height( ) / 2\r
+    );\r
+  this->m_ExtendedLabel->setPos( this->m_Radius * 2, -fm.height( ) / 2 );\r
+\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::OutputPort::\r
+setExtend( bool extend )\r
+{\r
+  this->m_IsExtended = extend;\r
+  this->m_ExtendedLabel->setVisible( extend );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+bool cpPipelineEditor::OutputPort::\r
+isConnected( Port* other )\r
+{\r
+  auto i = this->m_Connections.begin( );\r
+  bool conn = false;\r
+  for( ; i != this->m_Connections.end( ) && !conn; ++i )\r
+    conn |= ( ( *i )->port1( ) == this && ( *i )->port2( ) == other );\r
+  return( conn );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+QVariant cpPipelineEditor::OutputPort::\r
+itemChange( GraphicsItemChange change, const QVariant& value )\r
+{\r
+  if( change == ItemScenePositionHasChanged )\r
+  {\r
+    foreach( Connection* conn, this->m_Connections )\r
+    {\r
+      conn->updatePosFromPorts( );\r
+      conn->updatePath( );\r
+\r
+    } // rof\r
+\r
+  } // fi\r
+  return( value );\r
+}\r
+\r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::OutputPort::\r
+contextMenuEvent( QGraphicsSceneContextMenuEvent* evt )\r
+{\r
+  if( this->m_Block == NULL )\r
+    return;\r
+  \r
+  QMenu menu;\r
+  QAction* showAction = menu.addAction( "Show" );\r
+  QAction* hideAction = menu.addAction( "Hide" );\r
+  QAction* selectedAction = menu.exec( evt->screenPos( ) );\r
+\r
+  if( selectedAction == showAction )\r
+  {\r
+    this->m_Block->editor( )->showOutputData(\r
+      this->m_Block->namePort( ).toStdString( ),\r
+      this->name( ).toStdString( )\r
+      );\r
+  }\r
+  else if( selectedAction == hideAction )\r
+  {\r
+  } // fi\r
+}\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPipelineEditor/Port.h b/lib/cpPipelineEditor/Port.h
new file mode 100644 (file)
index 0000000..4daafd0
--- /dev/null
@@ -0,0 +1,169 @@
+#ifndef __CPPIPELINEEDITOR__PORT__H__\r
+#define __CPPIPELINEEDITOR__PORT__H__\r
+\r
+#include <cpPipelineEditor/cpPipelineEditor_Export.h>\r
+#include <QGraphicsPathItem>\r
+\r
+namespace cpPipelineEditor\r
+{\r
+  class Block;\r
+  class Connection;\r
+\r
+  /**\r
+   */\r
+  class cpPipelineEditor_EXPORT Port\r
+    : public QGraphicsPathItem\r
+  {\r
+  public:\r
+    typedef Port Self;\r
+    typedef QGraphicsPathItem Superclass;\r
+\r
+    enum { Type = QGraphicsItem::UserType + 1 };\r
+\r
+  public:\r
+    Port( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
+    virtual ~Port( );\r
+\r
+    void setBlock( Block* b );\r
+    inline Block* block( ) const\r
+      { return( this->m_Block ); }\r
+\r
+    virtual void setName( const QString& n );\r
+    virtual void setExtendedName( const QString& n );\r
+    inline QString name( ) const\r
+      { return( this->m_Label->toPlainText( ) ); }\r
+    inline QString extendedName( ) const\r
+      { return( this->m_ExtendedLabel->toPlainText( ) ); }\r
+\r
+    inline int radius( ) const\r
+      { return( this->m_Radius ); }\r
+\r
+    inline bool isExtended( ) const\r
+      { return( this->m_IsExtended ); }\r
+    virtual void setExtend( bool extend );\r
+\r
+    virtual bool isConnected( Port* other ) = 0;\r
+    inline int type( ) const\r
+      { return( this->Type ); }\r
+\r
+    virtual void paint(\r
+      QPainter* painter,\r
+      const QStyleOptionGraphicsItem* option,\r
+      QWidget* widget\r
+      );\r
+\r
+  protected:\r
+    virtual void _updateLabels( ) { }\r
+\r
+  protected:\r
+    Block* m_Block;\r
+\r
+    int  m_Radius;\r
+    int  m_Margin;\r
+    bool m_IsExtended;\r
+\r
+    QGraphicsTextItem* m_Label;\r
+    QGraphicsTextItem* m_ExtendedLabel;\r
+  };\r
+\r
+  /**\r
+   */\r
+  class NamePort\r
+    : public Port\r
+  {\r
+  public:\r
+    typedef NamePort Self;\r
+    typedef Port     Superclass;\r
+\r
+    enum { Type = Superclass::Type + 1 };\r
+\r
+  public:\r
+    NamePort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
+    virtual ~NamePort( );\r
+\r
+    virtual bool isConnected( Port* other );\r
+    inline int type( ) const\r
+      { return( this->Type ); }\r
+\r
+  protected:\r
+    virtual void _updateLabels( );\r
+  };\r
+\r
+  /**\r
+   */\r
+  class InputPort\r
+    : public Port\r
+  {\r
+  public:\r
+    typedef InputPort Self;\r
+    typedef Port      Superclass;\r
+\r
+    enum { Type = Superclass::Type + 3 };\r
+\r
+  public:\r
+    InputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
+    virtual ~InputPort( );\r
+\r
+    virtual void setExtend( bool extend );\r
+\r
+    virtual bool isConnected( Port* other );\r
+    inline int type( ) const\r
+      { return( this->Type ); }\r
+\r
+    void setConnection( Connection* c );\r
+    inline Connection* connection( )\r
+      { return( this->m_Connection ); }\r
+    inline const Connection* connection( ) const\r
+      { return( this->m_Connection ); }\r
+    inline bool hasConnection( ) const\r
+      { return( this->m_Connection != NULL ); }\r
+\r
+  protected:\r
+    QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
+    virtual void _updateLabels( );\r
+\r
+  protected:\r
+    Connection* m_Connection;\r
+  };\r
+\r
+  /**\r
+   */\r
+  class OutputPort\r
+    : public Port\r
+  {\r
+  public:\r
+    typedef OutputPort Self;\r
+    typedef Port       Superclass;\r
+\r
+    enum { Type = Superclass::Type + 4 };\r
+\r
+  public:\r
+    OutputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
+    virtual ~OutputPort( );\r
+\r
+    virtual void setExtend( bool extend );\r
+\r
+    virtual bool isConnected( Port* other );\r
+    inline int type( ) const\r
+      { return( this->Type ); }\r
+\r
+    inline QVector< Connection* >& connections( )\r
+      { return( this->m_Connections ); }\r
+    inline const QVector< Connection* >& connections( ) const\r
+      { return( this->m_Connections ); }\r
+\r
+  protected:\r
+    QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
+    virtual void _updateLabels( );\r
+\r
+    virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* evt );\r
+\r
+  protected:\r
+    QVector< Connection* > m_Connections;\r
+  };\r
+\r
+} // ecapseman\r
+\r
+#endif // __CPPIPELINEEDITOR__PORT__H__\r
+\r
+// eof - $RCSfile$\r
diff --git a/lib/cpPlugins/BaseWidget.cxx b/lib/cpPlugins/BaseWidget.cxx
new file mode 100644 (file)
index 0000000..35915d2
--- /dev/null
@@ -0,0 +1,59 @@
+#include <cpPlugins/BaseWidget.h>
+
+// -------------------------------------------------------------------------
+const cpPlugins::BaseWidget::TMPRWidget* cpPlugins::BaseWidget::
+GetMPRViewer( ) const
+{
+  return( this->m_MPRViewer );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderWindowInteractor* cpPlugins::BaseWidget::
+GetSingleInteractor( ) const
+{
+  return( this->m_SingleInteractor );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseWidget::
+SetMPRViewer( cpPlugins::BaseWidget::TMPRWidget* v )
+{
+  if( this->m_MPRViewer != v )
+  {
+    this->m_MPRViewer = v;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseWidget::
+SetSingleInteractor( vtkRenderWindowInteractor* i )
+{
+  if( this->m_SingleInteractor != i )
+  {
+    this->m_SingleInteractor = i;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::BaseWidget::
+BaseWidget( )
+  : Superclass( ),
+    m_MPRViewer( NULL ),
+    m_SingleInteractor( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::BaseWidget::
+~BaseWidget( )
+{
+  // Warning: Qt's smartpointers require this to avoid segfaults
+  this->m_MPRViewer = NULL;
+  this->m_SingleInteractor = NULL;
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/BaseWidget.h b/lib/cpPlugins/BaseWidget.h
new file mode 100644 (file)
index 0000000..04de85a
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef __CPPLUGINS__BASEWIDGET__H__
+#define __CPPLUGINS__BASEWIDGET__H__
+
+#include <cpPlugins/ProcessObject.h>
+
+// Some forward declarations
+class vtkRenderWindowInteractor;
+namespace cpExtensions
+{
+  namespace QT
+  {
+    class SimpleMPRWidget;
+  }
+}
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT BaseWidget
+    : public ProcessObject
+  {
+  public:
+    typedef BaseWidget                      Self;
+    typedef ProcessObject                   Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+    typedef cpExtensions::QT::SimpleMPRWidget TMPRWidget;
+
+  public:
+    itkTypeMacro( BaseWidget, ProcessObject );
+    cpPlugins_Id_Macro( Widgets::BaseWidget, Widgets );
+
+  public:
+    const TMPRWidget* GetMPRViewer( ) const;
+    const vtkRenderWindowInteractor*  GetSingleInteractor( ) const;
+
+    void SetMPRViewer( TMPRWidget* v );
+    void SetSingleInteractor( vtkRenderWindowInteractor* i );
+
+  protected:
+    BaseWidget( );
+    virtual ~BaseWidget( );
+
+  private:
+    // Purposely not implemented
+    BaseWidget( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    TMPRWidget*                m_MPRViewer;
+    vtkRenderWindowInteractor* m_SingleInteractor;
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__BASEWIDGET__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/CMakeLists.txt b/lib/cpPlugins/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8efbc6c
--- /dev/null
@@ -0,0 +1,133 @@
+## =============================
+## = Set names and directories =
+## =============================
+
+SET(lib_NAME cpPlugins)
+SET(lib_DIR  cpPlugins)
+
+## =========================
+## = Configure local files =
+## =========================
+
+CONFIGURE_FILE(
+  Config.h.in
+  ${PROJECT_BINARY_DIR}/lib/${lib_DIR}/Config.h
+  @ONLY
+  )
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB lib_HEADERS_H   "*.h")
+FILE(GLOB lib_HEADERS_HPP "*.hpp")
+FILE(GLOB lib_HEADERS_HXX "*.hxx")
+FILE(GLOB lib_SOURCES_C   "*.c")
+FILE(GLOB lib_SOURCES_CPP "*.cpp")
+FILE(GLOB lib_SOURCES_CXX "*.cxx")
+
+IF(USE_QT4)
+  SET(
+    lib_QT_UI
+    )
+  SET(
+    lib_QT_Headers
+    ParametersQtDialog.h
+    )
+  SET(
+    lib_QT_Sources
+    ParametersQtDialog.cxx
+    )
+  SET(
+    lib_QT_Resources
+    )
+
+  QT4_WRAP_UI(lib_QT_Wrapped_Headers ${lib_QT_UI})
+  QT4_WRAP_CPP(lib_QT_Wrapped_MOC_Sources ${lib_QT_Headers})
+  QT4_ADD_RESOURCES(lib_QT_Wrapped_Resources_Sources ${lib_QT_Resources})
+
+  SET(
+    lib_HEADERS_H
+    ${lib_HEADERS_H}
+    ${lib_QT_Wrapped_Headers}
+    )
+
+  SET(
+    lib_SOURCES_CXX
+    ${lib_SOURCES_CXX}
+    ${lib_QT_Sources}
+    ${lib_QT_Wrapped_Headers}
+    ${lib_QT_Wrapped_MOC_Sources}
+    ${lib_QT_Wrapped_Resources_Sources}
+    )
+
+ENDIF(USE_QT4)
+
+# ===================================
+# = Integrate all source file names =
+# ===================================
+
+SET(
+  lib_HEADERS
+  ${lib_HEADERS_H}
+  ${lib_HEADERS_HPP}
+  ${lib_HEADERS_HXX}
+  )
+
+SET(
+  lib_SOURCES
+  ${lib_SOURCES_C}
+  ${lib_SOURCES_CPP}
+  ${lib_SOURCES_CXX}
+  )
+
+SET(
+  target_LIBRARIES
+  cpPlugins_ITKInstances
+  ${VTK_LIBRARIES}
+  )
+IF(NOT WIN32)
+  SET(
+    target_LIBRARIES
+    ${target_LIBRARIES}
+    cpPlugins_tinyxml2
+    dl
+    )
+ENDIF(NOT WIN32)
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_LIBRARY(${lib_NAME} SHARED  ${lib_SOURCES})
+SET_TARGET_PROPERTIES(
+  ${lib_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${lib_NAME}
+  BASE_NAME ${lib_NAME}
+  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/${lib_DIR}/${lib_NAME}_Export.h
+  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+
+## ========================
+## == Installation rules ==
+## ========================
+
+INSTALL(
+  TARGETS ${lib_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+INSTALL(
+  FILES
+  ${lib_HEADERS}
+  DESTINATION include/${lib_DIR}
+  )
+
+## eof - $RCSfile$
diff --git a/lib/cpPlugins/Config.h.in b/lib/cpPlugins/Config.h.in
new file mode 100644 (file)
index 0000000..75ae331
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef __CPPLUGINS__CONFIG__H__
+#define __CPPLUGINS__CONFIG__H__
+
+#include <cpPlugins/cpPlugins_Export.h>
+#include <string>
+
+/*
+ * =========================================================================
+ * Version numbers and strings
+ * =========================================================================
+ */
+#define cpPlugins_MAJ_VER @prj_MAJ_VER@
+#define cpPlugins_MIN_VER @prj_MIN_VER@
+#define cpPlugins_REL_VER @prj_REL_VER@
+#define cpPlugins_VER     "@prj_VER@"
+#define cpPlugins_sVER    "@prj_sVER@"
+
+/*
+ * =========================================================================
+ * Some useful constants and values
+ * =========================================================================
+ */
+
+#define ITK_MANUAL_INSTANTIATION
+#define cpPlugins_CONFIG_FILE "plugins.cfg"
+
+#define cpPlugins_QT4_USED @QT4_FOUND@
+#if cpPlugins_QT4_USED == 1
+#  define cpPlugins_QT4
+#else // cpPlugins_QT4_USED == 1
+#  undef cpPlugins_QT4
+#endif // cpPlugins_QT4_USED == 1
+
+/*
+ * =========================================================================
+ * Identify OS
+ * =========================================================================
+ */
+#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+#  define cpPlugins_SYS_WINDOWS
+#  define cpPlugins_PLUGIN_PREFIX ""
+#  define cpPlugins_PLUGIN_EXT "dll"
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  ifndef NOMINMAX
+#    define NOMINMAX
+#  endif
+#elif defined( linux ) || defined( __linux )
+#  define cpPlugins_SYS_LINUX
+#  define cpPlugins_PLUGIN_PREFIX "lib"
+#  define cpPlugins_PLUGIN_EXT "so"
+#elif defined( __APPLE__ ) || defined( MACOSX ) || defined( macintosh ) || defined( Macintosh )
+#  define cpPlugins_SYS_MACOS
+#  define cpPlugins_PLUGIN_PREFIX "lib"
+#  define cpPlugins_PLUGIN_EXT "dylib"
+#elif defined( __FreeBSD__ ) || defined( __FreeBSD_kernel__ )
+#  define cpPlugins_SYS_FREEBSD
+#  define cpPlugins_PLUGIN_PREFIX "lib"
+#  define cpPlugins_PLUGIN_EXT "so"
+#else
+#  error "This operating system is not supported by cpPlugins"
+#endif
+
+/*
+ * =========================================================================
+ * Some macros
+ * =========================================================================
+ */
+#define cpPlugins_Id_Macro( N, C )                                      \
+  public:                                                               \
+  virtual const char* GetClassName( )     override { return( #N ); }    \
+  virtual const char* GetClassCategory( ) override { return( #C ); }
+
+/*
+ * =========================================================================
+ * Some functions
+ * =========================================================================
+ */
+namespace cpPlugins
+{
+  struct PathHelper
+  {
+    // ---------------------------------------------------------------------
+    inline bool operator()( char c ) const
+      {
+#ifdef cpPlugins_SYS_WINDOWS
+        return( c == '\\' || c == '/' );
+#else // cpPlugins_SYS_WINDOWS
+        return( c == '/' );
+#endif // cpPlugins_SYS_WINDOWS
+      }
+
+    // ---------------------------------------------------------------------
+    inline static std::string CanonicalPath( const std::string& path )
+      {
+#ifdef cpPlugins_SYS_WINDOWS
+        TCHAR  buffer[ 4096 ] = TEXT( "" );
+        TCHAR** lppPart = { NULL };
+        GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
+        return( std::string( buffer ) );
+#else // cpPlugins_SYS_WINDOWS
+        return( std::string( realpath( path.c_str( ), NULL ) ) );
+#endif // cpPlugins_SYS_WINDOWS
+      }
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__CONFIG__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/DataObject.cxx b/lib/cpPlugins/DataObject.cxx
new file mode 100644 (file)
index 0000000..06c10df
--- /dev/null
@@ -0,0 +1,81 @@
+#include <cpPlugins/DataObject.h>
+
+#include <cpPlugins/ProcessObject.h>
+#include <itkDataObject.h>
+#include <vtkImageData.h>
+#include <vtkPolyData.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::ProcessObject* cpPlugins::DataObject::
+GetSource( )
+{
+  return( this->m_Source );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::ProcessObject* cpPlugins::DataObject::
+GetSource( ) const
+{
+  return( this->m_Source );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObject::
+SetSource( cpPlugins::ProcessObject* src )
+{
+  if( this->m_Source != src )
+  {
+    this->m_Source = src;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObject::
+DisconnectFromPipeline( )
+{
+  // Disconnect input pipelines (ITK)
+  itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( );
+  if( itk_obj != NULL )
+    itk_obj->DisconnectPipeline( );
+
+  // Disconnect input pipelines (VTK)
+  vtkImageData* vtk_image = this->GetVTK< vtkImageData >( );
+  vtkPolyData* vtk_pd = this->GetVTK< vtkPolyData >( );
+  if( vtk_image != NULL )
+  {
+    vtkSmartPointer< vtkImageData > d =
+      vtkSmartPointer< vtkImageData >::New( );
+    d->ShallowCopy( vtk_image );
+    this->m_VTKObject = d;
+  }
+  else if( vtk_pd != NULL )
+  {
+    vtkSmartPointer< vtkPolyData > d =
+      vtkSmartPointer< vtkPolyData >::New( );
+    d->ShallowCopy( vtk_pd );
+    this->m_VTKObject = d;
+
+  } // fi
+
+  // Unbind source
+  this->m_Source = NULL;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObject::
+DataObject( )
+  : Superclass( ),
+    m_Source( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObject::
+~DataObject( )
+{
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/DataObject.h b/lib/cpPlugins/DataObject.h
new file mode 100644 (file)
index 0000000..279fe76
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef __CPPLUGINS__DATAOBJECT__H__
+#define __CPPLUGINS__DATAOBJECT__H__
+
+#include <cpPlugins/Object.h>
+
+namespace cpPlugins
+{
+  // Some forward declarations
+  class ProcessObject;
+
+  /**
+   */
+  class cpPlugins_EXPORT DataObject
+    : public Object
+  {
+  public:
+    typedef DataObject                      Self;
+    typedef Object                          Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( DataObject, Object );
+    cpPlugins_Id_Macro( DataObject, Object );
+
+  public:
+    ProcessObject* GetSource( );
+    const ProcessObject* GetSource( ) const;
+    void SetSource( ProcessObject* src );
+
+    void DisconnectFromPipeline( );
+
+  protected:
+    DataObject( );
+    virtual ~DataObject( );
+
+  private:
+    // Purposely not implemented
+    DataObject( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    ProcessObject* m_Source;
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__DATAOBJECT__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Image.cxx b/lib/cpPlugins/Image.cxx
new file mode 100644 (file)
index 0000000..ba3ff29
--- /dev/null
@@ -0,0 +1,41 @@
+#include <cpPlugins/Image.h>
+
+// -------------------------------------------------------------------------
+void cpPlugins::Image::
+SetITK( itk::LightObject* o )
+{
+  this->Superclass::SetITK( o );
+  bool     s = this->_ITK_2_VTK_0< 2 >( o );
+  if( !s ) s = this->_ITK_2_VTK_0< 3 >( o );
+  if( !s )
+  {
+    this->m_VTKObject = NULL;
+    this->m_ITKvVTK = NULL;
+
+  } // fi
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Image::
+SetVTK( vtkObjectBase* o )
+{
+  this->Superclass::SetVTK( o );
+  std::cerr << "Image: TODO this!!!!" << std::endl;
+  std::exit( 1 );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Image::
+Image( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Image::
+~Image( )
+{
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Image.h b/lib/cpPlugins/Image.h
new file mode 100644 (file)
index 0000000..fa7c7c3
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __CPPLUGINS__IMAGE__H__
+#define __CPPLUGINS__IMAGE__H__
+
+#include <cpPlugins/DataObject.h>
+
+#include <itkProcessObject.h>
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT Image
+    : public DataObject
+  {
+  public:
+    typedef Image      Self;
+    typedef DataObject Superclass;
+
+  public:
+    cpPlugins_Id_Macro( Image, Object );
+
+  public:
+    Image( );
+    virtual ~Image( );
+
+    virtual void SetITK( itk::LightObject* o ) override;
+    virtual void SetVTK( vtkObjectBase* o ) override;
+
+  protected:
+
+    template< unsigned int D >
+      inline bool _ITK_2_VTK_0( itk::LightObject* o );
+
+    template< class P, unsigned int D >
+      inline bool _ITK_2_VTK_1( itk::LightObject* o );
+
+    template< class I >
+      inline bool _ITK_2_VTK_2( itk::LightObject* o );
+
+  private:
+    // Purposely not implemented
+    Image( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    itk::ProcessObject::Pointer m_ITKvVTK;
+  };
+
+} // ecapseman
+
+#include <cpPlugins/Image.hxx>
+
+#endif // __CPPLUGINS__IMAGE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Image.hxx b/lib/cpPlugins/Image.hxx
new file mode 100644 (file)
index 0000000..dd6ef10
--- /dev/null
@@ -0,0 +1,149 @@
+#ifndef __CPPLUGINS__IMAGE__HXX__
+#define __CPPLUGINS__IMAGE__HXX__
+
+#include <cpPlugins_ITKInstances/Image.h>
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpPlugins::Image::
+_ITK_2_VTK_0( itk::LightObject* o )
+{
+  bool s = false;
+  if( dynamic_cast< itk::ImageBase< D >* >( o ) != NULL )
+  {
+    s |= this->_ITK_2_VTK_1< char, D >( o );
+    s |= this->_ITK_2_VTK_1< short, D >( o );
+    s |= this->_ITK_2_VTK_1< int, D >( o );
+    s |= this->_ITK_2_VTK_1< long, D >( o );
+    s |= this->_ITK_2_VTK_1< float, D >( o );
+    s |= this->_ITK_2_VTK_1< double, D >( o );
+    s |= this->_ITK_2_VTK_1< unsigned char, D >( o );
+    s |= this->_ITK_2_VTK_1< unsigned short, D >( o );
+    s |= this->_ITK_2_VTK_1< unsigned int, D >( o );
+    s |= this->_ITK_2_VTK_1< unsigned long, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< char >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< short >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< int >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< long >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< float >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< double >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< unsigned char >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< unsigned short >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< unsigned int >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBPixel< unsigned long >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< char >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< short >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< int >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< long >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< float >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< double >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< unsigned char >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< unsigned short >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< unsigned int >, D >( o );
+    s |= this->_ITK_2_VTK_1< itk::RGBAPixel< unsigned long >, D >( o );
+    /* TODO
+       s |= this->_ITK_2_VTK_1< itk::DiffusionTensor3D< float >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::DiffusionTensor3D< double >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::Vector< float, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::Vector< double, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::CovariantVector< float, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::CovariantVector< double, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::Point< float, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::Point< double, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::SymmetricSecondRankTensor< float, D >, D >( o );
+       s |= this->_ITK_2_VTK_1< itk::SymmetricSecondRankTensor< double, D >, D >( o );
+    */
+
+  } // fi
+  return( s );
+}
+
+// -------------------------------------------------------------------------
+template< class P, unsigned int D >
+bool cpPlugins::Image::
+_ITK_2_VTK_1( itk::LightObject* o )
+{
+  if( dynamic_cast< itk::Image< P, D >* >( o ) != NULL )
+    return( this->_ITK_2_VTK_2< itk::Image< P, D > >( o ) );
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+bool cpPlugins::Image::
+_ITK_2_VTK_2( itk::LightObject* o )
+{
+  typedef itk::ImageToVTKImageFilter< I > _I2V;
+
+  I* image = dynamic_cast< I* >( o );
+  if( image != NULL )
+  {
+    _I2V* f = dynamic_cast< _I2V* >( this->m_ITKvVTK.GetPointer( ) );
+    if( f == NULL )
+    {
+      typename _I2V::Pointer nf = _I2V::New( );
+      this->m_ITKvVTK = nf;
+      f = nf.GetPointer( );
+
+    } // fi
+    f->SetInput( image );
+    f->Update( );
+
+    // Keep object track
+    this->m_ITKObject = o;
+    this->m_VTKObject = f->GetOutput( );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+/*
+ * =========================================================================
+ * Demangle macros
+ * =========================================================================
+ */
+#define cpPlugin_Image_Demangle_Dim( FUNC, INPUT, D )   \
+  this->FUNC( INPUT->GetITK< itk::ImageBase< D > >( ) )
+
+#define cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, PIXEL, D )      \
+  this->FUNC( dynamic_cast< itk::Image< PIXEL, D >* >( INPUT ) )
+
+#define cpPlugin_Image_Demangle_Pixel_AllScalars( r, FUNC, INPUT, D )   \
+  r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, char, D );        \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, short, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, int, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, long, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, float, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, double, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, unsigned char, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, unsigned short, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, unsigned int, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, unsigned long, D )
+
+#define cpPlugin_Image_Demangle_Pixel_AllColor( r, FUNC, INPUT, D )     \
+  r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< char >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< short >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< int >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< long >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< float >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< double >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< unsigned char >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< unsigned short >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< unsigned int >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBPixel< unsigned long >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< char >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< short >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< int >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< long >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< float >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< double >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< unsigned char >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< unsigned short >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< unsigned int >, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< unsigned long >, D )
+
+#endif // __CPPLUGINS__IMAGE__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface.cxx b/lib/cpPlugins/Interface.cxx
new file mode 100644 (file)
index 0000000..de6d631
--- /dev/null
@@ -0,0 +1,157 @@
+#include <cpPlugins/Interface.h>
+
+#include <map>
+#include <set>
+#include <string>
+
+#ifdef cpPlugins_SYS_WINDOWS
+#else // cpPlugins_SYS_WINDOWS
+#  include <dlfcn.h>
+#endif // cpPlugins_SYS_WINDOWS
+
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+Interface( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+~Interface( )
+{
+  this->UnloadAll( );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Interface::
+TFilters& cpPlugins::Interface::
+GetFilters( )
+{
+  return( this->m_Filters );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::
+LoadPluginFile( const std::string& filename )
+{
+  auto canonical_fn = cpPlugins::PathHelper::CanonicalPath( filename );
+  void* hnd = NULL;
+  std::map< std::string, std::set< std::string > > filters;
+#ifdef cpPlugins_SYS_WINDOWS
+  // TODO:
+#else // cpPlugins_SYS_WINDOWS
+
+  // Try to load canonical filename and clean error messages
+  hnd = dlopen( canonical_fn.c_str( ), RTLD_NOW | RTLD_GLOBAL );
+  if( hnd == NULL )
+    throw std::runtime_error(
+      std::string( "cpPlugins::Interface: Could not load library \"" ) +
+      canonical_fn +
+      std::string( "\"" )
+      );
+  dlerror( );
+
+  // Init plugins
+  typedef const std::map< std::string, std::set< std::string > > ( *func_t )( );
+  auto func = ( func_t ) dlsym( hnd, "LoadedFilters" );
+  const char* func_error = dlerror( );
+  if( func_error != NULL )
+  {
+    dlclose( hnd );
+    throw std::runtime_error(
+      std::string( "cpPlugins::Interface: Library \"" ) +
+      canonical_fn +
+      std::string( "\" not recognized as a cpPlugins library." )
+      );
+
+  } // fi
+  filters = func( );
+#endif // cpPlugins_SYS_WINDOWS
+  if( hnd != NULL )
+  {
+    // Save the loaded filters names
+    for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
+    {
+      auto colIt = this->m_Filters.find( cIt->first );
+      for( auto fIt = cIt->second.begin( ); fIt != cIt->second.end( ); ++fIt )
+      {
+        bool found = false;
+        if( colIt != this->m_Filters.end( ) )
+        {
+          auto rowIt = colIt->second.find( *fIt );
+          if( rowIt != colIt->second.end( ) )
+            found = true;
+
+        } // fi
+        if( !found )
+          this->m_Filters[ cIt->first ][ *fIt ] = canonical_fn;
+
+      } // rof
+
+    } // rof
+
+    // Save the hnd
+    this->m_Plugins[ canonical_fn ] = hnd;
+  }
+  else
+    throw std::runtime_error(
+      "cpPlugins::Interface: Operative system not yet supported."
+      );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::
+UnloadAll( )
+{
+  auto pIt = this->m_Plugins.begin( );
+  for( ; pIt != this->m_Plugins.end( ); ++pIt )
+  {
+#ifdef cpPlugins_SYS_WINDOWS
+#else // cpPlugins_SYS_WINDOWS
+    dlclose( pIt->second );
+#endif // cpPlugins_SYS_WINDOWS
+  } // rof
+  this->m_Plugins.clear( );
+  this->m_Filters.clear( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ProcessObject::Pointer cpPlugins::Interface::
+Create( const std::string& category, const std::string& name )
+{
+  cpPlugins::ProcessObject::Pointer filter;
+  auto cIt = this->m_Filters.find( category );
+  if( cIt != this->m_Filters.end( ) )
+  {
+    auto nIt = cIt->second.find( name );
+    if( nIt != cIt->second.end( ) )
+    {
+      auto pIt = this->m_Plugins.find( nIt->second );
+      if( pIt != this->m_Plugins.end( ) )
+      {
+#ifdef cpPlugins_SYS_WINDOWS
+#else // cpPlugins_SYS_WINDOWS
+        std::string func_name = category + "_" + name;
+        typedef cpPlugins::ProcessObject::Pointer ( *func_t )( );
+        auto func = ( func_t ) dlsym( pIt->second, func_name.c_str( ) );
+        if( func == NULL )
+        {
+          throw std::runtime_error(
+            std::string( "cpPlugins::Interface: Class \"" ) +
+            category + std::string( ":" ) + name +
+            std::string( "\" does not have a valid creator function." )
+            );
+
+        } // fi
+        filter = func( );
+#endif // cpPlugins_SYS_WINDOWS
+      } // fi
+
+    } // fi
+
+  } // fi
+  return( filter );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface.h b/lib/cpPlugins/Interface.h
new file mode 100644 (file)
index 0000000..7c860db
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef __CPPLUGINS__INTERFACE__H__
+#define __CPPLUGINS__INTERFACE__H__
+
+#include <cpPlugins/Config.h>
+#include <cpPlugins/ProcessObject.h>
+#include <map>
+#include <string>
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT Interface
+  {
+  public:
+    typedef std::map< std::string, std::string > TStringRow;
+    typedef std::map< std::string, TStringRow >  TFilters;
+
+  public:
+    Interface( );
+    virtual ~Interface( );
+
+    const TFilters& GetFilters( );
+
+    void LoadPluginFile( const std::string& filename );
+    void UnloadAll( );
+
+    cpPlugins::ProcessObject::Pointer Create(
+      const std::string& category, const std::string& name
+      );
+
+  protected:
+    std::map< std::string, void* > m_Plugins;
+    TFilters m_Filters;
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Object.cxx b/lib/cpPlugins/Object.cxx
new file mode 100644 (file)
index 0000000..a6615b4
--- /dev/null
@@ -0,0 +1,116 @@
+#include <cpPlugins/Object.h>
+
+#include <itkObject.h>
+#include <vtkObject.h>
+
+// -------------------------------------------------------------------------
+const float& cpPlugins::Object::
+GetViewX( ) const
+{
+  return( this->m_ViewX );
+}
+
+// -------------------------------------------------------------------------
+const float& cpPlugins::Object::
+GetViewY( ) const
+{
+  return( this->m_ViewY );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Object::
+SetViewCoords( float x, float y )
+{
+  this->m_ViewX = x;
+  this->m_ViewY = y;
+  // WARNING: do not call "this->Modified( )" -> It could lead to a
+  //          re-execution of all pipeline
+}
+
+#ifdef cpPlugins_QT4
+// -------------------------------------------------------------------------
+void cpPlugins::Object::
+SetViewCoords( const QPointF& coords )
+{
+  this->SetViewCoords( coords.x( ), coords.y( ) );
+}
+
+// -------------------------------------------------------------------------
+QPointF cpPlugins::Object::
+GetViewCoords( ) const
+{
+  return( QPointF( this->m_ViewX, this->m_ViewY ) );
+}
+#endif // cpPlugins_QT4
+
+// -------------------------------------------------------------------------
+void cpPlugins::Object::
+Modified( ) const
+{
+  const itk::Object* i = this->GetITK< itk::Object >( );
+  vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
+  if( i != NULL ) i->Modified( );
+  if( v != NULL ) v->Modified( );
+}
+
+// -------------------------------------------------------------------------
+itk::ModifiedTimeType cpPlugins::Object::
+GetMTime( ) const
+{
+  const itk::Object* i = this->GetITK< itk::Object >( );
+  vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
+  if( i != NULL && v == NULL )
+    return( i->GetMTime( ) );
+  else if( i == NULL && v != NULL )
+    return( v->GetMTime( ) );
+  else if( i != NULL && v != NULL )
+  {
+    auto iTime = i->GetMTime( );
+    auto vTime = i->GetMTime( );
+    return( itk::ModifiedTimeType( ( iTime < vTime )? iTime: vTime ) );
+  }
+  else
+    return( this->Superclass::GetMTime( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Object::
+SetITK( itk::LightObject* o )
+{
+  if( this->m_ITKObject.GetPointer( ) != o )
+  {
+    this->m_ITKObject = o;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Object::
+SetVTK( vtkObjectBase* o )
+{
+  if( this->m_VTKObject.GetPointer( ) != o )
+  {
+    this->m_VTKObject = o;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Object::
+Object( )
+  : m_ITKObject( NULL ),
+    m_VTKObject( NULL ),
+    m_ViewX( float( 0 ) ),
+    m_ViewY( float( 0 ) )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Object::
+~Object( )
+{
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Object.h b/lib/cpPlugins/Object.h
new file mode 100644 (file)
index 0000000..881edde
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef __CPPLUGINS__OBJECT__H__
+#define __CPPLUGINS__OBJECT__H__
+
+#include <cpPlugins/Config.h>
+
+#include <string>
+#include <itkLightObject.h>
+#include <itkObject.h>
+#include <itkObjectFactory.h>
+#include <vtkSmartPointer.h>
+#include <vtkObjectBase.h>
+#ifdef cpPlugins_QT4
+#  include <QPointF>
+#endif // cpPlugins_QT4
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT Object
+    : public itk::Object
+  {
+  public:
+    typedef Object                          Self;
+    typedef itk::Object                     Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkTypeMacro( Object, itk::Object );
+
+  public:
+    virtual const char* GetClassName( ) = 0;
+    virtual const char* GetClassCategory( ) = 0;
+
+    const float& GetViewX( ) const;
+    const float& GetViewY( ) const;
+    void SetViewCoords( float x, float y );
+
+#ifdef cpPlugins_QT4
+    void SetViewCoords( const QPointF& coords );
+    QPointF GetViewCoords( ) const;
+#endif // cpPlugins_QT4
+
+    virtual void Modified( ) const override;
+    virtual itk::ModifiedTimeType GetMTime( ) const override;
+
+    virtual void SetITK( itk::LightObject* o );
+    virtual void SetVTK( vtkObjectBase* o );
+
+    template< class T >
+      inline T* GetITK( );
+
+    template< class T >
+      inline const T* GetITK( ) const;
+
+    template< class T >
+      inline T* GetVTK( );
+
+    template< class T >
+      inline const T* GetVTK( ) const;
+
+  protected:
+    Object( );
+    virtual ~Object( );
+
+  private:
+    // Purposely not implemented
+    Object( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    itk::LightObject::Pointer        m_ITKObject;
+    vtkSmartPointer< vtkObjectBase > m_VTKObject;
+
+    float m_ViewX;
+    float m_ViewY;
+  };
+
+} // ecapseman
+
+#include <cpPlugins/Object.hxx>
+
+#endif // __CPPLUGINS__OBJECT__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Object.hxx b/lib/cpPlugins/Object.hxx
new file mode 100644 (file)
index 0000000..4e3f873
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef __CPPLUGINS__OBJECT__HXX__
+#define __CPPLUGINS__OBJECT__HXX__
+
+// -------------------------------------------------------------------------
+template< class T >
+T* cpPlugins::Object::
+GetITK( )
+{
+  return( dynamic_cast< T* >( this->m_ITKObject.GetPointer( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+const T* cpPlugins::Object::
+GetITK( ) const
+{
+  return( dynamic_cast< const T* >( this->m_ITKObject.GetPointer( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+T* cpPlugins::Object::
+GetVTK( )
+{
+  return( dynamic_cast< T* >( this->m_VTKObject.GetPointer( ) ) );
+}
+
+// -------------------------------------------------------------------------
+template< class T >
+const T* cpPlugins::Object::
+GetVTK( ) const
+{
+  return( dynamic_cast< const T* >( this->m_VTKObject.GetPointer( ) ) );
+}
+
+#endif // __CPPLUGINS__OBJECT__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Parameters.cxx b/lib/cpPlugins/Parameters.cxx
new file mode 100644 (file)
index 0000000..c805327
--- /dev/null
@@ -0,0 +1,348 @@
+#include <cpPlugins/Parameters.h>
+#include <tinyxml/tinyxml2.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::Parameters::
+Parameters( )
+{
+  this->Clear( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Parameters::
+~Parameters( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Parameters::
+Modified( ) const
+{
+  this->m_TimeStamp.Modified( );
+}
+
+// -------------------------------------------------------------------------
+itk::ModifiedTimeType cpPlugins::Parameters::
+GetMTime( ) const
+{
+  return( this->m_TimeStamp.GetMTime( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Parameters::
+Clear( )
+{
+  this->m_Parameters.clear( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Parameters::
+GetNames( std::vector< std::string >& container ) const
+{
+  container.clear( );
+  TParameters::const_iterator i = this->m_Parameters.begin( );
+  for( ; i != this->m_Parameters.end( ); ++i )
+    container.push_back( i->first );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Parameters::
+Type cpPlugins::Parameters::
+GetType( const std::string& name ) const
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+    return( i->second.first );
+  else
+    return( Self::NoType );
+}
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Parameters_TypeAsString( Y )  \
+  if( i->second.first == Self::Y )              \
+    return( #Y )
+
+std::string cpPlugins::Parameters::
+GetTypeAsString( const std::string& name ) const
+{
+  auto i = this->m_Parameters.find( name );
+  cpPlugins_Parameters_TypeAsString( String );
+  else cpPlugins_Parameters_TypeAsString( Bool );
+  else cpPlugins_Parameters_TypeAsString( Int );
+  else cpPlugins_Parameters_TypeAsString( Uint );
+  else cpPlugins_Parameters_TypeAsString( Real );
+  else cpPlugins_Parameters_TypeAsString( OpenFileName );
+  else cpPlugins_Parameters_TypeAsString( SaveFileName );
+  else cpPlugins_Parameters_TypeAsString( PathName );
+  else cpPlugins_Parameters_TypeAsString( StringList );
+  else cpPlugins_Parameters_TypeAsString( BoolList );
+  else cpPlugins_Parameters_TypeAsString( IntList );
+  else cpPlugins_Parameters_TypeAsString( UintList );
+  else cpPlugins_Parameters_TypeAsString( RealList );
+  else cpPlugins_Parameters_TypeAsString( OpenFileNameList );
+  else cpPlugins_Parameters_TypeAsString( SaveFileNameList );
+  else cpPlugins_Parameters_TypeAsString( PathNameList );
+  else cpPlugins_Parameters_TypeAsString( Choices );
+  else return( "NoType" );
+}
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Parameters_TypeFromString( Y, str )   \
+  if( str == std::string( #Y ) )                        \
+    return( Self::Y )
+
+cpPlugins::Parameters::
+Type cpPlugins::Parameters::
+GetTypeFromString( const std::string& t )
+{
+  cpPlugins_Parameters_TypeFromString( String, t );
+  else cpPlugins_Parameters_TypeFromString( Bool, t );
+  else cpPlugins_Parameters_TypeFromString( Int, t );
+  else cpPlugins_Parameters_TypeFromString( Uint, t );
+  else cpPlugins_Parameters_TypeFromString( Real, t );
+  else cpPlugins_Parameters_TypeFromString( OpenFileName, t );
+  else cpPlugins_Parameters_TypeFromString( SaveFileName, t );
+  else cpPlugins_Parameters_TypeFromString( PathName, t );
+  else cpPlugins_Parameters_TypeFromString( StringList, t );
+  else cpPlugins_Parameters_TypeFromString( BoolList, t );
+  else cpPlugins_Parameters_TypeFromString( IntList, t );
+  else cpPlugins_Parameters_TypeFromString( UintList, t );
+  else cpPlugins_Parameters_TypeFromString( RealList, t );
+  else cpPlugins_Parameters_TypeFromString( OpenFileNameList, t );
+  else cpPlugins_Parameters_TypeFromString( SaveFileNameList, t );
+  else cpPlugins_Parameters_TypeFromString( PathNameList, t );
+  else cpPlugins_Parameters_TypeFromString( Choices, t );
+  else return( Self::NoType );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Parameters::
+GetString( const std::string& name, bool force ) const
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == Self::String || force )
+      return( i->second.second );
+    else
+      return( "" );
+  }
+  else
+    return( "" );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Parameters::
+SetString( const std::string& name, const std::string& v, bool force )
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == Self::String || force )
+    {
+      if( i->second.second != v )
+      {
+        i->second.second = v;
+        this->Modified( );
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Parameters::
+ConfigureAsChoices(
+  const std::string& name, const std::vector< std::string >& choices
+  )
+{
+  // It is invalid not to give choices when configuring
+  if( choices.size( ) == 0 )
+    return;
+
+  std::stringstream str_choices;
+  str_choices << choices[ 0 ];
+  for( unsigned int i = 1; i < choices.size( ); ++i )
+    str_choices << "#" << choices[ i ];
+  str_choices << "@";
+  this->m_Parameters[ name ] =
+    TParameter( Self::Choices, str_choices.str( ) );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+std::vector< std::string > cpPlugins::Parameters::
+GetChoices( const std::string& name ) const
+{
+  std::vector< std::string > choices;
+
+  TParameters::const_iterator i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == Self::Choices )
+    {
+      std::istringstream str_choices( i->second.second );
+      std::string real_choices;
+      std::getline( str_choices, real_choices, '@' );
+      std::istringstream str( real_choices );
+      std::string token;
+      while( std::getline( str, token, '#' ) )
+        choices.push_back( token );
+
+    } // fi
+
+  } // fi
+  return( choices );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Parameters::
+GetSelectedChoice( const std::string& name ) const
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == Self::Choices )
+    {
+      std::istringstream str_choices( i->second.second );
+      std::string real_choice;
+      std::getline( str_choices, real_choice, '@' );
+      std::getline( str_choices, real_choice, '@' );
+      return( real_choice );
+    }
+    else
+      return( "" );
+  }
+  else
+    return( "" );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Parameters::
+SetSelectedChoice( const std::string& name, const std::string& choice )
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    if( i->second.first == Self::Choices )
+    {
+      std::istringstream str_choices( i->second.second );
+      std::string choices;
+      std::getline( str_choices, choices, '@' );
+      if( choices.find( choice ) != std::string::npos )
+      {
+        std::stringstream new_choices;
+        new_choices << choices << "@" << choice;
+        i->second.second = new_choices.str( );
+        this->Modified( );
+        return( true );
+      }
+      else
+        return( false );
+    }
+    else
+      return( false );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Parameters::
+GetAcceptedFileExtensions( const std::string& name ) const
+{
+  auto i = this->m_AcceptedFileExtensions.find( name );
+  if( i != this->m_AcceptedFileExtensions.end( ) )
+    return( i->second );
+  else
+    return( "" );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Parameters::
+SetAcceptedFileExtensions(
+  const std::string& name, const std::string& extensions
+  )
+{
+  auto i = this->m_Parameters.find( name );
+  if( i != this->m_Parameters.end( ) )
+  {
+    bool is_valid = ( i->second.first == Self::OpenFileName );
+    is_valid     |= ( i->second.first == Self::SaveFileName );
+    is_valid     |= ( i->second.first == Self::OpenFileNameList );
+    is_valid     |= ( i->second.first == Self::SaveFileNameList );
+    if( is_valid )
+      this->m_AcceptedFileExtensions[ name ] = extensions;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Parameters::
+ToXML(
+  tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* parent_elem
+  ) const
+{
+  if( parent_elem == NULL )
+    return( false );
+
+  auto pIt = this->m_Parameters.begin( );
+  for( ; pIt != this->m_Parameters.end( ); ++pIt )
+  {
+    tinyxml2::XMLElement* p = doc->NewElement( "parameter" );
+    p->SetAttribute( "name", pIt->first.c_str( ) );
+    p->SetAttribute( "value", pIt->second.second.c_str( ) );
+    p->SetAttribute( "type", this->GetTypeAsString( pIt->first ).c_str( ) );
+    parent_elem->InsertEndChild( p );
+
+  } // rof
+  return( true );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Parameters::
+FromXML( const tinyxml2::XMLElement* filter_elem )
+{
+  const tinyxml2::XMLElement* param =
+    filter_elem->FirstChildElement( "parameter" );
+  bool ret = false;
+  while( param != NULL )
+  {
+    const char* param_name = param->Attribute( "name" );
+    const char* param_type = param->Attribute( "type" );
+    if( param_name != NULL && param_type != NULL )
+    {
+      TParameter value;
+      value.second = param->Attribute( "value" );
+      value.first = Self::GetTypeFromString( param_type );
+      this->m_Parameters[ param_name ] = value;
+
+    } // fi
+    param = param->NextSiblingElement( "parameter" );
+    ret = true;
+
+  } // elihw
+  this->Modified( );
+  return( ret );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Parameters::
+TParameters& cpPlugins::Parameters::
+GetRawParameters( )
+{
+  return( this->m_Parameters );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Parameters::
+TParameters& cpPlugins::Parameters::
+GetRawParameters( ) const
+{
+  return( this->m_Parameters );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Parameters.h b/lib/cpPlugins/Parameters.h
new file mode 100644 (file)
index 0000000..5393d03
--- /dev/null
@@ -0,0 +1,308 @@
+#ifndef __CPPLUGINS__PARAMETERS__H__
+#define __CPPLUGINS__PARAMETERS__H__
+
+#include <cpPlugins/Config.h>
+
+#include <typeinfo>
+#include <map>
+#include <ostream>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <itkTimeStamp.h>
+
+// Some forward declarations
+namespace tinyxml2
+{
+  class XMLElement;
+  class XMLDocument;
+}
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Parameters_Configure( Y )                     \
+  void ConfigureAs##Y( const std::string& name )                \
+  {                                                             \
+    this->m_Parameters[ name ] = TParameter( Self::Y, "" );     \
+    this->Modified( );                                          \
+  }                                                             \
+  bool Has##Y( const std::string& name ) const                  \
+  {                                                             \
+    auto i = this->m_Parameters.find( name );                   \
+    if( i != this->m_Parameters.end( ) )                        \
+      return( i->second.first == Self::Y );                     \
+    else                                                        \
+      return( false );                                          \
+  }
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Parameters_GetSet( Y )                        \
+  T##Y Get##Y( const std::string& name ) const                  \
+  {                                                             \
+    auto i = this->m_Parameters.find( name );                   \
+    if( i != this->m_Parameters.end( ) )                        \
+    {                                                           \
+      if( i->second.first == Self::Y )                          \
+      {                                                         \
+        if( typeid( T##Y ) != typeid( std::string ) )           \
+        {                                                       \
+          std::istringstream tok_str( i->second.second );       \
+          T##Y v;                                               \
+          tok_str >> v;                                         \
+          return( v );                                          \
+        }                                                       \
+        else                                                    \
+        {                                                       \
+          const T##Y* ptr =                                     \
+            reinterpret_cast< const T##Y* >(                    \
+              &( i->second.second )                             \
+              );                                                \
+          return( *ptr );                                       \
+        }                                                       \
+      }                                                         \
+    }                                                           \
+    return( T##Y( 0 ) );                                        \
+  }                                                             \
+  void Set##Y( const std::string& name, const T##Y& v )         \
+  {                                                             \
+    auto i = this->m_Parameters.find( name );                   \
+    if( i != this->m_Parameters.end( ) )                        \
+    {                                                           \
+      if( i->second.first == Self::Y )                          \
+      {                                                         \
+        if( typeid( T##Y ) != typeid( std::string ) )           \
+        {                                                       \
+          std::stringstream str;                                \
+          str << v;                                             \
+          if( i->second.second != str.str( ) )                  \
+          {                                                     \
+            i->second.second = str.str( );                      \
+            this->Modified( );                                  \
+          }                                                     \
+        }                                                       \
+        else                                                    \
+        {                                                       \
+          const std::string* str =                              \
+            reinterpret_cast< const std::string* >( &v );       \
+          if( i->second.second != *str )                        \
+          {                                                     \
+            i->second.second = *str;                            \
+            this->Modified( );                                  \
+          }                                                     \
+        }                                                       \
+      }                                                         \
+    }                                                           \
+  }
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Parameters_GetSetList( Y )                            \
+  std::vector< T##Y > Get##Y##List( const std::string& name ) const     \
+  {                                                                     \
+    std::vector< T##Y > lst;                                            \
+    std::vector< std::string >* slst =                                  \
+      reinterpret_cast< std::vector< std::string >* >( &lst );          \
+    auto i = this->m_Parameters.find( name );                           \
+    if( i != this->m_Parameters.end( ) )                                \
+    {                                                                   \
+      if( i->second.first == Self::Y##List )                            \
+      {                                                                 \
+        std::istringstream str( i->second.second );                     \
+        std::string token;                                              \
+        while( std::getline( str, token, '#' ) )                        \
+        {                                                               \
+          if( typeid( T##Y ) != typeid( std::string ) )                 \
+          {                                                             \
+            std::istringstream tok_str( token );                        \
+            T##Y v;                                                     \
+            tok_str >> v;                                               \
+            lst.push_back( v );                                         \
+          }                                                             \
+          else                                                          \
+            slst->push_back( token );                                   \
+        }                                                               \
+      }                                                                 \
+    }                                                                   \
+    return( lst );                                                      \
+  }                                                                     \
+  void AddTo##Y##List( const std::string& name, const T##Y& v )         \
+  {                                                                     \
+    auto i = this->m_Parameters.find( name );                           \
+    if( i != this->m_Parameters.end( ) )                                \
+    {                                                                   \
+      if( i->second.first == Self::Y##List )                            \
+      {                                                                 \
+        std::stringstream str;                                          \
+        if( i->second.second != "" )                                    \
+          str << i->second.second << "#";                               \
+        str << v;                                                       \
+        i->second.second = str.str( );                                  \
+        this->Modified( );                                              \
+      }                                                                 \
+    }                                                                   \
+  }                                                                     \
+  void Clear##Y##List( const std::string& name )                        \
+  {                                                                     \
+    auto i = this->m_Parameters.find( name );                           \
+    if( i != this->m_Parameters.end( ) )                                \
+    {                                                                   \
+      if( i->second.first == Self::Y##List )                            \
+      {                                                                 \
+        if( i->second.second != "" )                                    \
+        {                                                               \
+          i->second.second = "";                                        \
+          this->Modified( );                                            \
+        }                                                               \
+      }                                                                 \
+    }                                                                   \
+  }
+
+namespace cpPlugins
+{
+  // Forward declaration to improve Qt dialog execution
+  class ParametersQtDialog;
+
+  /**
+   */
+  class cpPlugins_EXPORT Parameters
+  {
+    // Frienship with forward declaration to improve Qt dialog execution
+    friend class ParametersQtDialog;
+    friend std::ostream& operator<<( std::ostream& o, const Parameters& p )
+    {
+      for(
+        auto i = p.m_Parameters.begin( );
+        i != p.m_Parameters.end( );
+        ++i
+        )
+        o << i->first << ": ("
+          << i->second.first << " | "
+          << i->second.second << ")"
+          << std::endl;
+      return( o );
+    }
+
+  public:
+    typedef Parameters Self;
+
+    enum Type
+    {
+      String       , Bool             , Int              ,
+      Uint         , Real             , OpenFileName     ,
+      SaveFileName , PathName         , StringList       ,
+      BoolList     , IntList          , UintList         ,
+      RealList     , OpenFileNameList , SaveFileNameList ,
+      PathNameList , Choices          , NoType
+    };
+
+    typedef bool          TBool;
+    typedef long          TInt;
+    typedef unsigned long TUint;
+    typedef double        TReal;
+    typedef std::string   TString;
+    typedef std::string   TOpenFileName;
+    typedef std::string   TSaveFileName;
+    typedef std::string   TPathName;
+
+    typedef std::pair< Self::Type, std::string > TParameter;
+    typedef std::map< std::string, TParameter >  TParameters;
+
+  public:
+    cpPlugins_Parameters_Configure( String );
+    cpPlugins_Parameters_Configure( Bool );
+    cpPlugins_Parameters_Configure( Int );
+    cpPlugins_Parameters_Configure( Uint );
+    cpPlugins_Parameters_Configure( Real );
+    cpPlugins_Parameters_Configure( OpenFileName );
+    cpPlugins_Parameters_Configure( SaveFileName );
+    cpPlugins_Parameters_Configure( PathName );
+    cpPlugins_Parameters_Configure( StringList );
+    cpPlugins_Parameters_Configure( BoolList );
+    cpPlugins_Parameters_Configure( IntList );
+    cpPlugins_Parameters_Configure( UintList );
+    cpPlugins_Parameters_Configure( RealList );
+    cpPlugins_Parameters_Configure( OpenFileNameList );
+    cpPlugins_Parameters_Configure( SaveFileNameList );
+    cpPlugins_Parameters_Configure( PathNameList );
+    cpPlugins_Parameters_Configure( Choices );
+
+    cpPlugins_Parameters_GetSet( Bool );
+    cpPlugins_Parameters_GetSet( Int );
+    cpPlugins_Parameters_GetSet( Uint );
+    cpPlugins_Parameters_GetSet( Real );
+    cpPlugins_Parameters_GetSet( OpenFileName );
+    cpPlugins_Parameters_GetSet( SaveFileName );
+    cpPlugins_Parameters_GetSet( PathName );
+
+    cpPlugins_Parameters_GetSetList( String );
+    cpPlugins_Parameters_GetSetList( Bool );
+    cpPlugins_Parameters_GetSetList( Int );
+    cpPlugins_Parameters_GetSetList( Uint );
+    cpPlugins_Parameters_GetSetList( Real );
+    cpPlugins_Parameters_GetSetList( OpenFileName );
+    cpPlugins_Parameters_GetSetList( SaveFileName );
+    cpPlugins_Parameters_GetSetList( PathName );
+
+  public:
+    Parameters( );
+    virtual ~Parameters( );
+
+    virtual void Modified( ) const;
+    virtual itk::ModifiedTimeType GetMTime( ) const;
+
+    // Parameters container configuration
+    void Clear( );
+
+    // Get methods
+    void GetNames( std::vector< std::string >& container ) const;
+    Type GetType( const std::string& name ) const;
+    std::string GetTypeAsString( const std::string& name ) const;
+    static Type GetTypeFromString( const std::string& t );
+
+    // Base string methods
+    std::string GetString(
+      const std::string& name, bool force = true
+      ) const;
+    void SetString(
+      const std::string& name, const std::string& v, bool force = true
+      );
+
+    void ConfigureAsChoices(
+      const std::string& name, const std::vector< std::string >& choices
+      );
+    std::vector< std::string > GetChoices( const std::string& name ) const;
+    std::string GetSelectedChoice( const std::string& name ) const;
+    bool SetSelectedChoice(
+      const std::string& name, const std::string& choice
+      );
+
+    std::string GetAcceptedFileExtensions( const std::string& name ) const;
+    void SetAcceptedFileExtensions(
+      const std::string& name, const std::string& extensions
+      );
+
+    // XML "streaming"
+    bool ToXML(
+      tinyxml2::XMLDocument* doc,
+      tinyxml2::XMLElement* parent_elem
+      ) const;
+    bool FromXML( const tinyxml2::XMLElement* filter_elem );
+
+  protected:
+    TParameters& GetRawParameters( );
+    const TParameters& GetRawParameters( ) const;
+
+  private:
+    // Purposely not implemented
+    Parameters( const Self& other );
+    Self& operator=( const Self& other );
+
+  protected:
+    mutable itk::TimeStamp               m_TimeStamp;
+    TParameters                          m_Parameters;
+    std::map< std::string, std::string > m_AcceptedFileExtensions;
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__PARAMETERS__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/ParametersQtDialog.cxx b/lib/cpPlugins/ParametersQtDialog.cxx
new file mode 100644 (file)
index 0000000..09e30fe
--- /dev/null
@@ -0,0 +1,858 @@
+#include <cpPlugins/ParametersQtDialog.h>
+
+#ifdef cpPlugins_QT4
+
+#include <limits>
+
+#include <cpPlugins/ProcessObject.h>
+
+#include <QCheckBox>
+#include <QComboBox>
+#include <QDoubleSpinBox>
+#include <QFileDialog>
+#include <QHBoxLayout>
+#include <QInputDialog>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QWidget>
+
+// -------------------------------------------------------------------------
+cpPlugins::ParametersQtDialog::
+ParametersQtDialog( QWidget* parent, Qt::WindowFlags f )
+  : QDialog( parent, f ),
+    m_ProcessObject( NULL ),
+    m_WidgetsUpdated( false )
+{
+  this->m_Title = new QLabel( this );
+  this->m_Title->setText( "Parameters dialog title" );
+
+  this->m_MainLayout = new QGridLayout( this );
+  this->m_ToolsLayout = new QVBoxLayout( );
+  this->m_ToolsLayout->addWidget( this->m_Title );
+  this->m_MainLayout->addLayout( this->m_ToolsLayout, 0, 0, 1, 1 );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ParametersQtDialog::
+~ParametersQtDialog( )
+{
+  delete this->m_Title;
+  delete this->m_ToolsLayout;
+  delete this->m_MainLayout;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::
+ProcessObject* cpPlugins::ParametersQtDialog::
+getProcessObject( ) const
+{
+  return( this->m_ProcessObject );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::ParametersQtDialog::
+setProcessObject( ProcessObject* obj )
+{
+  if( this->m_ProcessObject != NULL || obj == NULL )
+    return( false );
+  this->m_ProcessObject = obj;
+  this->m_WidgetsUpdated = false;
+  return( true );
+}
+
+// -------------------------------------------------------------------------
+int cpPlugins::ParametersQtDialog::
+exec( )
+{
+  this->_updateWidgets( );
+  this->updateView( );
+
+  int ret = this->QDialog::exec( );
+  if( ret == 1 )
+    this->updateParameters( );
+  else
+    this->updateView( );
+  return( ret );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+updateParameters( )
+{
+  if( this->m_ProcessObject == NULL )
+    return;
+
+  // Put values
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  auto& raw_params = parameters->GetRawParameters( );
+  for( auto pIt = raw_params.begin( ); pIt != raw_params.end( ); ++pIt )
+  {
+    QString pName = pIt->first.c_str( );
+    switch( pIt->second.first )
+    {
+    case Parameters::String:
+    case Parameters::OpenFileName:
+    case Parameters::SaveFileName:
+    case Parameters::PathName:
+    case Parameters::IntList:
+    case Parameters::UintList:
+    case Parameters::RealList:
+    case Parameters::OpenFileNameList:
+    {
+      QLineEdit* v_string = this->findChild< QLineEdit* >( pName );
+      if( v_string != NULL )
+        pIt->second.second = v_string->text( ).toStdString( );
+    }
+    break;
+    case Parameters::Bool:
+    {
+      QCheckBox* v_bool = this->findChild< QCheckBox* >( pName );
+      if( v_bool != NULL )
+        pIt->second.second = ( v_bool->isChecked( ) )? "1": "0";
+    }
+    break;
+    case Parameters::Int:
+    case Parameters::Uint:
+    {
+      QSpinBox* v_uint = this->findChild< QSpinBox* >( pName );
+      if( v_uint )
+      {
+        std::stringstream str;
+        str << v_uint->value( );
+        pIt->second.second = str.str( );
+
+      } // fi
+    }
+    break;
+    case Parameters::Real:
+    {
+      QDoubleSpinBox* v_double = this->findChild< QDoubleSpinBox* >( pName );
+      if( v_double )
+      {
+        std::stringstream str;
+        str << v_double->value( );
+        pIt->second.second = str.str( );
+
+      } // fi
+    }
+    break;
+    case Parameters::StringList:
+      break;
+    case Parameters::BoolList:
+      break;
+    case Parameters::SaveFileNameList:
+      break;
+    case Parameters::PathNameList:
+      break;
+    case Parameters::Choices:
+    {
+      QComboBox* v_choices = this->findChild< QComboBox* >( pName );
+      if( v_choices != NULL )
+      {
+        std::istringstream str_choices( pIt->second.second );
+        std::string real_choices;
+        std::getline( str_choices, real_choices, '@' );
+        pIt->second.second =
+          real_choices + "@" +
+          v_choices->currentText( ).toStdString( );
+
+      } // fi
+    }
+    break;
+    default:
+      break;
+    } // hctiws
+
+  } // rof
+  this->m_ProcessObject->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+updateView( )
+{
+  if( this->m_ProcessObject == NULL )
+    return;
+
+  // Put values
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  auto& raw_params = parameters->GetRawParameters( );
+  for( auto pIt = raw_params.begin( ); pIt != raw_params.end( ); ++pIt )
+  {
+    QString pName = pIt->first.c_str( );
+    switch( pIt->second.first )
+    {
+    case Parameters::String:
+    case Parameters::OpenFileName:
+    case Parameters::SaveFileName:
+    case Parameters::PathName:
+    case Parameters::IntList:
+    case Parameters::UintList:
+    case Parameters::RealList:
+    case Parameters::OpenFileNameList:
+    {
+      QLineEdit* v_string = this->findChild< QLineEdit* >( pName );
+      if( v_string != NULL )
+        v_string->setText( pIt->second.second.c_str( ) );
+    }
+    break;
+    case Parameters::Bool:
+    {
+      QCheckBox* v_bool = this->findChild< QCheckBox* >( pName );
+      if( v_bool != NULL )
+        v_bool->setChecked( pIt->second.second == "1" );
+    }
+    break;
+    case Parameters::Int:
+    case Parameters::Uint:
+    {
+      QSpinBox* v_uint = this->findChild< QSpinBox* >( pName );
+      if( v_uint )
+      {
+        std::istringstream tok_str( pIt->second.second );
+        int v;
+        tok_str >> v;
+        v_uint->setValue( v );
+
+      } // fi
+    }
+    break;
+    case Parameters::Real:
+    {
+      QDoubleSpinBox* v_double = this->findChild< QDoubleSpinBox* >( pName );
+      if( v_double )
+      {
+        std::istringstream tok_str( pIt->second.second );
+        double v;
+        tok_str >> v;
+        v_double->setValue( v );
+
+      } // fi
+    }
+    break;
+    case Parameters::StringList:
+      break;
+    case Parameters::BoolList:
+      break;
+    case Parameters::SaveFileNameList:
+      break;
+    case Parameters::PathNameList:
+      break;
+    case Parameters::Choices:
+    {
+      QComboBox* v_choices = this->findChild< QComboBox* >( pName );
+      if( v_choices != NULL )
+      {
+        std::istringstream str_choices( pIt->second.second );
+        std::string choices, real_choice;
+        std::getline( str_choices, choices, '@' );
+        std::getline( str_choices, real_choice, '@' );
+        std::istringstream str( choices );
+        std::string token;
+        int id = -1, cont = 0;
+        while( std::getline( str, token, '#' ) )
+        {
+          if( token == real_choice )
+            id = cont;
+          cont++;
+
+        } // elihw
+
+        if( id > -1 )
+          v_choices->setCurrentIndex( id );
+
+      } // fi
+    }
+    break;
+    default:
+      break;
+    } // hctiws
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_addButtons( )
+{
+  // Add buttons
+  this->m_Buttons = new QDialogButtonBox(
+    QDialogButtonBox::Ok | QDialogButtonBox::Cancel
+    );
+  this->connect(
+    this->m_Buttons, SIGNAL( accepted( ) ), this, SLOT( accept( ) )
+    );
+  this->connect(
+    this->m_Buttons, SIGNAL( rejected( ) ), this, SLOT( reject( ) )
+    );
+  this->m_ToolsLayout->addWidget( this->m_Buttons );
+
+  this->updateView( );
+  this->m_WidgetsUpdated = true;
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_updateWidgets( )
+{
+  if( this->m_WidgetsUpdated || this->m_ProcessObject == NULL )
+    return;
+
+  // Set dialog title
+  std::stringstream title;
+  title
+    << "Parameters for an object of class \""
+    << this->m_ProcessObject->GetClassName( )
+    << "\"";
+  this->m_Title->setText( title.str( ).c_str( ) );
+
+  // Put values
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  auto& raw_params = parameters->GetRawParameters( );
+  for( auto pIt = raw_params.begin( ); pIt != raw_params.end( ); ++pIt )
+  {
+    QWidget* w_input = NULL;
+    switch( pIt->second.first )
+    {
+    case Parameters::String:
+    {
+      QLineEdit* v_string = new QLineEdit( this );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      w_input = v_string;
+    }
+    break;
+    case Parameters::Bool:
+    {
+      QCheckBox* v_bool = new QCheckBox( this );
+      v_bool->setObjectName( pIt->first.c_str( ) );
+      v_bool->setText( "[ON/OFF]" );
+      v_bool->setChecked( pIt->second.second == "1" );
+      w_input = v_bool;
+    }
+    break;
+    case Parameters::Int:
+    case Parameters::Uint:
+    {
+      std::istringstream tok_str( pIt->second.second );
+      int v;
+      tok_str >> v;
+      QSpinBox* v_uint = new QSpinBox( this );
+      v_uint->setObjectName( pIt->first.c_str( ) );
+      if( pIt->second.first == Parameters::Uint )
+        v_uint->setMinimum( 0 );
+      else
+        v_uint->setMinimum( -std::numeric_limits< int >::max( ) );
+      v_uint->setMaximum( std::numeric_limits< int >::max( ) );
+      v_uint->setValue( v );
+      w_input = v_uint;
+    }
+    break;
+    case Parameters::Real:
+    {
+      std::istringstream tok_str( pIt->second.second );
+      double v;
+      tok_str >> v;
+      QDoubleSpinBox* v_double = new QDoubleSpinBox( this );
+      v_double->setObjectName( pIt->first.c_str( ) );
+      v_double->setDecimals( 3 );
+      v_double->setMinimum( -std::numeric_limits< double >::max( ) );
+      v_double->setMaximum(  std::numeric_limits< double >::max( ) );
+      v_double->setValue( v );
+      w_input = v_double;
+    }
+    break;
+    case Parameters::OpenFileName:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "..." );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_OpenSingleFile( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    case Parameters::SaveFileName:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "..." );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_SaveSingleFile( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    break;
+    case Parameters::PathName:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "..." );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_OpenSinglePath( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    break;
+    case Parameters::StringList:
+      break;
+    case Parameters::BoolList:
+      break;
+    case Parameters::IntList:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "+" );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_AddInt( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    break;
+    case Parameters::UintList:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "+" );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_AddUint( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    break;
+    case Parameters::RealList:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "+" );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_AddReal( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    break;
+    case Parameters::OpenFileNameList:
+    {
+      QFrame* frame = new QFrame( this );
+      QHBoxLayout* layout = new QHBoxLayout( frame );
+      QLineEdit* v_string = new QLineEdit( frame );
+      v_string->setObjectName( pIt->first.c_str( ) );
+      v_string->setMaxLength( std::numeric_limits< int >::max( ) );
+      v_string->setText( pIt->second.second.c_str( ) );
+      QPushButton* v_button = new QPushButton( frame );
+      v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+      v_button->setText( "..." );
+      v_button->connect(
+        v_button, SIGNAL( clicked( ) ),
+        this, SLOT( _dlg_OpenMultipleFiles( ) )
+        );
+      layout->addWidget( v_string );
+      layout->addWidget( v_button );
+      w_input = frame;
+    }
+    break;
+    case Parameters::SaveFileNameList:
+      break;
+    case Parameters::PathNameList:
+      break;
+    case Parameters::Choices:
+    {
+      QComboBox* v_choices = new QComboBox( this );
+      v_choices->setObjectName( pIt->first.c_str( ) );
+
+      std::istringstream str0( pIt->second.second );
+      std::string choices;
+      std::getline( str0, choices, '@' );
+      std::istringstream str1( choices );
+      std::string token;
+      int id = 0;
+      while( std::getline( str1, token, '#' ) )
+        v_choices->insertItem( id++, token.c_str( ) );
+      w_input = v_choices;
+    }
+    break;
+    default:
+      w_input = NULL;
+      break;
+    } // hctiws
+
+    // Ok, a representation was created
+    if( w_input != NULL )
+    {
+      QHBoxLayout* new_layout = new QHBoxLayout( );
+      QLabel* label = new QLabel( this );
+      label->setText( QString( pIt->first.c_str( ) ) );
+      new_layout->addWidget( label );
+      new_layout->addWidget( w_input );
+      this->m_ToolsLayout->addLayout( new_layout );
+
+    } // fi
+
+  } // rof
+
+  // Update values
+  this->_addButtons( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_OpenSingleFile( )
+{
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        std::string param_value = parameters->GetOpenFileName( param_name );
+        if( param_value == "" )
+          param_value = ".";
+        QStringList dialog_filters;
+        std::string extensions = parameters->GetAcceptedFileExtensions( param_name );
+        if( extensions != "" )
+          dialog_filters << extensions.c_str( );
+        dialog_filters << "Any file (*)";
+
+        // Show dialog and check if it was accepted
+        QFileDialog dialog( this );
+        dialog.setFileMode( QFileDialog::ExistingFile );
+        dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
+        dialog.setNameFilters( dialog_filters );
+        dialog.setAcceptMode( QFileDialog::AcceptOpen );
+        if( dialog.exec( ) )
+          line->setText( *( dialog.selectedFiles( ).begin( ) ) );
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_SaveSingleFile( )
+{
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        std::string param_value = parameters->GetSaveFileName( param_name );
+        if( param_value == "" )
+          param_value = ".";
+        QStringList dialog_filters;
+        std::string extensions = parameters->GetAcceptedFileExtensions( param_name );
+        if( extensions != "" )
+          dialog_filters << extensions.c_str( );
+        dialog_filters << "Any file (*)";
+
+        // Show dialog and check if it was accepted
+        QFileDialog dialog( this );
+        dialog.setFileMode( QFileDialog::AnyFile );
+        dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
+        dialog.setNameFilters( dialog_filters );
+        dialog.setAcceptMode( QFileDialog::AcceptSave );
+        if( dialog.exec( ) )
+          line->setText( *( dialog.selectedFiles( ).begin( ) ) );
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_OpenSinglePath( )
+{
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        std::string param_value = parameters->GetPathName( param_name );
+        if( param_value == "" )
+          param_value = ".";
+
+        // Show dialog and check if it was accepted
+        QFileDialog dialog( this );
+        dialog.setFileMode( QFileDialog::Directory );
+        dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
+        dialog.setAcceptMode( QFileDialog::AcceptOpen );
+        if( dialog.exec( ) )
+          line->setText( *( dialog.selectedFiles( ).begin( ) ) );
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_OpenMultipleFiles( )
+{
+  auto parameters = this->m_ProcessObject->GetParameters( );
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        QStringList dialog_filters;
+        std::string extensions = parameters->GetAcceptedFileExtensions( param_name );
+        if( extensions != "" )
+          dialog_filters << extensions.c_str( );
+        dialog_filters << "Any file (*)";
+
+        // Show dialog and check if it was accepted
+        QFileDialog dialog( this );
+        dialog.setFileMode( QFileDialog::ExistingFiles );
+        dialog.setNameFilters( dialog_filters );
+        dialog.setAcceptMode( QFileDialog::AcceptOpen );
+        if( dialog.exec( ) )
+        {
+          if( dialog.selectedFiles( ).size( ) > 0 )
+          {
+            std::stringstream str;
+            auto files = dialog.selectedFiles( );
+            auto fIt = files.begin( );
+            str << fIt->toStdString( );
+            ++fIt;
+            for( ; fIt != files.end( ); ++fIt )
+              str << "#" << fIt->toStdString( );
+            line->setText( str.str( ).c_str( ) );
+
+          } // fi
+
+        } // fi
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_AddInt( )
+{
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        bool ok;
+        int value =
+          QInputDialog::getInt(
+            this,
+            (
+              std::string( "Add new value to \"" ) +
+              param_name +
+              std::string( "\"" )
+              ).c_str( ),
+            "Value:",
+            0,
+            -std::numeric_limits< int >::max( ),
+            std::numeric_limits< int >::max( ),
+            1, &ok
+            );
+        if( ok )
+        {
+          std::string values = line->text( ).toStdString( );
+          if( values != "" )
+            values += "#";
+          std::stringstream str;
+          str << values << value;
+          line->setText( str.str( ).c_str( ) );
+
+        } // fi
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_AddUint( )
+{
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        bool ok;
+        int value =
+          QInputDialog::getInt(
+            this,
+            (
+              std::string( "Add new value to \"" ) +
+              param_name +
+              std::string( "\"" )
+              ).c_str( ),
+            "Value:",
+            0, 0, std::numeric_limits< int >::max( ), 1,
+            &ok
+            );
+        if( ok )
+        {
+          std::string values = line->text( ).toStdString( );
+          if( values != "" )
+            values += "#";
+          std::stringstream str;
+          str << values << value;
+          line->setText( str.str( ).c_str( ) );
+
+        } // fi
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ParametersQtDialog::
+_dlg_AddReal( )
+{
+  QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+  if( btn != NULL )
+  {
+    std::string bName = btn->objectName( ).toStdString( );
+    std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+    QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+    if( line != NULL )
+    {
+      std::string param_name = line->objectName( ).toStdString( );
+      if( param_name != "" )
+      {
+        bool ok;
+        double value =
+          QInputDialog::getDouble(
+            this,
+            (
+              std::string( "Add new value to \"" ) +
+              param_name +
+              std::string( "\"" )
+              ).c_str( ),
+            "Value:",
+            0,
+            -std::numeric_limits< double >::max( ),
+            std::numeric_limits< double >::max( ),
+            1, &ok
+            );
+        if( ok )
+        {
+          std::string values = line->text( ).toStdString( );
+          if( values != "" )
+            values += "#";
+          std::stringstream str;
+          str << values << value;
+          line->setText( str.str( ).c_str( ) );
+
+        } // fi
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
+#endif // cpPlugins_QT4
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/ParametersQtDialog.h b/lib/cpPlugins/ParametersQtDialog.h
new file mode 100644 (file)
index 0000000..b82f401
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef __CPPLUGINS__PARAMETERSQTDIALOG__H__
+#define __CPPLUGINS__PARAMETERSQTDIALOG__H__
+
+#include <cpPlugins/Config.h>
+
+#ifdef cpPlugins_QT4
+
+#include <cpPlugins/ProcessObject.h>
+
+#include <set>
+
+#include <QApplication>
+#include <QDialog>
+#include <QDialogButtonBox>
+#include <QGridLayout>
+#include <QLabel>
+#include <QVBoxLayout>
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT ParametersQtDialog
+    : public QDialog
+  {
+    Q_OBJECT;
+
+  public:
+    ParametersQtDialog( QWidget* parent = 0, Qt::WindowFlags f = 0 );
+    virtual ~ParametersQtDialog( );
+
+    ProcessObject* getProcessObject( ) const;
+    bool setProcessObject( ProcessObject* obj );
+
+    virtual int exec( );
+
+    virtual void updateParameters( );
+    virtual void updateView( );
+
+  protected:
+    virtual void _addButtons( );
+    virtual void _updateWidgets( );
+
+  protected slots:
+    virtual void _dlg_OpenSingleFile( );
+    virtual void _dlg_SaveSingleFile( );
+    virtual void _dlg_OpenSinglePath( );
+    virtual void _dlg_OpenMultipleFiles( );
+    virtual void _dlg_AddInt( );
+    virtual void _dlg_AddUint( );
+    virtual void _dlg_AddReal( );
+
+  protected:
+    ProcessObject* m_ProcessObject;
+    bool m_WidgetsUpdated;
+    QLabel* m_Title;
+    QGridLayout* m_MainLayout;
+    QVBoxLayout* m_ToolsLayout;
+    QDialogButtonBox* m_Buttons;
+  };
+
+} // ecapseman
+
+#endif // cpPlugins_QT4
+
+#endif // __CPPLUGINS__PARAMETERSQTDIALOG__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Port.cxx b/lib/cpPlugins/Port.cxx
new file mode 100644 (file)
index 0000000..316cbc8
--- /dev/null
@@ -0,0 +1,135 @@
+#include <cpPlugins/Port.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::Port::
+Port( )
+{
+  this->m_Data = NULL;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Port::
+~Port( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Port::
+Self& cpPlugins::Port::
+operator=( DataObject* obj )
+{
+  this->m_Data = obj;
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Port::
+Self& cpPlugins::Port::
+operator=( const Self& other )
+{
+  this->m_Data = other.m_Data;
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Port::
+IsValid( ) const
+{
+  return( this->m_Data.IsNotNull( ) );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::InputPort::
+InputPort( bool required )
+  : Superclass( ),
+    m_Required( required )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::InputPort::
+~InputPort( )
+{
+}
+      
+// -------------------------------------------------------------------------
+cpPlugins::InputPort::
+Self& cpPlugins::InputPort::
+operator=( DataObject* obj )
+{
+  this->Superclass::operator=( obj );
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::InputPort::
+Self& cpPlugins::InputPort::
+operator=( const Superclass& other )
+{
+  this->Superclass::operator=( other );
+  auto i = dynamic_cast< const InputPort* >( &other );
+  if( i != NULL )
+    this->m_Required = i->m_Required;
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::InputPort::
+IsRequired( ) const
+{
+  return( this->m_Required );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::InputPort::
+RequiredOn( )
+{
+  this->SetRequired( true );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::InputPort::
+RequiredOff( )
+{
+  this->SetRequired( false );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::InputPort::
+SetRequired( bool required )
+{
+  this->m_Required = required;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::OutputPort::
+OutputPort( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::OutputPort::
+~OutputPort( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::OutputPort::
+Self& cpPlugins::OutputPort::
+operator=( DataObject* obj )
+{
+  this->Superclass::operator=( obj );
+  return( *this );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::OutputPort::
+Self& cpPlugins::OutputPort::
+operator=( const Superclass& other )
+{
+  this->Superclass::operator=( other );
+  return( *this );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Port.h b/lib/cpPlugins/Port.h
new file mode 100644 (file)
index 0000000..c7f8170
--- /dev/null
@@ -0,0 +1,82 @@
+#ifndef __CPPLUGINS__PORT__H__
+#define __CPPLUGINS__PORT__H__
+
+#include <cpPlugins/DataObject.h>
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT Port
+  {
+  public:
+    typedef Port Self;
+
+  public:
+    Port( );
+    virtual ~Port( );
+    Self& operator=( DataObject* obj );
+    Self& operator=( const Self& other );
+
+    bool IsValid( ) const;
+
+    // This could be seen as a pointer to DataObject's
+    inline DataObject* GetPointer( )
+      { return( this->m_Data.GetPointer( ) ); }
+    inline const DataObject* GetPointer( ) const
+      { return( this->m_Data.GetPointer( ) ); }
+    inline DataObject* operator->( ) const
+      { return( this->m_Data.GetPointer( ) ); }
+
+    inline void SetPointer( DataObject* ptr )
+      { this->m_Data = ptr; }
+
+  protected:
+    cpPlugins::DataObject::Pointer m_Data;
+  };
+
+  /**
+   */
+  class cpPlugins_EXPORT InputPort
+    : public Port
+  {
+  public:
+    typedef InputPort Self;
+    typedef Port      Superclass;
+
+  public:
+    InputPort( bool required = false );
+    virtual ~InputPort( );
+    Self& operator=( DataObject* obj );
+    Self& operator=( const Superclass& other );
+
+    bool IsRequired( ) const;
+    void RequiredOn( );
+    void RequiredOff( );
+    void SetRequired( bool required );
+
+  protected:
+    bool m_Required;
+  };
+
+  /**
+   */
+  class cpPlugins_EXPORT OutputPort
+    : public Port
+  {
+  public:
+    typedef OutputPort Self;
+    typedef Port       Superclass;
+
+  public:
+    OutputPort( );
+    virtual ~OutputPort( );
+    Self& operator=( DataObject* obj );
+    Self& operator=( const Superclass& other );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__PORT__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/ProcessObject.cxx b/lib/cpPlugins/ProcessObject.cxx
new file mode 100644 (file)
index 0000000..52b4ac4
--- /dev/null
@@ -0,0 +1,294 @@
+#include <cpPlugins/ProcessObject.h>
+#include <cpPlugins/ParametersQtDialog.h>
+#include <itkProcessObject.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::Parameters* cpPlugins::ProcessObject::
+GetParameters( )
+{
+  return( &( this->m_Parameters ) );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Parameters* cpPlugins::ProcessObject::
+GetParameters( ) const
+{
+  return( &( this->m_Parameters ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ProcessObject::
+SetITK( itk::LightObject* o )
+{
+  // Polymorphism: do nothing -> this is a filter!!!
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ProcessObject::
+SetVTK( vtkObjectBase* o )
+{
+  // Polymorphism: do nothing -> this is a filter!!!
+}
+
+// -------------------------------------------------------------------------
+std::set< std::string > cpPlugins::ProcessObject::
+GetInputsNames( ) const
+{
+  std::set< std::string > names;
+  for( auto i = this->m_Inputs.begin( ); i != this->m_Inputs.end( ); ++i )
+    names.insert( i->first );
+  return( names );
+}
+
+// -------------------------------------------------------------------------
+std::set< std::string > cpPlugins::ProcessObject::
+GetOutputsNames( ) const
+{
+  std::set< std::string > names;
+  for( auto i = this->m_Outputs.begin( ); i != this->m_Outputs.end( ); ++i )
+    names.insert( i->first );
+  return( names );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpPlugins::ProcessObject::
+GetNumberOfInputs( ) const
+{
+  return( this->m_Inputs.size( ) );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpPlugins::ProcessObject::
+GetNumberOfOutputs( ) const
+{
+  return( this->m_Outputs.size( ) );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::
+OutputPort& cpPlugins::ProcessObject::
+GetOutput( const std::string& id )
+{
+  static OutputPort null_port;
+  auto i = this->m_Outputs.find( id );
+  if( i == this->m_Outputs.end( ) )
+  {
+    null_port = NULL;
+    return( null_port );
+  }
+  else
+    return( i->second );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::
+OutputPort& cpPlugins::ProcessObject::
+GetOutput( const std::string& id ) const
+{
+  static const OutputPort null_port;
+  auto i = this->m_Outputs.find( id );
+  if( i == this->m_Outputs.end( ) )
+    return( null_port );
+  else
+    return( i->second );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::
+DataObject* cpPlugins::ProcessObject::
+GetInputData( const std::string& id )
+{
+  auto i = this->m_Inputs.find( id );
+  if( i != this->m_Inputs.end( ) )
+    return( dynamic_cast< DataObject* >( i->second.GetPointer( ) ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::
+DataObject* cpPlugins::ProcessObject::
+GetInputData( const std::string& id ) const
+{
+  auto i = this->m_Inputs.find( id );
+  if( i != this->m_Inputs.end( ) )
+    return( dynamic_cast< const DataObject* >( i->second.GetPointer( ) ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::
+DataObject* cpPlugins::ProcessObject::
+GetOutputData( const std::string& id )
+{
+  auto i = this->m_Outputs.find( id );
+  if( i != this->m_Outputs.end( ) )
+    return( dynamic_cast< DataObject* >( i->second.GetPointer( ) ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::
+DataObject* cpPlugins::ProcessObject::
+GetOutputData( const std::string& id ) const
+{
+  auto i = this->m_Outputs.find( id );
+  if( i != this->m_Outputs.end( ) )
+    return( dynamic_cast< const DataObject* >( i->second.GetPointer( ) ) );
+  else
+    return( NULL );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::ProcessObject::
+SetInput( const std::string& id, const OutputPort& port )
+{
+  auto i = this->m_Inputs.find( id );
+  if( i != this->m_Inputs.end( ) )
+  {
+    if( i->second.GetPointer( ) != port.GetPointer( ) )
+    {
+      i->second = port;
+      this->Modified( );
+
+    } // fi
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ProcessObject::
+DisconnectInputs( )
+{
+  auto i = this->m_Inputs.begin( );
+  for( ; i != this->m_Inputs.end( ); ++i )
+    i->second = NULL;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ProcessObject::
+DisconnectOutputs( )
+{
+  auto i = this->m_Outputs.begin( );
+  for( ; i != this->m_Outputs.end( ); ++i )
+    if( i->second.IsValid( ) )
+      i->second->DisconnectFromPipeline( );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ProcessObject::
+Disconnect( )
+{
+  this->DisconnectInputs( );
+  this->DisconnectOutputs( );
+}
+
+// -------------------------------------------------------------------------
+itk::ModifiedTimeType cpPlugins::ProcessObject::
+GetMTime( ) const
+{
+  auto params_time = this->m_Parameters.GetMTime( );
+  auto filter_time = this->Superclass::GetMTime( );
+  return( ( params_time < filter_time )? params_time: filter_time );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::ProcessObject::
+Update( )
+{
+  std::string r = "";
+
+  // Force upstream updates
+  auto i = this->m_Inputs.begin( );
+  bool need_to_update = false;
+  for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
+  {
+    bool iv = i->second.IsValid( );
+    bool ir = i->second.IsRequired( );
+    if( !iv && ir )
+      r =
+        "ProcessObject: Required input \"" +
+        i->first + "@" + this->GetClassName( ) +
+        "\" is not valid (=NULL).";
+    if( iv && r == "" )
+    {
+      Self* src = dynamic_cast< Self* >( i->second->GetSource( ) );
+      if( src != NULL )
+      {
+        need_to_update |= ( this->m_LastExecutionTime < src->GetMTime( ) );
+        r = src->Update( );
+
+      } // fi
+
+    } // fi
+
+  } // rof
+
+  // Current update
+  if( r == "" )
+  {
+    if( this->m_LastExecutionTime < this->GetMTime( ) || need_to_update )
+    {
+      r = this->_GenerateData( );
+      this->m_LastExecutionTime = this->GetMTime( );
+
+    } // fi
+
+  } // fi
+
+  // Return error description, if any
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ParametersQtDialog* cpPlugins::ProcessObject::
+CreateQtDialog( )
+{
+#ifdef cpPlugins_QT4
+  ParametersQtDialog* dlg = NULL;
+  if( QApplication::instance( ) != NULL )
+  {
+    dlg = new ParametersQtDialog( );
+    dlg->setProcessObject( this );
+
+  } // fi
+  return( dlg );
+#else // cpPlugins_QT4  
+  return( NULL );
+#endif // cpPlugins_QT4
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ProcessObject::
+ProcessObject( )
+  : Superclass( ),
+    m_LastExecutionTime( 0 )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ProcessObject::
+~ProcessObject( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::ProcessObject::
+_AddInput( const std::string& name, bool required )
+{
+  auto i = this->m_Inputs.find( name );
+  if( i == this->m_Inputs.end( ) )
+  {
+    this->m_Inputs[ name ] = InputPort( required );
+    this->Modified( );
+
+  } // fi
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/ProcessObject.h b/lib/cpPlugins/ProcessObject.h
new file mode 100644 (file)
index 0000000..3979ac5
--- /dev/null
@@ -0,0 +1,104 @@
+#ifndef __CPPLUGINS__PROCESSOBJECT__H__
+#define __CPPLUGINS__PROCESSOBJECT__H__
+
+#include <map>
+#include <set>
+#include <cpPlugins/Object.h>
+#include <cpPlugins/Parameters.h>
+#include <cpPlugins/Port.h>
+
+namespace cpPlugins
+{
+  // Forward declaration
+  /* TODO
+     class ParametersQtDialog;
+  */
+
+  /**
+   */
+  class cpPlugins_EXPORT ProcessObject
+    : public Object
+  {
+  public:
+    typedef ProcessObject                   Self;
+    typedef Object                          Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkTypeMacro( ProcessObject, Object );
+    cpPlugins_Id_Macro( ProcessObject, Object );
+
+  public:
+    Parameters* GetParameters( );
+    const Parameters* GetParameters( ) const;
+
+    virtual void SetITK( itk::LightObject* o ) final;
+    virtual void SetVTK( vtkObjectBase* o ) final;
+
+    // IO management
+    std::set< std::string > GetInputsNames( ) const;
+    std::set< std::string > GetOutputsNames( ) const;
+    unsigned int GetNumberOfInputs( ) const;
+    unsigned int GetNumberOfOutputs( ) const;
+
+    OutputPort& GetOutput( const std::string& id );
+    const OutputPort& GetOutput( const std::string& id ) const;
+
+    DataObject* GetInputData( const std::string& id );
+    const DataObject* GetInputData( const std::string& id ) const;
+    DataObject* GetOutputData( const std::string& id );
+    const DataObject* GetOutputData( const std::string& id ) const;
+
+    bool SetInput( const std::string& id, const OutputPort& port );
+
+    void DisconnectInputs( );
+    void DisconnectOutputs( );
+    void Disconnect( );
+
+    // Pipeline execution
+    virtual itk::ModifiedTimeType GetMTime( ) const;
+    virtual std::string Update( );
+
+    // Qt dialog creation
+    virtual ParametersQtDialog* CreateQtDialog( );
+
+  protected:
+    ProcessObject( );
+    virtual ~ProcessObject( );
+
+    void _AddInput( const std::string& name, bool required = true );
+
+    template< class O >
+      inline void _AddOutput( const std::string& name );
+
+    template< class F >
+      inline F* _CreateITK( );
+    template< class F >
+      inline F* _CreateVTK( );
+
+    virtual std::string _GenerateData( ) = 0;
+
+  private:
+    // Purposely not implemented
+    ProcessObject( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    Parameters m_Parameters;
+
+    typedef std::map< std::string, InputPort >  _TInputs;
+    typedef std::map< std::string, OutputPort > _TOutputs;
+    _TInputs  m_Inputs;
+    _TOutputs m_Outputs;
+
+    itk::ModifiedTimeType m_LastExecutionTime;
+  };
+
+} // ecapseman
+
+#include <cpPlugins/ProcessObject.hxx>
+
+#endif // __CPPLUGINS__PROCESSOBJECT__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/ProcessObject.hxx b/lib/cpPlugins/ProcessObject.hxx
new file mode 100644 (file)
index 0000000..73e8743
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __CPPLUGINS__PROCESSOBJECT__HXX__
+#define __CPPLUGINS__PROCESSOBJECT__HXX__
+
+// -------------------------------------------------------------------------
+template< class O >
+void cpPlugins::ProcessObject::
+_AddOutput( const std::string& name )
+{
+  auto i = this->m_Outputs.find( name );
+  if( i == this->m_Outputs.end( ) )
+  {
+    typename O::Pointer o = O::New( );
+    o->SetSource( this );
+    this->m_Outputs[ name ] = o;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class F >
+F* cpPlugins::ProcessObject::
+_CreateITK( )
+{
+  F* filter = this->GetITK< F >( );
+  if( filter == NULL )
+  {
+    typename F::Pointer filter_ptr = F::New( );
+    this->m_ITKObject = filter_ptr;
+    this->m_VTKObject = NULL;
+    filter = filter_ptr.GetPointer( );
+    this->Modified( );
+
+  } // fi
+  return( filter );
+}
+
+// -------------------------------------------------------------------------
+template< class F >
+F* cpPlugins::ProcessObject::
+_CreateVTK( )
+{
+  F* filter = this->GetVTK< F >( );
+  if( filter == NULL )
+  {
+    vtkSmartPointer< F > filter_ptr = vtkSmartPointer< F >::New( );
+    this->m_ITKObject = NULL;
+    this->m_VTKObject = filter_ptr;
+    filter = filter_ptr.GetPointer( );
+    this->Modified( );
+
+  } // fi
+  return( filter );
+}
+
+#endif // __CPPLUGINS__PROCESSOBJECT__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Workspace.cxx b/lib/cpPlugins/Workspace.cxx
new file mode 100644 (file)
index 0000000..f6491ca
--- /dev/null
@@ -0,0 +1,415 @@
+#include <cpPlugins/Workspace.h>
+#include <cpPlugins/BaseWidget.h>
+#include <cpExtensions/QT/SimpleMPRWidget.h>
+#include <vtkRenderWindowInteractor.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::Workspace::
+Workspace( )
+  : m_Interface( NULL ),
+    m_MPRViewer( NULL )
+{
+  this->m_Graph = TGraph::New( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Workspace::
+~Workspace( )
+{
+  this->m_Graph->Clear( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface* cpPlugins::Workspace::
+GetInterface( )
+{
+  return( this->m_Interface );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Interface* cpPlugins::Workspace::
+GetInterface( ) const
+{
+  return( this->m_Interface );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+SetInterface( cpPlugins::Interface* i )
+{
+  if( this->m_Interface != i )
+    this->m_Interface = i;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Workspace::
+TGraph* cpPlugins::Workspace::
+GetGraph( )
+{
+  return( this->m_Graph );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Workspace::
+TGraph* cpPlugins::Workspace::
+GetGraph( ) const
+{
+  return( this->m_Graph );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+Clear( )
+{
+  if( this->m_Graph.IsNotNull( ) )
+    this->m_Graph->Clear( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+ClearConnections( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ProcessObject* cpPlugins::Workspace::
+GetFilter( const std::string& name )
+{
+  ProcessObject* f =
+    dynamic_cast< ProcessObject* >(
+      this->m_Graph->GetVertex( name ).GetPointer( )
+      );
+  return( f );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::ProcessObject* cpPlugins::Workspace::
+GetFilter( const std::string& name ) const
+{
+  const ProcessObject* f =
+    dynamic_cast< const ProcessObject* >(
+      this->m_Graph->GetVertex( name ).GetPointer( )
+      );
+  return( f );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+HasFilter( const std::string& name ) const
+{
+  if( this->m_Graph->HasVertexIndex( name ) )
+    return( this->GetFilter( name ) != NULL );
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::ProcessObject* cpPlugins::Workspace::
+CreateFilter(
+  const std::string& category,
+  const std::string& filter,
+  const std::string& name
+  )
+{
+  if( this->m_Interface == NULL )
+    return( NULL );
+
+  // Get or create new filter from name
+  if( !( this->m_Graph->HasVertexIndex( name ) ) )
+  {
+    ProcessObject::Pointer f =
+      this->m_Interface->Create( category, filter );
+    if( f.IsNotNull( ) )
+    {
+      BaseWidget* bw = dynamic_cast< BaseWidget* >( f.GetPointer( ) );
+      if( bw != NULL )
+      {
+        bw->SetSingleInteractor( this->m_SingleInteractor );
+        bw->SetMPRViewer( this->m_MPRViewer );
+
+      } // fi
+      Object::Pointer o = f.GetPointer( );
+      this->m_Graph->SetVertex( name, o );
+
+    } // fi
+    return( f.GetPointer( ) );
+  }
+  else
+    return( this->GetFilter( name ) );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+RenameFilter( const std::string& old_name, const std::string& new_name )
+{
+  return( this->m_Graph->RenameVertex( old_name, new_name ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+RemoveFilter( const std::string& name )
+{
+}
+
+// -------------------------------------------------------------------------
+vtkRenderWindowInteractor* cpPlugins::Workspace::
+GetSingleInteractor( )
+{
+  return( this->m_SingleInteractor );
+}
+
+// -------------------------------------------------------------------------
+const vtkRenderWindowInteractor* cpPlugins::Workspace::
+GetSingleInteractor( ) const
+{
+  return( this->m_SingleInteractor );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+SetSingleInteractor( vtkRenderWindowInteractor* interactor )
+{
+  this->m_SingleInteractor = interactor;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Workspace::TMPRWidget* cpPlugins::Workspace::
+GetMPRViewer( )
+{
+  return( this->m_MPRViewer );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Workspace::TMPRWidget* cpPlugins::Workspace::
+GetMPRViewer( ) const
+{
+  return( this->m_MPRViewer );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+SetMPRViewer( cpPlugins::Workspace::TMPRWidget* wdg )
+{
+  this->m_MPRViewer = wdg;
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+Connect(
+  const std::string& orig_filter, const std::string& dest_filter,
+  const std::string& output_name, const std::string& input_name
+  )
+{
+  // Get filters
+  ProcessObject* orig = this->GetFilter( orig_filter );
+  ProcessObject* dest = this->GetFilter( dest_filter );
+  if( orig == NULL || dest == NULL )
+    return( false );
+
+  // Real connection
+  if( dest->SetInput( input_name, orig->GetOutput( output_name ) ) )
+  {
+    this->m_Graph->AddEdge(
+      orig_filter, dest_filter,
+      TConnection( output_name, input_name )
+      );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+Connect( const OutputPort& port, const std::string& exposed_port )
+{
+  auto i = this->m_ExposedInputPorts.find( exposed_port );
+  if( i != this->m_ExposedInputPorts.end( ) )
+  {
+    ProcessObject* filter = this->GetFilter( i->second.first );
+    if( filter != NULL )
+      return( filter->SetInput( i->second.second, port ) );
+    else
+      return( false );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+Reduce( const std::string& name )
+{
+  return( false );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+ExposeInputPort(
+  const std::string& name,
+  const std::string& filter, const std::string& filter_input
+  )
+{
+  this->m_ExposedInputPorts[ name ] = TExposedPort( filter, filter_input );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+ExposeOutputPort(
+  const std::string& name,
+  const std::string& filter, const std::string& filter_output
+  )
+{
+  this->m_ExposedOutputPorts[ name ] = TExposedPort( filter, filter_output );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+HideInputPort( const std::string& name )
+{
+  auto i = this->m_ExposedInputPorts.find( name );
+  if( i != this->m_ExposedInputPorts.end( ) )
+    this->m_ExposedInputPorts.erase( i );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Workspace::
+HideOutputPort( const std::string& name )
+{
+  auto i = this->m_ExposedOutputPorts.find( name );
+  if( i != this->m_ExposedOutputPorts.end( ) )
+    this->m_ExposedOutputPorts.erase( i );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+RenameExposedInputPort(
+  const std::string& old_name,
+  const std::string& new_name
+  )
+{
+  auto o = this->m_ExposedInputPorts.find( old_name );
+  auto n = this->m_ExposedInputPorts.find( new_name );
+  if(
+    o != this->m_ExposedInputPorts.end( ) &&
+    n == this->m_ExposedInputPorts.end( )
+    )
+  {
+    this->m_ExposedInputPorts[ new_name ] = o->second;
+    this->m_ExposedInputPorts.erase( o );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Workspace::
+RenameExposedOutputPort(
+  const std::string& old_name,
+  const std::string& new_name
+  )
+{
+  auto o = this->m_ExposedOutputPorts.find( old_name );
+  auto n = this->m_ExposedOutputPorts.find( new_name );
+  if(
+    o != this->m_ExposedOutputPorts.end( ) &&
+    n == this->m_ExposedOutputPorts.end( )
+    )
+  {
+    this->m_ExposedOutputPorts[ new_name ] = o->second;
+    this->m_ExposedOutputPorts.erase( o );
+    return( true );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Workspace::
+TExposedPorts& cpPlugins::Workspace::
+GetExposedInputPorts( ) const
+{
+  return( this->m_ExposedInputPorts );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Workspace::
+TExposedPorts& cpPlugins::Workspace::
+GetExposedOutputPorts( ) const
+{
+  return( this->m_ExposedOutputPorts );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::
+OutputPort& cpPlugins::Workspace::
+GetExposedOutput( const std::string& name )
+{
+  static OutputPort null_port;
+
+  auto i = this->m_ExposedOutputPorts.find( name );
+  if( i != this->m_ExposedOutputPorts.end( ) )
+  {
+    ProcessObject* filter = this->GetFilter( i->second.first );
+    if( filter != NULL )
+      return( filter->GetOutput( i->second.second ) );
+
+  } // fi
+  return( null_port );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::
+OutputPort& cpPlugins::Workspace::
+GetExposedOutput( const std::string& name ) const
+{
+  static const OutputPort null_port;
+
+  auto i = this->m_ExposedOutputPorts.find( name );
+  if( i != this->m_ExposedOutputPorts.end( ) )
+  {
+    const ProcessObject* filter = this->GetFilter( i->second.first );
+    if( filter != NULL )
+      return( filter->GetOutput( i->second.second ) );
+
+  } // fi
+  return( null_port );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Workspace::
+Execute( )
+{
+  // Find sinks
+  std::set< std::string > sinks = this->m_Graph->GetSinks( );
+
+  // Update sinks
+  std::string err = "";
+  for( auto sIt = sinks.begin( ); sIt != sinks.end( ); ++sIt )
+  {
+    std::string lerr = this->Execute( *sIt );
+    if( lerr != "" )
+      err += lerr + std::string( "\n" );
+
+  } // rof
+  return( err );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Workspace::
+Execute( const std::string& name )
+{
+  // Get filter
+  ProcessObject* f = this->GetFilter( name );
+  if( f == NULL )
+    return(
+      std::string( "cpPlugins::Workspace: Vertex \"" ) +
+      name + std::string( "\" is not a filter." )
+      );
+
+  // Execute and return
+  return( f->Update( ) );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/Workspace.h b/lib/cpPlugins/Workspace.h
new file mode 100644 (file)
index 0000000..c450063
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef __CPPLUGINS__WORKSPACE__H__
+#define __CPPLUGINS__WORKSPACE__H__
+
+#include <cpExtensions/DataStructures/Graph.h>
+#include <cpPlugins/Interface.h>
+#include <cpPlugins/DataObject.h>
+#include <cpPlugins/ProcessObject.h>
+
+#include <set>
+#include <string>
+
+// Some forward declarations
+class QWidget;
+class vtkRenderWindowInteractor;
+namespace cpExtensions
+{
+  namespace QT
+  {
+#ifdef cpPlugins_QT4
+    class SimpleMPRWidget;
+#else // cpPlugins_QT4
+    typedef char SimpleMPRWidget;
+#endif // cpPlugins_QT4
+  }
+}
+
+namespace cpPlugins
+{
+  /** \brief A complex pipeline
+   */
+  class cpPlugins_EXPORT Workspace
+  {
+  public:
+    // Various types
+    typedef std::set< std::string >               TStringContainer;
+    typedef std::pair< std::string, std::string > TExposedPort;
+    typedef std::map< std::string, TExposedPort > TExposedPorts;
+
+    // Graph type
+    typedef std::pair< std::string, std::string > TConnection;
+    typedef
+      cpExtensions::DataStructures::
+      Graph< Object::Pointer, TConnection, std::string > TGraph;
+
+    // Associated MPR
+    typedef cpExtensions::QT::SimpleMPRWidget TMPRWidget;
+
+  public:
+    Workspace( );
+    virtual ~Workspace( );
+
+    // Plugins management
+    Interface* GetInterface( );
+    const Interface* GetInterface( ) const;
+    void SetInterface( Interface* i );
+
+    // Workspace IO
+    std::string LoadWorkspace( const std::string& fname );
+    std::string SaveWorkspace( const std::string& fname ) const;
+
+    // Graph management
+    TGraph* GetGraph( );
+    const TGraph* GetGraph( ) const;
+
+    void Clear( );
+    void ClearConnections( );
+
+    // Filter management
+    ProcessObject* GetFilter( const std::string& name );
+    const ProcessObject* GetFilter( const std::string& name ) const;
+    bool HasFilter( const std::string& name ) const;
+    ProcessObject* CreateFilter(
+      const std::string& category,
+      const std::string& filter,
+      const std::string& name
+      );
+    bool RenameFilter(
+      const std::string& old_name, const std::string& new_name
+      );
+    void RemoveFilter( const std::string& name );
+
+    // Widgets management
+    vtkRenderWindowInteractor* GetSingleInteractor( );
+    const vtkRenderWindowInteractor* GetSingleInteractor( ) const;
+    void SetSingleInteractor( vtkRenderWindowInteractor* interactor );
+
+    TMPRWidget* GetMPRViewer( );
+    const TMPRWidget* GetMPRViewer( ) const;
+    void SetMPRViewer( TMPRWidget* wdg );
+
+    // Connection management
+    bool Connect(
+      const std::string& orig_filter, const std::string& dest_filter,
+      const std::string& output_name, const std::string& input_name
+      );
+    bool Connect( const OutputPort& port, const std::string& exposed_port );
+    void RemoveConnection(
+      const std::string& dest_filter, const std::string& input_name
+      );
+    void RemoveConnection( const std::string& exposed_port );
+    void RemoveConnections( const std::string& dest_filter );
+
+    // Graph reduction
+    bool Reduce( const std::string& name );
+    void ExposeInputPort(
+      const std::string& name,
+      const std::string& filter, const std::string& filter_input
+      );
+    void ExposeOutputPort(
+      const std::string& name,
+      const std::string& filter, const std::string& filter_output
+      );
+    void HideInputPort( const std::string& name );
+    void HideOutputPort( const std::string& name );
+
+    bool RenameExposedInputPort(
+      const std::string& old_name,
+      const std::string& new_name
+      );
+    bool RenameExposedOutputPort(
+      const std::string& old_name,
+      const std::string& new_name
+      );
+
+    const TExposedPorts& GetExposedInputPorts( ) const;
+    const TExposedPorts& GetExposedOutputPorts( ) const;
+
+    OutputPort& GetExposedOutput( const std::string& name );
+    const OutputPort& GetExposedOutput( const std::string& name ) const;
+
+    // Pipeline execution
+    std::string Execute( );
+    std::string Execute( const std::string& name );
+
+  protected:
+    // Plugins interface
+    Interface* m_Interface;
+
+    // Processing graph
+    TGraph::Pointer m_Graph;
+    TExposedPorts m_ExposedInputPorts;
+    TExposedPorts m_ExposedOutputPorts;
+
+    vtkSmartPointer< vtkRenderWindowInteractor > m_SingleInteractor;
+    TMPRWidget*                                  m_MPRViewer;
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINS__WORKSPACE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/WorkspaceIO.cxx b/lib/cpPlugins/WorkspaceIO.cxx
new file mode 100644 (file)
index 0000000..c23852a
--- /dev/null
@@ -0,0 +1,195 @@
+#include <cpPlugins/Workspace.h>
+#include <tinyxml/tinyxml2.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Workspace::
+LoadWorkspace( const std::string& fname )
+{
+  tinyxml2::XMLDocument* doc = new tinyxml2::XMLDocument( );
+  doc->LoadFile( fname.c_str( ) );
+  tinyxml2::XMLElement* root = doc->RootElement( );
+  if( root == NULL )
+    return( "cpPlugins::Workspace: No valid file" );
+  if( std::string( root->Value( ) ) != "cpPlugins_Workspace" )
+    return( "cpPlugins::Workspace: No valid workspace" );
+  std::stringstream err;
+
+  // Read filters
+  tinyxml2::XMLElement* filter = root->FirstChildElement( "filter" );
+  while( filter != NULL )
+  {
+    const char* category_value = filter->Attribute( "category" );
+    const char* class_value = filter->Attribute( "class" );
+    const char* name_value = filter->Attribute( "name" );
+    float viewX = float( 0 ), viewY = float( 0 );
+    filter->QueryFloatAttribute( "ViewX", &viewX );
+    filter->QueryFloatAttribute( "ViewY", &viewY );
+    if( class_value != NULL && name_value != NULL )
+    {
+      if( this->CreateFilter( category_value, class_value, name_value ) )
+      {
+        auto new_filter = this->GetFilter( name_value );
+        new_filter->SetViewCoords( viewX, viewY );
+
+        // Read parameters
+        auto parameters = new_filter->GetParameters( );
+        parameters->FromXML( filter );
+      }
+      else
+        err
+          << "No valid class \"" << class_value << "\" with name \""
+          << name_value << "\"" << std::endl;
+    }
+    else
+      err << "Incomplete data." << std::endl;
+    filter = filter->NextSiblingElement( "filter" );
+
+  } // elihw
+
+  // Read connections
+  tinyxml2::XMLElement* connection = root->FirstChildElement( "connection" );
+  while( connection != NULL )
+  {
+    tinyxml2::XMLElement* orig = connection->FirstChildElement( "origin" );
+    tinyxml2::XMLElement* dest = connection->FirstChildElement( "destination" );
+    if( orig != NULL && dest != NULL )
+    {
+      const char* orig_filter = orig->Attribute( "filter" );
+      const char* dest_filter = dest->Attribute( "filter" );
+      const char* orig_name = orig->Attribute( "name" );
+      const char* dest_name = dest->Attribute( "name" );
+      if(
+        orig_filter != NULL && dest_filter != NULL &&
+        orig_name != NULL && dest_name != NULL
+        )
+        this->Connect( orig_filter, dest_filter, orig_name, dest_name );
+
+    } // fi
+    connection = connection->NextSiblingElement( "connection" );
+
+  } // elihw
+
+  // Read exposed inputs
+  tinyxml2::XMLElement* port = root->FirstChildElement( "exposed_input_port" );
+  while( port != NULL )
+  {
+    this->ExposeInputPort(
+      port->Attribute( "port_name" ),
+      port->Attribute( "filter" ),
+      port->Attribute( "filter_port_name" )
+      );
+    port = port->NextSiblingElement( "exposed_input_port" );
+
+  } // elihw
+
+  // Read exposed outputs
+  port = root->FirstChildElement( "exposed_output_port" );
+  while( port != NULL )
+  {
+    this->ExposeOutputPort(
+      port->Attribute( "port_name" ),
+      port->Attribute( "filter" ),
+      port->Attribute( "filter_port_name" )
+      );
+    port = port->NextSiblingElement( "exposed_output_port" );
+
+  } // elihw
+
+  // Finish and return
+  delete doc;
+  return( err.str( ) );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Workspace::
+SaveWorkspace( const std::string& fname ) const
+{
+  std::stringstream err;
+  tinyxml2::XMLDocument* doc = new tinyxml2::XMLDocument( );
+  tinyxml2::XMLElement* root = doc->NewElement( "cpPlugins_Workspace" );
+
+  // Save vertices
+  auto vIt = this->m_Graph->BeginVertices( );
+  for( ; vIt != this->m_Graph->EndVertices( ); ++vIt )
+  {
+    auto filter = dynamic_cast< ProcessObject* >( vIt->second.GetPointer( ) );
+    auto data = dynamic_cast< DataObject* >( vIt->second.GetPointer( ) );
+    if( filter != NULL )
+    {
+      tinyxml2::XMLElement* e = doc->NewElement( "filter" );
+      e->SetAttribute( "category", filter->GetClassCategory( ) );
+      e->SetAttribute( "class", filter->GetClassName( ) );
+      e->SetAttribute( "name", vIt->first.c_str( ) );
+      e->SetAttribute( "ViewX", filter->GetViewX( ) );
+      e->SetAttribute( "ViewY", filter->GetViewY( ) );
+
+      auto params = filter->GetParameters( );
+      params->ToXML( doc, e );
+      root->LinkEndChild( e );
+    }
+    else if( data != NULL )
+    {
+      // TODO
+    } // fi
+
+  } // rof
+
+  // Save connections
+  auto mIt = this->m_Graph->BeginEdgesRows( );
+  for( ; mIt != this->m_Graph->EndEdgesRows( ); ++mIt )
+  {
+    auto rIt = mIt->second.begin( );
+    for( ; rIt != mIt->second.end( ); ++rIt )
+    {
+      auto eIt = rIt->second.begin( );
+      for( ; eIt != rIt->second.end( ); ++eIt )
+      {
+        tinyxml2::XMLElement* conn = doc->NewElement( "connection" );
+        tinyxml2::XMLElement* orig = doc->NewElement( "origin" );
+        tinyxml2::XMLElement* dest = doc->NewElement( "destination" );
+        orig->SetAttribute( "filter", mIt->first.c_str( ) );
+        orig->SetAttribute( "name", eIt->first.c_str( ) );
+        dest->SetAttribute( "filter", rIt->first.c_str( ) );
+        dest->SetAttribute( "name", eIt->second.c_str( ) );
+
+        conn->LinkEndChild( orig );
+        conn->LinkEndChild( dest );
+        root->LinkEndChild( conn );
+
+      } // rof
+
+    } // rof
+
+  } // rof
+
+  // Save exposed ports
+  auto eipIt = this->m_ExposedInputPorts.begin( );
+  for( ; eipIt != this->m_ExposedInputPorts.end( ); ++eipIt )
+  {
+    tinyxml2::XMLElement* port = doc->NewElement( "exposed_input_port" );
+    port->SetAttribute( "port_name", eipIt->first.c_str( ) );
+    port->SetAttribute( "filter", eipIt->second.first.c_str( ) );
+    port->SetAttribute( "filter_port_name", eipIt->second.second.c_str( ) );
+    root->LinkEndChild( port );
+
+  } // rof
+
+  auto eopIt = this->m_ExposedOutputPorts.begin( );
+  for( ; eopIt != this->m_ExposedOutputPorts.end( ); ++eopIt )
+  {
+    tinyxml2::XMLElement* port = doc->NewElement( "exposed_output_port" );
+    port->SetAttribute( "port_name", eopIt->first.c_str( ) );
+    port->SetAttribute( "filter", eopIt->second.first.c_str( ) );
+    port->SetAttribute( "filter_port_name", eopIt->second.second.c_str( ) );
+    root->LinkEndChild( port );
+
+  } // rof
+
+  // Physical write and return
+  doc->LinkEndChild( root );
+  doc->SaveFile( fname.c_str( ) );
+  delete doc;
+  return( err.str( ) );
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins_ITKInstances/Base.cxx b/lib/cpPlugins_ITKInstances/Base.cxx
new file mode 100644 (file)
index 0000000..0ecd951
--- /dev/null
@@ -0,0 +1,6 @@
+
+#include <cpPlugins_ITKInstances/Base.h>
+
+// ...aaand that's all folks!
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins_ITKInstances/Base.h b/lib/cpPlugins_ITKInstances/Base.h
new file mode 100644 (file)
index 0000000..9c767d9
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef __CPPLUGINS_ITKINSTANCES__BASE__H__
+#define __CPPLUGINS_ITKINSTANCES__BASE__H__
+
+#include <cpPlugins_ITKInstances/Config.h>
+#include <vector>
+#include <string>
+#include <itkArray.h>
+#include <itkFixedArray.h>
+#include <itkIndex.h>
+#include <itkPoint.h>
+#include <itkSimpleDataObjectDecorator.h>
+#include <itkVector.h>
+
+/*
+ * =========================================================================
+ * Define scalar FixedArray's
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_FixedArrays( T, D )              \
+  cpPlugins_ITKInstances_PREFIX itk::FixedArray< T, D >;        \
+  cpPlugins_ITKInstances_PREFIX itk::Vector< T, D >;            \
+  cpPlugins_ITKInstances_PREFIX itk::Point< T, D >
+
+cpPlugins_ITKInstances_FixedArrays( float, 1 );
+cpPlugins_ITKInstances_FixedArrays( float, 2 );
+cpPlugins_ITKInstances_FixedArrays( float, 3 );
+cpPlugins_ITKInstances_FixedArrays( float, 4 );
+
+cpPlugins_ITKInstances_FixedArrays( double, 1 );
+cpPlugins_ITKInstances_FixedArrays( double, 2 );
+cpPlugins_ITKInstances_FixedArrays( double, 3 );
+cpPlugins_ITKInstances_FixedArrays( double, 4 );
+
+/*
+ * =========================================================================
+ * Define scalar Array's
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_Array( T )           \
+  cpPlugins_ITKInstances_PREFIX itk::Array< T >
+
+cpPlugins_ITKInstances_Array( char );
+cpPlugins_ITKInstances_Array( short );
+cpPlugins_ITKInstances_Array( int );
+cpPlugins_ITKInstances_Array( long );
+cpPlugins_ITKInstances_Array( float );
+cpPlugins_ITKInstances_Array( double );
+cpPlugins_ITKInstances_Array( unsigned char );
+cpPlugins_ITKInstances_Array( unsigned short );
+cpPlugins_ITKInstances_Array( unsigned int );
+cpPlugins_ITKInstances_Array( unsigned long );
+
+/*
+ * =========================================================================
+ * Define scalar SimpleDataObjectDecorator's
+ * =========================================================================
+ */
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< bool >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< char >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< short >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< int >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< long >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< float >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< double >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< unsigned char >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< unsigned short >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< unsigned int >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< unsigned long >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::string >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< char > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< short > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< int > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< long > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< float > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< double > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< unsigned char > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< unsigned short > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< unsigned int > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< itk::Array< unsigned long > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::vector< itk::Index< 2 > > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::vector< itk::Index< 3 > > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::vector< itk::Point< float, 2 > > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::vector< itk::Point< double, 2 > > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::vector< itk::Point< float, 3 > > >;
+cpPlugins_ITKInstances_PREFIX itk::SimpleDataObjectDecorator< std::vector< itk::Point< double, 3 > > >;
+
+#endif // __CPPLUGINS_ITKINSTANCES__BASE__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins_ITKInstances/CMakeLists.txt b/lib/cpPlugins_ITKInstances/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f246d90
--- /dev/null
@@ -0,0 +1,78 @@
+## =============================
+## = Set names and directories =
+## =============================
+
+SET(lib_NAME cpPlugins_ITKInstances)
+SET(lib_DIR  cpPlugins_ITKInstances)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB lib_HEADERS_H   "*.h")
+FILE(GLOB lib_HEADERS_HPP "*.hpp")
+FILE(GLOB lib_HEADERS_HXX "*.hxx")
+FILE(GLOB lib_SOURCES_C   "*.c")
+FILE(GLOB lib_SOURCES_CPP "*.cpp")
+FILE(GLOB lib_SOURCES_CXX "*.cxx")
+
+# ===================================
+# = Integrate all source file names =
+# ===================================
+
+SET(
+  lib_HEADERS
+  ${lib_HEADERS_H}
+  ${lib_HEADERS_HPP}
+  ${lib_HEADERS_HXX}
+  )
+
+SET(
+  lib_SOURCES
+  ${lib_SOURCES_C}
+  ${lib_SOURCES_CPP}
+  ${lib_SOURCES_CXX}
+  )
+
+SET(
+  target_LIBRARIES
+  ${ITK_LIBRARIES}
+  ${VTK_LIBRARIES}
+  )
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_LIBRARY(${lib_NAME} SHARED  ${lib_SOURCES})
+SET_TARGET_PROPERTIES(
+  ${lib_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${lib_NAME}
+  BASE_NAME ${lib_NAME}
+  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/${lib_DIR}/${lib_NAME}_Export.h
+  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+
+## ========================
+## == Installation rules ==
+## ========================
+
+INSTALL(
+  TARGETS ${lib_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+INSTALL(
+  FILES
+  ${lib_HEADERS}
+  DESTINATION include/${lib_DIR}
+  )
+
+## eof - $RCSfile$
diff --git a/lib/cpPlugins_ITKInstances/Config.h b/lib/cpPlugins_ITKInstances/Config.h
new file mode 100644 (file)
index 0000000..5e4b1b1
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __CPPLUGINS_ITKINSTANCES__CONFIG__H__
+#define __CPPLUGINS_ITKINSTANCES__CONFIG__H__
+
+#include <cpPlugins_ITKInstances/cpPlugins_ITKInstances_Export.h>
+
+/*
+ * =========================================================================
+ * Discover what we are doing: building or using
+ * =========================================================================
+ */
+#ifdef cpPlugins_ITKInstances_EXPORTS
+#  undef  ITK_MANUAL_INSTANTIATION
+#  define cpPlugins_ITKInstances_PREFIX template class cpPlugins_ITKInstances_EXPORT
+#else // cpPlugins_ITKInstances_EXPORTS
+#  define ITK_MANUAL_INSTANTIATION
+#  define cpPlugins_ITKInstances_PREFIX extern template class
+#endif // cpPlugins_ITKInstances_EXPORTS
+
+#endif // __CPPLUGINS_ITKINSTANCES__CONFIG__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins_ITKInstances/Image.cxx b/lib/cpPlugins_ITKInstances/Image.cxx
new file mode 100644 (file)
index 0000000..4fcf5ea
--- /dev/null
@@ -0,0 +1,19 @@
+
+#include <cpPlugins_ITKInstances/Image.h>
+
+// -------------------------------------------------------------------------
+#define cpPlugins_ITKInstances_ostream( D )                             \
+  template cpPlugins_ITKInstances_EXPORT std::ostream& operator<< < D > \
+  ( std::ostream& o, const ImageRegion< D >& r )
+
+namespace itk
+{
+  cpPlugins_ITKInstances_ostream( 1 );
+  cpPlugins_ITKInstances_ostream( 2 );
+  cpPlugins_ITKInstances_ostream( 3 );
+  cpPlugins_ITKInstances_ostream( 4 );
+}
+  
+// ...aaand that's all folks!
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins_ITKInstances/Image.h b/lib/cpPlugins_ITKInstances/Image.h
new file mode 100644 (file)
index 0000000..3069e31
--- /dev/null
@@ -0,0 +1,251 @@
+#ifndef __CPPLUGINS_ITKINSTANCES__IMAGE__H__
+#define __CPPLUGINS_ITKINSTANCES__IMAGE__H__
+
+#include <cpPlugins_ITKInstances/Config.h>
+#include <itkConvertPixelBuffer.h>
+#include <itkDefaultConvertPixelTraits.h>
+#include <itkImportImageContainer.h>
+#include <itkImage.h>
+#include <itkImageSource.h>
+#include <itkRGBPixel.h>
+#include <itkRGBAPixel.h>
+#include <itkImageConstIteratorWithIndex.h>
+#include <itkImageIteratorWithIndex.h>
+#include <itkImageLinearConstIteratorWithIndex.h>
+#include <itkImageLinearIteratorWithIndex.h>
+#include <itkImageRegionConstIterator.h>
+#include <itkImageRegionIterator.h>
+#include <itkImageScanlineConstIterator.h>
+#include <itkImageScanlineIterator.h>
+#include <itkConstNeighborhoodIterator.h>
+#include <itkNeighborhoodIterator.h>
+#include <itkConstShapedNeighborhoodIterator.h>
+#include <itkShapedNeighborhoodIterator.h>
+#include <itkConstantBoundaryCondition.h>
+#include <itkPeriodicBoundaryCondition.h>
+#include <itkZeroFluxNeumannBoundaryCondition.h>
+#include <itkImageToVTKImageFilter.h>
+#include <itkImageTransformer.h>
+
+/*
+ * =========================================================================
+ * Define scalar ImageBase's
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_ImageBase( D )           \
+  cpPlugins_ITKInstances_PREFIX itk::ImageBase< D >
+
+cpPlugins_ITKInstances_ImageBase( 1 );
+cpPlugins_ITKInstances_ImageBase( 2 );
+cpPlugins_ITKInstances_ImageBase( 3 );
+cpPlugins_ITKInstances_ImageBase( 4 );
+
+/*
+ * =========================================================================
+ * Define pixel-based objects
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_ConvertPixelBuffer( T, U, V )            \
+  cpPlugins_ITKInstances_PREFIX itk::ConvertPixelBuffer< T, U, itk::DefaultConvertPixelTraits< V > >
+
+#define cpPlugins_ITKInstances_ColorPixel( T )          \
+  cpPlugins_ITKInstances_PREFIX itk::RGBPixel< T >;     \
+  cpPlugins_ITKInstances_PREFIX itk::RGBAPixel< T >
+
+#define cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( U )         \
+  cpPlugins_ITKInstances_PREFIX itk::ImportImageContainer< unsigned long, U >; \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( char, U, U );              \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( short, U, U );             \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( int, U, U );               \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( long, U, U );              \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( float, U, U );             \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( double, U, U );            \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( unsigned char, U, U );     \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( unsigned short, U, U );    \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( unsigned int, U, U );      \
+  cpPlugins_ITKInstances_ConvertPixelBuffer( unsigned long, U, U )
+
+cpPlugins_ITKInstances_ColorPixel( char );
+cpPlugins_ITKInstances_ColorPixel( short );
+cpPlugins_ITKInstances_ColorPixel( int );
+cpPlugins_ITKInstances_ColorPixel( long );
+cpPlugins_ITKInstances_ColorPixel( float );
+cpPlugins_ITKInstances_ColorPixel( double );
+cpPlugins_ITKInstances_ColorPixel( unsigned char );
+cpPlugins_ITKInstances_ColorPixel( unsigned short );
+cpPlugins_ITKInstances_ColorPixel( unsigned int );
+cpPlugins_ITKInstances_ColorPixel( unsigned long );
+
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( char );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( short );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( int );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( long );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( float );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( double );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( unsigned char );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( unsigned short );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( unsigned int );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( unsigned long );
+
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< char > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< short > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< int > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< long > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< float > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< double > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< unsigned char > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< unsigned short > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< unsigned int > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBPixel< unsigned long > );
+
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< char > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< short > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< int > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< long > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< float > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< double > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< unsigned char > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< unsigned short > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< unsigned int > );
+cpPlugins_ITKInstances_ConvertPixelBuffer_AllTypes( itk::RGBAPixel< unsigned long > );
+
+/*
+ * =========================================================================
+ * Define scalar Image's
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_ScalarImage( P, D )                      \
+  cpPlugins_ITKInstances_PREFIX itk::Image< P, D >;                     \
+  cpPlugins_ITKInstances_PREFIX itk::ImageTransformer< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageSource< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageConstIteratorWithIndex< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageIteratorWithIndex< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageRegionConstIterator< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageRegionIterator< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageScanlineConstIterator< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageScanlineIterator< itk::Image< P, D > >
+
+#define cpPlugins_ITKInstances_ScalarImage_AllDims( P ) \
+  cpPlugins_ITKInstances_ScalarImage( P, 1 );           \
+  cpPlugins_ITKInstances_ScalarImage( P, 2 );           \
+  cpPlugins_ITKInstances_ScalarImage( P, 3 );           \
+  cpPlugins_ITKInstances_ScalarImage( P, 4 )
+
+cpPlugins_ITKInstances_ScalarImage_AllDims( char );
+cpPlugins_ITKInstances_ScalarImage_AllDims( short );
+cpPlugins_ITKInstances_ScalarImage_AllDims( int );
+cpPlugins_ITKInstances_ScalarImage_AllDims( long );
+cpPlugins_ITKInstances_ScalarImage_AllDims( float );
+cpPlugins_ITKInstances_ScalarImage_AllDims( double );
+cpPlugins_ITKInstances_ScalarImage_AllDims( unsigned char );
+cpPlugins_ITKInstances_ScalarImage_AllDims( unsigned short );
+cpPlugins_ITKInstances_ScalarImage_AllDims( unsigned int );
+cpPlugins_ITKInstances_ScalarImage_AllDims( unsigned long );
+
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< char > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< short > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< int > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< long > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< float > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< double > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< unsigned char > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< unsigned short > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< unsigned int > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBPixel< unsigned long > );
+
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< char > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< short > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< int > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< long > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< float > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< double > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< unsigned char > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< unsigned short > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< unsigned int > );
+cpPlugins_ITKInstances_ScalarImage_AllDims( itk::RGBAPixel< unsigned long > );
+
+/*
+ * =========================================================================
+ * Define scalar ItkVtkGlue
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_ItkVtkGlueScalarImage( P, D )            \
+  cpPlugins_ITKInstances_PREFIX itk::ImageToVTKImageFilter< itk::Image< P, D > >
+
+#define cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( P )       \
+  cpPlugins_ITKInstances_ItkVtkGlueScalarImage( P, 2 );                 \
+  cpPlugins_ITKInstances_ItkVtkGlueScalarImage( P, 3 )
+
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( char );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( short );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( int );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( long );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( float );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( double );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( unsigned char );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( unsigned short );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( unsigned int );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( unsigned long );
+
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< char > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< short > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< int > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< long > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< float > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< double > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< unsigned char > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< unsigned short > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< unsigned int > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBPixel< unsigned long > );
+
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< char > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< short > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< int > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< long > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< float > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< double > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< unsigned char > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< unsigned short > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< unsigned int > );
+cpPlugins_ITKInstances_ItkVtkGlueScalarImage_AllDims( itk::RGBAPixel< unsigned long > );
+
+/*
+ * =========================================================================
+ * Define scalar shaped iterators
+ * =========================================================================
+ */
+#define cpPlugins_ITKInstances_ScalarImage_ShapedIterators( P, D )      \
+  cpPlugins_ITKInstances_PREFIX itk::ImageLinearConstIteratorWithIndex< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ImageLinearIteratorWithIndex< itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ConstantBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::PeriodicBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ZeroFluxNeumannBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ConstNeighborhoodIterator< itk::Image< P, D >, itk::ConstantBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::NeighborhoodIterator< itk::Image< P, D >, itk::ConstantBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ConstNeighborhoodIterator< itk::Image< P, D >, itk::PeriodicBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::NeighborhoodIterator< itk::Image< P, D >, itk::PeriodicBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ConstNeighborhoodIterator< itk::Image< P, D >, itk::ZeroFluxNeumannBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::NeighborhoodIterator< itk::Image< P, D >, itk::ZeroFluxNeumannBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ConstShapedNeighborhoodIterator< itk::Image< P, D >, itk::ZeroFluxNeumannBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >; \
+  cpPlugins_ITKInstances_PREFIX itk::ShapedNeighborhoodIterator< itk::Image< P, D >, itk::ZeroFluxNeumannBoundaryCondition< itk::Image< P, D >, itk::Image< P, D > > >
+
+#define cpPlugins_ITKInstances_ScalarImage_ShapedIterators_AllTypes( D ) \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( char, D );        \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( short, D );       \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( int, D );         \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( long, D );        \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( float, D );       \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( double, D );      \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( unsigned char, D ); \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( unsigned short, D ); \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( unsigned int, D ); \
+  cpPlugins_ITKInstances_ScalarImage_ShapedIterators( unsigned long, D )
+
+cpPlugins_ITKInstances_ScalarImage_ShapedIterators_AllTypes( 1 );
+cpPlugins_ITKInstances_ScalarImage_ShapedIterators_AllTypes( 2 );
+cpPlugins_ITKInstances_ScalarImage_ShapedIterators_AllTypes( 3 );
+cpPlugins_ITKInstances_ScalarImage_ShapedIterators_AllTypes( 4 );
+
+#endif // __CPPLUGINS_ITKINSTANCES__IMAGE__H__
+
+// eof - $RCSfile$
diff --git a/lib/third_party/CMakeLists.txt b/lib/third_party/CMakeLists.txt
new file mode 100644 (file)
index 0000000..bab952a
--- /dev/null
@@ -0,0 +1,5 @@
+SUBDIRS(
+  tinyxml
+  )
+
+## eof - $RCSfile$
diff --git a/lib/third_party/tinyxml/CMakeLists.txt b/lib/third_party/tinyxml/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a66769f
--- /dev/null
@@ -0,0 +1,25 @@
+SET(lib_NAME cpPlugins_tinyxml2)\r
+\r
+IF(MSVC)\r
+  ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)\r
+ENDIF(MSVC)\r
+\r
+ADD_LIBRARY(${lib_NAME} SHARED tinyxml2.cpp tinyxml2.h)\r
+SET_TARGET_PROPERTIES(\r
+  ${lib_NAME} PROPERTIES\r
+  VERSION "${prj_VER}"\r
+  SOVERSION "${prj_sVER}"\r
+  )\r
+\r
+INSTALL(\r
+  TARGETS ${lib_NAME}\r
+  RUNTIME DESTINATION bin\r
+  LIBRARY DESTINATION lib\r
+  ARCHIVE DESTINATION lib/static\r
+  )\r
+INSTALL(\r
+  FILES tinyxml2.h\r
+  DESTINATION include\r
+  )\r
+\r
+## eof - $RCSfile$\r
diff --git a/lib/third_party/tinyxml/readme.md b/lib/third_party/tinyxml/readme.md
new file mode 100644 (file)
index 0000000..30424c3
--- /dev/null
@@ -0,0 +1,324 @@
+TinyXML-2 [![TravisCI Status](https://travis-ci.org/leethomason/tinyxml2.svg?branch=master)](https://travis-ci.org/leethomason/tinyxml2) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/leethomason/tinyxml2?branch=master&svg=true)](https://ci.appveyor.com/project/leethomason/tinyxml2)
+=========
+![TinyXML-2 Logo](http://www.grinninglizard.com/tinyxml2/TinyXML2_small.png)
+
+TinyXML-2 is a simple, small, efficient, C++ XML parser that can be 
+easily integrated into other programs.
+
+The master is hosted on github:
+https://github.com/leethomason/tinyxml2
+
+The online HTML version of these docs:
+http://grinninglizard.com/tinyxml2docs/index.html
+
+Examples are in the "related pages" tab of the HTML docs.
+
+What it does.
+-------------
+       
+In brief, TinyXML-2 parses an XML document, and builds from that a 
+Document Object Model (DOM) that can be read, modified, and saved.
+
+XML stands for "eXtensible Markup Language." It is a general purpose
+human and machine readable markup language to describe arbitrary data.
+All those random file formats created to store application data can 
+all be replaced with XML. One parser for everything.
+
+http://en.wikipedia.org/wiki/XML
+
+There are different ways to access and interact with XML data.
+TinyXML-2 uses a Document Object Model (DOM), meaning the XML data is parsed
+into a C++ objects that can be browsed and manipulated, and then 
+written to disk or another output stream. You can also construct an XML document 
+from scratch with C++ objects and write this to disk or another output
+stream. You can even use TinyXML-2 to stream XML programmatically from
+code without creating a document first.
+
+TinyXML-2 is designed to be easy and fast to learn. It is one header and
+one cpp file. Simply add these to your project and off you go. 
+There is an example file - xmltest.cpp - to get you started. 
+
+TinyXML-2 is released under the ZLib license, 
+so you can use it in open source or commercial code. The details
+of the license are at the top of every source file.
+
+TinyXML-2 attempts to be a flexible parser, but with truly correct and
+compliant XML output. TinyXML-2 should compile on any reasonably C++
+compliant system. It does not rely on exceptions, RTTI, or the STL.
+
+What it doesn't do.
+-------------------
+
+TinyXML-2 doesn't parse or use DTDs (Document Type Definitions) or XSLs
+(eXtensible Stylesheet Language.) There are other parsers out there 
+that are much more fully featured. But they are also much bigger, 
+take longer to set up in your project, have a higher learning curve, 
+and often have a more restrictive license. If you are working with 
+browsers or have more complete XML needs, TinyXML-2 is not the parser for you.
+
+TinyXML-1 vs. TinyXML-2
+-----------------------
+
+TinyXML-2 is now the focus of all development, well tested, and your
+best choice unless you have a requirement to maintain TinyXML-1 code.
+
+TinyXML-2 uses a similar API to TinyXML-1 and the same
+rich test cases. But the implementation of the parser is completely re-written
+to make it more appropriate for use in a game. It uses less memory, is faster,
+and uses far fewer memory allocations.
+
+TinyXML-2 has no requirement for STL, but has also dropped all STL support. All
+strings are query and set as 'const char*'. This allows the use of internal 
+allocators, and keeps the code much simpler.
+
+Both parsers:
+
+1.  Simple to use with similar APIs.
+2.  DOM based parser.
+3.  UTF-8 Unicode support. http://en.wikipedia.org/wiki/UTF-8
+
+Advantages of TinyXML-2
+
+1.  The focus of all future dev.
+2.  Many fewer memory allocation (1/10th to 1/100th), uses less memory
+    (about 40% of TinyXML-1), and faster.
+3.  No STL requirement.
+4.  More modern C++, including a proper namespace.
+5.  Proper and useful handling of whitespace
+
+Advantages of TinyXML-1
+
+1.  Can report the location of parsing errors.
+2.  Support for some C++ STL conventions: streams and strings
+3.  Very mature and well debugged code base.
+
+Features
+--------
+
+### Memory Model
+
+An XMLDocument is a C++ object like any other, that can be on the stack, or
+new'd and deleted on the heap.
+
+However, any sub-node of the Document, XMLElement, XMLText, etc, can only
+be created by calling the appropriate XMLDocument::NewElement, NewText, etc.
+method. Although you have pointers to these objects, they are still owned
+by the Document. When the Document is deleted, so are all the nodes it contains.
+
+### White Space
+
+#### Whitespace Preservation (default)
+
+Microsoft has an excellent article on white space: http://msdn.microsoft.com/en-us/library/ms256097.aspx
+
+By default, TinyXML-2 preserves white space in a (hopefully) sane way that is almost complient with the
+spec. (TinyXML-1 used a completely different model, much more similar to 'collapse', below.)
+
+As a first step, all newlines / carriage-returns / line-feeds are normalized to a
+line-feed character, as required by the XML spec.
+
+White space in text is preserved. For example:
+
+       <element> Hello,  World</element>
+
+The leading space before the "Hello" and the double space after the comma are 
+preserved. Line-feeds are preserved, as in this example:
+
+       <element> Hello again,  
+                 World</element>
+
+However, white space between elements is **not** preserved. Although not strictly 
+compliant, tracking and reporting inter-element space is awkward, and not normally
+valuable. TinyXML-2 sees these as the same XML:
+
+       <document>
+               <data>1</data>
+               <data>2</data>
+               <data>3</data>
+       </document>
+
+       <document><data>1</data><data>2</data><data>3</data></document>
+
+#### Whitespace Collapse
+
+For some applications, it is preferable to collapse whitespace. Collapsing
+whitespace gives you "HTML-like" behavior, which is sometimes more suitable
+for hand typed documents. 
+
+TinyXML-2 supports this with the 'whitespace' parameter to the XMLDocument constructor.
+(The default is to preserve whitespace, as described above.)
+
+However, you may also use COLLAPSE_WHITESPACE, which will:
+
+* Remove leading and trailing whitespace
+* Convert newlines and line-feeds into a space character
+* Collapse a run of any number of space characters into a single space character
+
+Note that (currently) there is a performance impact for using COLLAPSE_WHITESPACE.
+It essentially causes the XML to be parsed twice.
+
+### Entities
+
+TinyXML-2 recognizes the pre-defined "character entities", meaning special
+characters. Namely:
+
+       &amp;   &
+       &lt;    <
+       &gt;    >
+       &quot;  "
+       &apos;  '
+
+These are recognized when the XML document is read, and translated to their
+UTF-8 equivalents. For instance, text with the XML of:
+
+       Far &amp; Away
+
+will have the Value() of "Far & Away" when queried from the XMLText object,
+and will be written back to the XML stream/file as an ampersand. 
+
+Additionally, any character can be specified by its Unicode code point:
+The syntax `&#xA0;` or `&#160;` are both to the non-breaking space character. 
+This is called a 'numeric character reference'. Any numeric character reference
+that isn't one of the special entities above, will be read, but written as a
+regular code point. The output is correct, but the entity syntax isn't preserved.
+
+### Printing
+
+#### Print to file
+You can directly use the convenience function:
+
+       XMLDocument doc;
+       ...
+       doc.SaveFile( "foo.xml" );
+
+Or the XMLPrinter class:
+
+       XMLPrinter printer( fp );
+       doc.Print( &printer );
+
+#### Print to memory
+Printing to memory is supported by the XMLPrinter.
+
+       XMLPrinter printer;
+       doc.Print( &printer );
+       // printer.CStr() has a const char* to the XML
+
+#### Print without an XMLDocument
+
+When loading, an XML parser is very useful. However, sometimes
+when saving, it just gets in the way. The code is often set up
+for streaming, and constructing the DOM is just overhead.
+
+The Printer supports the streaming case. The following code
+prints out a trivially simple XML file without ever creating
+an XML document.
+
+       XMLPrinter printer( fp );
+       printer.OpenElement( "foo" );
+       printer.PushAttribute( "foo", "bar" );
+       printer.CloseElement();
+
+Examples
+--------
+
+#### Load and parse an XML file.
+
+       /* ------ Example 1: Load and parse an XML file. ---- */        
+       {
+               XMLDocument doc;
+               doc.LoadFile( "dream.xml" );
+       }
+
+#### Lookup information.
+
+       /* ------ Example 2: Lookup information. ---- */        
+       {
+               XMLDocument doc;
+               doc.LoadFile( "dream.xml" );
+
+               // Structure of the XML file:
+               // - Element "PLAY"      the root Element, which is the 
+               //                       FirstChildElement of the Document
+               // - - Element "TITLE"   child of the root PLAY Element
+               // - - - Text            child of the TITLE Element
+               
+               // Navigate to the title, using the convenience function,
+               // with a dangerous lack of error checking.
+               const char* title = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->GetText();
+               printf( "Name of play (1): %s\n", title );
+               
+               // Text is just another Node to TinyXML-2. The more
+               // general way to get to the XMLText:
+               XMLText* textNode = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->FirstChild()->ToText();
+               title = textNode->Value();
+               printf( "Name of play (2): %s\n", title );
+       }
+
+Using and Installing
+--------------------
+
+There are 2 files in TinyXML-2:
+* tinyxml2.cpp
+* tinyxml2.h
+
+And additionally a test file:
+* xmltest.cpp
+
+Simply compile and run. There is a visual studio 2010 project included, a simple Makefile, 
+an XCode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you. 
+The top of tinyxml.h even has a simple g++ command line if you are are *nix and don't want 
+to use a build system.
+
+Versioning
+----------
+
+TinyXML-2 uses semantic versioning. http://semver.org/ Releases are now tagged in github.
+
+Note that the major version will (probably) change fairly rapidly. API changes are fairly
+common.
+
+Documentation
+-------------
+
+The documentation is build with Doxygen, using the 'dox' 
+configuration file.
+
+License
+-------
+
+TinyXML-2 is released under the zlib license:
+
+This software is provided 'as-is', without any express or implied 
+warranty. In no event will the authors be held liable for any 
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any 
+purpose, including commercial applications, and to alter it and 
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must 
+not claim that you wrote the original software. If you use this 
+software in a product, an acknowledgment in the product documentation 
+would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and 
+must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source 
+distribution.
+
+Contributors
+------------
+
+Thanks very much to everyone who sends suggestions, bugs, ideas, and 
+encouragement. It all helps, and makes this project fun.
+
+The original TinyXML-1 has many contributors, who all deserve thanks
+in shaping what is a very successful library. Extra thanks to Yves
+Berquin and Andrew Ellerton who were key contributors.
+
+TinyXML-2 grew from that effort. Lee Thomason is the original author
+of TinyXML-2 (and TinyXML-1) but TinyXML-2 has been and is being improved
+by many contributors.
+
+Thanks to John Mackay at http://john.mackay.rosalilastudio.com for the TinyXML-2 logo!
+
+
diff --git a/lib/third_party/tinyxml/tinyxml2.cpp b/lib/third_party/tinyxml/tinyxml2.cpp
new file mode 100644 (file)
index 0000000..df49d0d
--- /dev/null
@@ -0,0 +1,2467 @@
+/*\r
+Original code by Lee Thomason (www.grinninglizard.com)\r
+\r
+This software is provided 'as-is', without any express or implied\r
+warranty. In no event will the authors be held liable for any\r
+damages arising from the use of this software.\r
+\r
+Permission is granted to anyone to use this software for any\r
+purpose, including commercial applications, and to alter it and\r
+redistribute it freely, subject to the following restrictions:\r
+\r
+1. The origin of this software must not be misrepresented; you must\r
+not claim that you wrote the original software. If you use this\r
+software in a product, an acknowledgment in the product documentation\r
+would be appreciated but is not required.\r
+\r
+2. Altered source versions must be plainly marked as such, and\r
+must not be misrepresented as being the original software.\r
+\r
+3. This notice may not be removed or altered from any source\r
+distribution.\r
+*/\r
+\r
+#include "tinyxml2.h"\r
+\r
+#include <new>         // yes, this one new style header, is in the Android SDK.\r
+#if defined(ANDROID_NDK) || defined(__QNXNTO__)\r
+#   include <stddef.h>\r
+#   include <stdarg.h>\r
+#else\r
+#   include <cstddef>\r
+#   include <cstdarg>\r
+#endif\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\r
+       // Microsoft Visual Studio, version 2005 and higher. Not WinCE.\r
+       /*int _snprintf_s(\r
+          char *buffer,\r
+          size_t sizeOfBuffer,\r
+          size_t count,\r
+          const char *format [,\r
+                 argument] ...\r
+       );*/\r
+       static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )\r
+       {\r
+               va_list va;\r
+               va_start( va, format );\r
+               int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\r
+               va_end( va );\r
+               return result;\r
+       }\r
+\r
+       static inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va )\r
+       {\r
+               int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\r
+               return result;\r
+       }\r
+\r
+       #define TIXML_VSCPRINTF _vscprintf\r
+       #define TIXML_SSCANF    sscanf_s\r
+#elif defined _MSC_VER\r
+       // Microsoft Visual Studio 2003 and earlier or WinCE\r
+       #define TIXML_SNPRINTF  _snprintf\r
+       #define TIXML_VSNPRINTF _vsnprintf\r
+       #define TIXML_SSCANF    sscanf\r
+       #if (_MSC_VER < 1400 ) && (!defined WINCE)\r
+               // Microsoft Visual Studio 2003 and not WinCE.\r
+               #define TIXML_VSCPRINTF   _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have.\r
+       #else\r
+               // Microsoft Visual Studio 2003 and earlier or WinCE.\r
+               static inline int TIXML_VSCPRINTF( const char* format, va_list va )\r
+               {\r
+                       int len = 512;\r
+                       for (;;) {\r
+                               len = len*2;\r
+                               char* str = new char[len]();\r
+                               const int required = _vsnprintf(str, len, format, va);\r
+                               delete[] str;\r
+                               if ( required != -1 ) {\r
+                                       TIXMLASSERT( required >= 0 );\r
+                                       len = required;\r
+                                       break;\r
+                               }\r
+                       }\r
+                       TIXMLASSERT( len >= 0 );\r
+                       return len;\r
+               }\r
+       #endif\r
+#else\r
+       // GCC version 3 and higher\r
+       //#warning( "Using sn* functions." )\r
+       #define TIXML_SNPRINTF  snprintf\r
+       #define TIXML_VSNPRINTF vsnprintf\r
+       static inline int TIXML_VSCPRINTF( const char* format, va_list va )\r
+       {\r
+               int len = vsnprintf( 0, 0, format, va );\r
+               TIXMLASSERT( len >= 0 );\r
+               return len;\r
+       }\r
+       #define TIXML_SSCANF   sscanf\r
+#endif\r
+\r
+\r
+static const char LINE_FEED                            = (char)0x0a;                   // all line endings are normalized to LF\r
+static const char LF = LINE_FEED;\r
+static const char CARRIAGE_RETURN              = (char)0x0d;                   // CR gets filtered out\r
+static const char CR = CARRIAGE_RETURN;\r
+static const char SINGLE_QUOTE                 = '\'';\r
+static const char DOUBLE_QUOTE                 = '\"';\r
+\r
+// Bunch of unicode info at:\r
+//             http://www.unicode.org/faq/utf_bom.html\r
+//     ef bb bf (Microsoft "lead bytes") - designates UTF-8\r
+\r
+static const unsigned char TIXML_UTF_LEAD_0 = 0xefU;\r
+static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;\r
+static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;\r
+\r
+namespace tinyxml2\r
+{\r
+\r
+struct Entity {\r
+    const char* pattern;\r
+    int length;\r
+    char value;\r
+};\r
+\r
+static const int NUM_ENTITIES = 5;\r
+static const Entity entities[NUM_ENTITIES] = {\r
+    { "quot", 4,       DOUBLE_QUOTE },\r
+    { "amp", 3,                '&'  },\r
+    { "apos", 4,       SINGLE_QUOTE },\r
+    { "lt",    2,              '<'      },\r
+    { "gt",    2,              '>'      }\r
+};\r
+\r
+\r
+StrPair::~StrPair()\r
+{\r
+    Reset();\r
+}\r
+\r
+\r
+void StrPair::TransferTo( StrPair* other )\r
+{\r
+    if ( this == other ) {\r
+        return;\r
+    }\r
+    // This in effect implements the assignment operator by "moving"\r
+    // ownership (as in auto_ptr).\r
+\r
+    TIXMLASSERT( other->_flags == 0 );\r
+    TIXMLASSERT( other->_start == 0 );\r
+    TIXMLASSERT( other->_end == 0 );\r
+\r
+    other->Reset();\r
+\r
+    other->_flags = _flags;\r
+    other->_start = _start;\r
+    other->_end = _end;\r
+\r
+    _flags = 0;\r
+    _start = 0;\r
+    _end = 0;\r
+}\r
+\r
+void StrPair::Reset()\r
+{\r
+    if ( _flags & NEEDS_DELETE ) {\r
+        delete [] _start;\r
+    }\r
+    _flags = 0;\r
+    _start = 0;\r
+    _end = 0;\r
+}\r
+\r
+\r
+void StrPair::SetStr( const char* str, int flags )\r
+{\r
+    TIXMLASSERT( str );\r
+    Reset();\r
+    size_t len = strlen( str );\r
+    TIXMLASSERT( _start == 0 );\r
+    _start = new char[ len+1 ];\r
+    memcpy( _start, str, len+1 );\r
+    _end = _start + len;\r
+    _flags = flags | NEEDS_DELETE;\r
+}\r
+\r
+\r
+char* StrPair::ParseText( char* p, const char* endTag, int strFlags )\r
+{\r
+    TIXMLASSERT( endTag && *endTag );\r
+\r
+    char* start = p;\r
+    char  endChar = *endTag;\r
+    size_t length = strlen( endTag );\r
+\r
+    // Inner loop of text parsing.\r
+    while ( *p ) {\r
+        if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) {\r
+            Set( start, p, strFlags );\r
+            return p + length;\r
+        }\r
+        ++p;\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+char* StrPair::ParseName( char* p )\r
+{\r
+    if ( !p || !(*p) ) {\r
+        return 0;\r
+    }\r
+    if ( !XMLUtil::IsNameStartChar( *p ) ) {\r
+        return 0;\r
+    }\r
+\r
+    char* const start = p;\r
+    ++p;\r
+    while ( *p && XMLUtil::IsNameChar( *p ) ) {\r
+        ++p;\r
+    }\r
+\r
+    Set( start, p, 0 );\r
+    return p;\r
+}\r
+\r
+\r
+void StrPair::CollapseWhitespace()\r
+{\r
+    // Adjusting _start would cause undefined behavior on delete[]\r
+    TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 );\r
+    // Trim leading space.\r
+    _start = XMLUtil::SkipWhiteSpace( _start );\r
+\r
+    if ( *_start ) {\r
+        char* p = _start;      // the read pointer\r
+        char* q = _start;      // the write pointer\r
+\r
+        while( *p ) {\r
+            if ( XMLUtil::IsWhiteSpace( *p )) {\r
+                p = XMLUtil::SkipWhiteSpace( p );\r
+                if ( *p == 0 ) {\r
+                    break;    // don't write to q; this trims the trailing space.\r
+                }\r
+                *q = ' ';\r
+                ++q;\r
+            }\r
+            *q = *p;\r
+            ++q;\r
+            ++p;\r
+        }\r
+        *q = 0;\r
+    }\r
+}\r
+\r
+\r
+const char* StrPair::GetStr()\r
+{\r
+    TIXMLASSERT( _start );\r
+    TIXMLASSERT( _end );\r
+    if ( _flags & NEEDS_FLUSH ) {\r
+        *_end = 0;\r
+        _flags ^= NEEDS_FLUSH;\r
+\r
+        if ( _flags ) {\r
+            char* p = _start;  // the read pointer\r
+            char* q = _start;  // the write pointer\r
+\r
+            while( p < _end ) {\r
+                if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) {\r
+                    // CR-LF pair becomes LF\r
+                    // CR alone becomes LF\r
+                    // LF-CR becomes LF\r
+                    if ( *(p+1) == LF ) {\r
+                        p += 2;\r
+                    }\r
+                    else {\r
+                        ++p;\r
+                    }\r
+                    *q++ = LF;\r
+                }\r
+                else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {\r
+                    if ( *(p+1) == CR ) {\r
+                        p += 2;\r
+                    }\r
+                    else {\r
+                        ++p;\r
+                    }\r
+                    *q++ = LF;\r
+                }\r
+                else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {\r
+                    // Entities handled by tinyXML2:\r
+                    // - special entities in the entity table [in/out]\r
+                    // - numeric character reference [in]\r
+                    //   &#20013; or &#x4e2d;\r
+\r
+                    if ( *(p+1) == '#' ) {\r
+                        const int buflen = 10;\r
+                        char buf[buflen] = { 0 };\r
+                        int len = 0;\r
+                        char* adjusted = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) );\r
+                        if ( adjusted == 0 ) {\r
+                            *q = *p;\r
+                            ++p;\r
+                            ++q;\r
+                        }\r
+                        else {\r
+                            TIXMLASSERT( 0 <= len && len <= buflen );\r
+                            TIXMLASSERT( q + len <= adjusted );\r
+                            p = adjusted;\r
+                            memcpy( q, buf, len );\r
+                            q += len;\r
+                        }\r
+                    }\r
+                    else {\r
+                        bool entityFound = false;\r
+                        for( int i = 0; i < NUM_ENTITIES; ++i ) {\r
+                            const Entity& entity = entities[i];\r
+                            if ( strncmp( p + 1, entity.pattern, entity.length ) == 0\r
+                                    && *( p + entity.length + 1 ) == ';' ) {\r
+                                // Found an entity - convert.\r
+                                *q = entity.value;\r
+                                ++q;\r
+                                p += entity.length + 2;\r
+                                entityFound = true;\r
+                                break;\r
+                            }\r
+                        }\r
+                        if ( !entityFound ) {\r
+                            // fixme: treat as error?\r
+                            ++p;\r
+                            ++q;\r
+                        }\r
+                    }\r
+                }\r
+                else {\r
+                    *q = *p;\r
+                    ++p;\r
+                    ++q;\r
+                }\r
+            }\r
+            *q = 0;\r
+        }\r
+        // The loop below has plenty going on, and this\r
+        // is a less useful mode. Break it out.\r
+        if ( _flags & NEEDS_WHITESPACE_COLLAPSING ) {\r
+            CollapseWhitespace();\r
+        }\r
+        _flags = (_flags & NEEDS_DELETE);\r
+    }\r
+    TIXMLASSERT( _start );\r
+    return _start;\r
+}\r
+\r
+\r
+\r
+\r
+// --------- XMLUtil ----------- //\r
+\r
+const char* XMLUtil::ReadBOM( const char* p, bool* bom )\r
+{\r
+    TIXMLASSERT( p );\r
+    TIXMLASSERT( bom );\r
+    *bom = false;\r
+    const unsigned char* pu = reinterpret_cast<const unsigned char*>(p);\r
+    // Check for BOM:\r
+    if (    *(pu+0) == TIXML_UTF_LEAD_0\r
+            && *(pu+1) == TIXML_UTF_LEAD_1\r
+            && *(pu+2) == TIXML_UTF_LEAD_2 ) {\r
+        *bom = true;\r
+        p += 3;\r
+    }\r
+    TIXMLASSERT( p );\r
+    return p;\r
+}\r
+\r
+\r
+void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length )\r
+{\r
+    const unsigned long BYTE_MASK = 0xBF;\r
+    const unsigned long BYTE_MARK = 0x80;\r
+    const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };\r
+\r
+    if (input < 0x80) {\r
+        *length = 1;\r
+    }\r
+    else if ( input < 0x800 ) {\r
+        *length = 2;\r
+    }\r
+    else if ( input < 0x10000 ) {\r
+        *length = 3;\r
+    }\r
+    else if ( input < 0x200000 ) {\r
+        *length = 4;\r
+    }\r
+    else {\r
+        *length = 0;    // This code won't convert this correctly anyway.\r
+        return;\r
+    }\r
+\r
+    output += *length;\r
+\r
+    // Scary scary fall throughs.\r
+    switch (*length) {\r
+        case 4:\r
+            --output;\r
+            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\r
+            input >>= 6;\r
+        case 3:\r
+            --output;\r
+            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\r
+            input >>= 6;\r
+        case 2:\r
+            --output;\r
+            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\r
+            input >>= 6;\r
+        case 1:\r
+            --output;\r
+            *output = (char)(input | FIRST_BYTE_MARK[*length]);\r
+            break;\r
+        default:\r
+            TIXMLASSERT( false );\r
+    }\r
+}\r
+\r
+\r
+const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )\r
+{\r
+    // Presume an entity, and pull it out.\r
+    *length = 0;\r
+\r
+    if ( *(p+1) == '#' && *(p+2) ) {\r
+        unsigned long ucs = 0;\r
+        TIXMLASSERT( sizeof( ucs ) >= 4 );\r
+        ptrdiff_t delta = 0;\r
+        unsigned mult = 1;\r
+        static const char SEMICOLON = ';';\r
+\r
+        if ( *(p+2) == 'x' ) {\r
+            // Hexadecimal.\r
+            const char* q = p+3;\r
+            if ( !(*q) ) {\r
+                return 0;\r
+            }\r
+\r
+            q = strchr( q, SEMICOLON );\r
+\r
+            if ( !q ) {\r
+                return 0;\r
+            }\r
+            TIXMLASSERT( *q == SEMICOLON );\r
+\r
+            delta = q-p;\r
+            --q;\r
+\r
+            while ( *q != 'x' ) {\r
+                unsigned int digit = 0;\r
+\r
+                if ( *q >= '0' && *q <= '9' ) {\r
+                    digit = *q - '0';\r
+                }\r
+                else if ( *q >= 'a' && *q <= 'f' ) {\r
+                    digit = *q - 'a' + 10;\r
+                }\r
+                else if ( *q >= 'A' && *q <= 'F' ) {\r
+                    digit = *q - 'A' + 10;\r
+                }\r
+                else {\r
+                    return 0;\r
+                }\r
+                TIXMLASSERT( digit >= 0 && digit < 16);\r
+                TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\r
+                const unsigned int digitScaled = mult * digit;\r
+                TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\r
+                ucs += digitScaled;\r
+                TIXMLASSERT( mult <= UINT_MAX / 16 );\r
+                mult *= 16;\r
+                --q;\r
+            }\r
+        }\r
+        else {\r
+            // Decimal.\r
+            const char* q = p+2;\r
+            if ( !(*q) ) {\r
+                return 0;\r
+            }\r
+\r
+            q = strchr( q, SEMICOLON );\r
+\r
+            if ( !q ) {\r
+                return 0;\r
+            }\r
+            TIXMLASSERT( *q == SEMICOLON );\r
+\r
+            delta = q-p;\r
+            --q;\r
+\r
+            while ( *q != '#' ) {\r
+                if ( *q >= '0' && *q <= '9' ) {\r
+                    const unsigned int digit = *q - '0';\r
+                    TIXMLASSERT( digit >= 0 && digit < 10);\r
+                    TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\r
+                    const unsigned int digitScaled = mult * digit;\r
+                    TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\r
+                    ucs += digitScaled;\r
+                }\r
+                else {\r
+                    return 0;\r
+                }\r
+                TIXMLASSERT( mult <= UINT_MAX / 10 );\r
+                mult *= 10;\r
+                --q;\r
+            }\r
+        }\r
+        // convert the UCS to UTF-8\r
+        ConvertUTF32ToUTF8( ucs, value, length );\r
+        return p + delta + 1;\r
+    }\r
+    return p+1;\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( int v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%d", v );\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%u", v );\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( bool v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 );\r
+}\r
+\r
+/*\r
+       ToStr() of a number is a very tricky topic.\r
+       https://github.com/leethomason/tinyxml2/issues/106\r
+*/\r
+void XMLUtil::ToStr( float v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%.8g", v );\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( double v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%.17g", v );\r
+}\r
+\r
+\r
+bool XMLUtil::ToInt( const char* str, int* value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%d", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+bool XMLUtil::ToUnsigned( const char* str, unsigned *value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%u", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+bool XMLUtil::ToBool( const char* str, bool* value )\r
+{\r
+    int ival = 0;\r
+    if ( ToInt( str, &ival )) {\r
+        *value = (ival==0) ? false : true;\r
+        return true;\r
+    }\r
+    if ( StringEqual( str, "true" ) ) {\r
+        *value = true;\r
+        return true;\r
+    }\r
+    else if ( StringEqual( str, "false" ) ) {\r
+        *value = false;\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+\r
+bool XMLUtil::ToFloat( const char* str, float* value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%f", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+bool XMLUtil::ToDouble( const char* str, double* value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+\r
+char* XMLDocument::Identify( char* p, XMLNode** node )\r
+{\r
+    TIXMLASSERT( node );\r
+    TIXMLASSERT( p );\r
+    char* const start = p;\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    if( !*p ) {\r
+        *node = 0;\r
+        TIXMLASSERT( p );\r
+        return p;\r
+    }\r
+\r
+    // These strings define the matching patterns:\r
+    static const char* xmlHeader               = { "<?" };\r
+    static const char* commentHeader   = { "<!--" };\r
+    static const char* cdataHeader             = { "<![CDATA[" };\r
+    static const char* dtdHeader               = { "<!" };\r
+    static const char* elementHeader   = { "<" };      // and a header for everything else; check last.\r
+\r
+    static const int xmlHeaderLen              = 2;\r
+    static const int commentHeaderLen  = 4;\r
+    static const int cdataHeaderLen            = 9;\r
+    static const int dtdHeaderLen              = 2;\r
+    static const int elementHeaderLen  = 1;\r
+\r
+    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) );               // use same memory pool\r
+    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) );   // use same memory pool\r
+    XMLNode* returnNode = 0;\r
+    if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );\r
+        returnNode = new (_commentPool.Alloc()) XMLDeclaration( this );\r
+        returnNode->_memPool = &_commentPool;\r
+        p += xmlHeaderLen;\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLComment ) == _commentPool.ItemSize() );\r
+        returnNode = new (_commentPool.Alloc()) XMLComment( this );\r
+        returnNode->_memPool = &_commentPool;\r
+        p += commentHeaderLen;\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
+        XMLText* text = new (_textPool.Alloc()) XMLText( this );\r
+        returnNode = text;\r
+        returnNode->_memPool = &_textPool;\r
+        p += cdataHeaderLen;\r
+        text->SetCData( true );\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLUnknown ) == _commentPool.ItemSize() );\r
+        returnNode = new (_commentPool.Alloc()) XMLUnknown( this );\r
+        returnNode->_memPool = &_commentPool;\r
+        p += dtdHeaderLen;\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLElement ) == _elementPool.ItemSize() );\r
+        returnNode = new (_elementPool.Alloc()) XMLElement( this );\r
+        returnNode->_memPool = &_elementPool;\r
+        p += elementHeaderLen;\r
+    }\r
+    else {\r
+        TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
+        returnNode = new (_textPool.Alloc()) XMLText( this );\r
+        returnNode->_memPool = &_textPool;\r
+        p = start;     // Back it up, all the text counts.\r
+    }\r
+\r
+    TIXMLASSERT( returnNode );\r
+    TIXMLASSERT( p );\r
+    *node = returnNode;\r
+    return p;\r
+}\r
+\r
+\r
+bool XMLDocument::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    if ( visitor->VisitEnter( *this ) ) {\r
+        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\r
+            if ( !node->Accept( visitor ) ) {\r
+                break;\r
+            }\r
+        }\r
+    }\r
+    return visitor->VisitExit( *this );\r
+}\r
+\r
+\r
+// --------- XMLNode ----------- //\r
+\r
+XMLNode::XMLNode( XMLDocument* doc ) :\r
+    _document( doc ),\r
+    _parent( 0 ),\r
+    _firstChild( 0 ), _lastChild( 0 ),\r
+    _prev( 0 ), _next( 0 ),\r
+    _memPool( 0 )\r
+{\r
+}\r
+\r
+\r
+XMLNode::~XMLNode()\r
+{\r
+    DeleteChildren();\r
+    if ( _parent ) {\r
+        _parent->Unlink( this );\r
+    }\r
+}\r
+\r
+const char* XMLNode::Value() const \r
+{\r
+    // Catch an edge case: XMLDocuments don't have a a Value. Carefully return nullptr.\r
+    if ( this->ToDocument() )\r
+        return 0;\r
+    return _value.GetStr();\r
+}\r
+\r
+void XMLNode::SetValue( const char* str, bool staticMem )\r
+{\r
+    if ( staticMem ) {\r
+        _value.SetInternedStr( str );\r
+    }\r
+    else {\r
+        _value.SetStr( str );\r
+    }\r
+}\r
+\r
+\r
+void XMLNode::DeleteChildren()\r
+{\r
+    while( _firstChild ) {\r
+        TIXMLASSERT( _lastChild );\r
+        TIXMLASSERT( _firstChild->_document == _document );\r
+        XMLNode* node = _firstChild;\r
+        Unlink( node );\r
+\r
+        DeleteNode( node );\r
+    }\r
+    _firstChild = _lastChild = 0;\r
+}\r
+\r
+\r
+void XMLNode::Unlink( XMLNode* child )\r
+{\r
+    TIXMLASSERT( child );\r
+    TIXMLASSERT( child->_document == _document );\r
+    TIXMLASSERT( child->_parent == this );\r
+    if ( child == _firstChild ) {\r
+        _firstChild = _firstChild->_next;\r
+    }\r
+    if ( child == _lastChild ) {\r
+        _lastChild = _lastChild->_prev;\r
+    }\r
+\r
+    if ( child->_prev ) {\r
+        child->_prev->_next = child->_next;\r
+    }\r
+    if ( child->_next ) {\r
+        child->_next->_prev = child->_prev;\r
+    }\r
+       child->_parent = 0;\r
+}\r
+\r
+\r
+void XMLNode::DeleteChild( XMLNode* node )\r
+{\r
+    TIXMLASSERT( node );\r
+    TIXMLASSERT( node->_document == _document );\r
+    TIXMLASSERT( node->_parent == this );\r
+    Unlink( node );\r
+    DeleteNode( node );\r
+}\r
+\r
+\r
+XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )\r
+{\r
+    TIXMLASSERT( addThis );\r
+    if ( addThis->_document != _document ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+    InsertChildPreamble( addThis );\r
+\r
+    if ( _lastChild ) {\r
+        TIXMLASSERT( _firstChild );\r
+        TIXMLASSERT( _lastChild->_next == 0 );\r
+        _lastChild->_next = addThis;\r
+        addThis->_prev = _lastChild;\r
+        _lastChild = addThis;\r
+\r
+        addThis->_next = 0;\r
+    }\r
+    else {\r
+        TIXMLASSERT( _firstChild == 0 );\r
+        _firstChild = _lastChild = addThis;\r
+\r
+        addThis->_prev = 0;\r
+        addThis->_next = 0;\r
+    }\r
+    addThis->_parent = this;\r
+    return addThis;\r
+}\r
+\r
+\r
+XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )\r
+{\r
+    TIXMLASSERT( addThis );\r
+    if ( addThis->_document != _document ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+    InsertChildPreamble( addThis );\r
+\r
+    if ( _firstChild ) {\r
+        TIXMLASSERT( _lastChild );\r
+        TIXMLASSERT( _firstChild->_prev == 0 );\r
+\r
+        _firstChild->_prev = addThis;\r
+        addThis->_next = _firstChild;\r
+        _firstChild = addThis;\r
+\r
+        addThis->_prev = 0;\r
+    }\r
+    else {\r
+        TIXMLASSERT( _lastChild == 0 );\r
+        _firstChild = _lastChild = addThis;\r
+\r
+        addThis->_prev = 0;\r
+        addThis->_next = 0;\r
+    }\r
+    addThis->_parent = this;\r
+    return addThis;\r
+}\r
+\r
+\r
+XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )\r
+{\r
+    TIXMLASSERT( addThis );\r
+    if ( addThis->_document != _document ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+\r
+    TIXMLASSERT( afterThis );\r
+\r
+    if ( afterThis->_parent != this ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+\r
+    if ( afterThis->_next == 0 ) {\r
+        // The last node or the only node.\r
+        return InsertEndChild( addThis );\r
+    }\r
+    InsertChildPreamble( addThis );\r
+    addThis->_prev = afterThis;\r
+    addThis->_next = afterThis->_next;\r
+    afterThis->_next->_prev = addThis;\r
+    afterThis->_next = addThis;\r
+    addThis->_parent = this;\r
+    return addThis;\r
+}\r
+\r
+\r
+\r
+\r
+const XMLElement* XMLNode::FirstChildElement( const char* name ) const\r
+{\r
+    for( const XMLNode* node = _firstChild; node; node = node->_next ) {\r
+        const XMLElement* element = node->ToElement();\r
+        if ( element ) {\r
+            if ( !name || XMLUtil::StringEqual( element->Name(), name ) ) {\r
+                return element;\r
+            }\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const XMLElement* XMLNode::LastChildElement( const char* name ) const\r
+{\r
+    for( const XMLNode* node = _lastChild; node; node = node->_prev ) {\r
+        const XMLElement* element = node->ToElement();\r
+        if ( element ) {\r
+            if ( !name || XMLUtil::StringEqual( element->Name(), name ) ) {\r
+                return element;\r
+            }\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const XMLElement* XMLNode::NextSiblingElement( const char* name ) const\r
+{\r
+    for( const XMLNode* node = _next; node; node = node->_next ) {\r
+        const XMLElement* element = node->ToElement();\r
+        if ( element\r
+                && (!name || XMLUtil::StringEqual( name, element->Name() ))) {\r
+            return element;\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const\r
+{\r
+    for( const XMLNode* node = _prev; node; node = node->_prev ) {\r
+        const XMLElement* element = node->ToElement();\r
+        if ( element\r
+                && (!name || XMLUtil::StringEqual( name, element->Name() ))) {\r
+            return element;\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )\r
+{\r
+    // This is a recursive method, but thinking about it "at the current level"\r
+    // it is a pretty simple flat list:\r
+    //         <foo/>\r
+    //         <!-- comment -->\r
+    //\r
+    // With a special case:\r
+    //         <foo>\r
+    //         </foo>\r
+    //         <!-- comment -->\r
+    //\r
+    // Where the closing element (/foo) *must* be the next thing after the opening\r
+    // element, and the names must match. BUT the tricky bit is that the closing\r
+    // element will be read by the child.\r
+    //\r
+    // 'endTag' is the end tag for this node, it is returned by a call to a child.\r
+    // 'parentEnd' is the end tag for the parent, which is filled in and returned.\r
+\r
+    while( p && *p ) {\r
+        XMLNode* node = 0;\r
+\r
+        p = _document->Identify( p, &node );\r
+        if ( node == 0 ) {\r
+            break;\r
+        }\r
+\r
+        StrPair endTag;\r
+        p = node->ParseDeep( p, &endTag );\r
+        if ( !p ) {\r
+            DeleteNode( node );\r
+            if ( !_document->Error() ) {\r
+                _document->SetError( XML_ERROR_PARSING, 0, 0 );\r
+            }\r
+            break;\r
+        }\r
+\r
+        XMLDeclaration* decl = node->ToDeclaration();\r
+        if ( decl ) {\r
+                // A declaration can only be the first child of a document.\r
+                // Set error, if document already has children.\r
+                if ( !_document->NoChildren() ) {\r
+                        _document->SetError( XML_ERROR_PARSING_DECLARATION, decl->Value(), 0);\r
+                        DeleteNode( decl );\r
+                        break;\r
+                }\r
+        }\r
+\r
+        XMLElement* ele = node->ToElement();\r
+        if ( ele ) {\r
+            // We read the end tag. Return it to the parent.\r
+            if ( ele->ClosingType() == XMLElement::CLOSING ) {\r
+                if ( parentEnd ) {\r
+                    ele->_value.TransferTo( parentEnd );\r
+                }\r
+                node->_memPool->SetTracked();   // created and then immediately deleted.\r
+                DeleteNode( node );\r
+                return p;\r
+            }\r
+\r
+            // Handle an end tag returned to this level.\r
+            // And handle a bunch of annoying errors.\r
+            bool mismatch = false;\r
+            if ( endTag.Empty() ) {\r
+                if ( ele->ClosingType() == XMLElement::OPEN ) {\r
+                    mismatch = true;\r
+                }\r
+            }\r
+            else {\r
+                if ( ele->ClosingType() != XMLElement::OPEN ) {\r
+                    mismatch = true;\r
+                }\r
+                else if ( !XMLUtil::StringEqual( endTag.GetStr(), ele->Name() ) ) {\r
+                    mismatch = true;\r
+                }\r
+            }\r
+            if ( mismatch ) {\r
+                _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, ele->Name(), 0 );\r
+                DeleteNode( node );\r
+                break;\r
+            }\r
+        }\r
+        InsertEndChild( node );\r
+    }\r
+    return 0;\r
+}\r
+\r
+void XMLNode::DeleteNode( XMLNode* node )\r
+{\r
+    if ( node == 0 ) {\r
+        return;\r
+    }\r
+    MemPool* pool = node->_memPool;\r
+    node->~XMLNode();\r
+    pool->Free( node );\r
+}\r
+\r
+void XMLNode::InsertChildPreamble( XMLNode* insertThis ) const\r
+{\r
+    TIXMLASSERT( insertThis );\r
+    TIXMLASSERT( insertThis->_document == _document );\r
+\r
+    if ( insertThis->_parent )\r
+        insertThis->_parent->Unlink( insertThis );\r
+    else\r
+        insertThis->_memPool->SetTracked();\r
+}\r
+\r
+// --------- XMLText ---------- //\r
+char* XMLText::ParseDeep( char* p, StrPair* )\r
+{\r
+    const char* start = p;\r
+    if ( this->CData() ) {\r
+        p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
+        if ( !p ) {\r
+            _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 );\r
+        }\r
+        return p;\r
+    }\r
+    else {\r
+        int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES;\r
+        if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) {\r
+            flags |= StrPair::NEEDS_WHITESPACE_COLLAPSING;\r
+        }\r
+\r
+        p = _value.ParseText( p, "<", flags );\r
+        if ( p && *p ) {\r
+            return p-1;\r
+        }\r
+        if ( !p ) {\r
+            _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 );\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLText* text = doc->NewText( Value() );   // fixme: this will always allocate memory. Intern?\r
+    text->SetCData( this->CData() );\r
+    return text;\r
+}\r
+\r
+\r
+bool XMLText::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    const XMLText* text = compare->ToText();\r
+    return ( text && XMLUtil::StringEqual( text->Value(), Value() ) );\r
+}\r
+\r
+\r
+bool XMLText::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+\r
+// --------- XMLComment ---------- //\r
+\r
+XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc )\r
+{\r
+}\r
+\r
+\r
+XMLComment::~XMLComment()\r
+{\r
+}\r
+\r
+\r
+char* XMLComment::ParseDeep( char* p, StrPair* )\r
+{\r
+    // Comment parses as text.\r
+    const char* start = p;\r
+    p = _value.ParseText( p, "-->", StrPair::COMMENT );\r
+    if ( p == 0 ) {\r
+        _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 );\r
+    }\r
+    return p;\r
+}\r
+\r
+\r
+XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLComment* comment = doc->NewComment( Value() );  // fixme: this will always allocate memory. Intern?\r
+    return comment;\r
+}\r
+\r
+\r
+bool XMLComment::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLComment* comment = compare->ToComment();\r
+    return ( comment && XMLUtil::StringEqual( comment->Value(), Value() ));\r
+}\r
+\r
+\r
+bool XMLComment::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+\r
+// --------- XMLDeclaration ---------- //\r
+\r
+XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc )\r
+{\r
+}\r
+\r
+\r
+XMLDeclaration::~XMLDeclaration()\r
+{\r
+    //printf( "~XMLDeclaration\n" );\r
+}\r
+\r
+\r
+char* XMLDeclaration::ParseDeep( char* p, StrPair* )\r
+{\r
+    // Declaration parses as text.\r
+    const char* start = p;\r
+    p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
+    if ( p == 0 ) {\r
+        _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 );\r
+    }\r
+    return p;\r
+}\r
+\r
+\r
+XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLDeclaration* dec = doc->NewDeclaration( Value() );      // fixme: this will always allocate memory. Intern?\r
+    return dec;\r
+}\r
+\r
+\r
+bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLDeclaration* declaration = compare->ToDeclaration();\r
+    return ( declaration && XMLUtil::StringEqual( declaration->Value(), Value() ));\r
+}\r
+\r
+\r
+\r
+bool XMLDeclaration::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+// --------- XMLUnknown ---------- //\r
+\r
+XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc )\r
+{\r
+}\r
+\r
+\r
+XMLUnknown::~XMLUnknown()\r
+{\r
+}\r
+\r
+\r
+char* XMLUnknown::ParseDeep( char* p, StrPair* )\r
+{\r
+    // Unknown parses as text.\r
+    const char* start = p;\r
+\r
+    p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
+    if ( !p ) {\r
+        _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 );\r
+    }\r
+    return p;\r
+}\r
+\r
+\r
+XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLUnknown* text = doc->NewUnknown( Value() );     // fixme: this will always allocate memory. Intern?\r
+    return text;\r
+}\r
+\r
+\r
+bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLUnknown* unknown = compare->ToUnknown();\r
+    return ( unknown && XMLUtil::StringEqual( unknown->Value(), Value() ));\r
+}\r
+\r
+\r
+bool XMLUnknown::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+// --------- XMLAttribute ---------- //\r
+\r
+const char* XMLAttribute::Name() const \r
+{\r
+    return _name.GetStr();\r
+}\r
+\r
+const char* XMLAttribute::Value() const \r
+{\r
+    return _value.GetStr();\r
+}\r
+\r
+char* XMLAttribute::ParseDeep( char* p, bool processEntities )\r
+{\r
+    // Parse using the name rules: bug fix, was using ParseText before\r
+    p = _name.ParseName( p );\r
+    if ( !p || !*p ) {\r
+        return 0;\r
+    }\r
+\r
+    // Skip white space before =\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    if ( *p != '=' ) {\r
+        return 0;\r
+    }\r
+\r
+    ++p;       // move up to opening quote\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    if ( *p != '\"' && *p != '\'' ) {\r
+        return 0;\r
+    }\r
+\r
+    char endTag[2] = { *p, 0 };\r
+    ++p;       // move past opening quote\r
+\r
+    p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES );\r
+    return p;\r
+}\r
+\r
+\r
+void XMLAttribute::SetName( const char* n )\r
+{\r
+    _name.SetStr( n );\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryIntValue( int* value ) const\r
+{\r
+    if ( XMLUtil::ToInt( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const\r
+{\r
+    if ( XMLUtil::ToUnsigned( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryBoolValue( bool* value ) const\r
+{\r
+    if ( XMLUtil::ToBool( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryFloatValue( float* value ) const\r
+{\r
+    if ( XMLUtil::ToFloat( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryDoubleValue( double* value ) const\r
+{\r
+    if ( XMLUtil::ToDouble( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( const char* v )\r
+{\r
+    _value.SetStr( v );\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( int v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( unsigned v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( bool v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+void XMLAttribute::SetAttribute( double v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+void XMLAttribute::SetAttribute( float v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+\r
+// --------- XMLElement ---------- //\r
+XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ),\r
+    _closingType( 0 ),\r
+    _rootAttribute( 0 )\r
+{\r
+}\r
+\r
+\r
+XMLElement::~XMLElement()\r
+{\r
+    while( _rootAttribute ) {\r
+        XMLAttribute* next = _rootAttribute->_next;\r
+        DeleteAttribute( _rootAttribute );\r
+        _rootAttribute = next;\r
+    }\r
+}\r
+\r
+\r
+const XMLAttribute* XMLElement::FindAttribute( const char* name ) const\r
+{\r
+    for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) {\r
+        if ( XMLUtil::StringEqual( a->Name(), name ) ) {\r
+            return a;\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const char* XMLElement::Attribute( const char* name, const char* value ) const\r
+{\r
+    const XMLAttribute* a = FindAttribute( name );\r
+    if ( !a ) {\r
+        return 0;\r
+    }\r
+    if ( !value || XMLUtil::StringEqual( a->Value(), value )) {\r
+        return a->Value();\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const char* XMLElement::GetText() const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        return FirstChild()->Value();\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+void   XMLElement::SetText( const char* inText )\r
+{\r
+       if ( FirstChild() && FirstChild()->ToText() )\r
+               FirstChild()->SetValue( inText );\r
+       else {\r
+               XMLText*        theText = GetDocument()->NewText( inText );\r
+               InsertFirstChild( theText );\r
+       }\r
+}\r
+\r
+\r
+void XMLElement::SetText( int v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( unsigned v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( bool v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( float v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( double v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryIntText( int* ival ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToInt( t, ival ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToUnsigned( t, uval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryBoolText( bool* bval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToBool( t, bval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryDoubleText( double* dval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToDouble( t, dval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryFloatText( float* fval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToFloat( t, fval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+\r
+XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name )\r
+{\r
+    XMLAttribute* last = 0;\r
+    XMLAttribute* attrib = 0;\r
+    for( attrib = _rootAttribute;\r
+            attrib;\r
+            last = attrib, attrib = attrib->_next ) {\r
+        if ( XMLUtil::StringEqual( attrib->Name(), name ) ) {\r
+            break;\r
+        }\r
+    }\r
+    if ( !attrib ) {\r
+        TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\r
+        attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\r
+        attrib->_memPool = &_document->_attributePool;\r
+        if ( last ) {\r
+            last->_next = attrib;\r
+        }\r
+        else {\r
+            _rootAttribute = attrib;\r
+        }\r
+        attrib->SetName( name );\r
+        attrib->_memPool->SetTracked(); // always created and linked.\r
+    }\r
+    return attrib;\r
+}\r
+\r
+\r
+void XMLElement::DeleteAttribute( const char* name )\r
+{\r
+    XMLAttribute* prev = 0;\r
+    for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) {\r
+        if ( XMLUtil::StringEqual( name, a->Name() ) ) {\r
+            if ( prev ) {\r
+                prev->_next = a->_next;\r
+            }\r
+            else {\r
+                _rootAttribute = a->_next;\r
+            }\r
+            DeleteAttribute( a );\r
+            break;\r
+        }\r
+        prev = a;\r
+    }\r
+}\r
+\r
+\r
+char* XMLElement::ParseAttributes( char* p )\r
+{\r
+    const char* start = p;\r
+    XMLAttribute* prevAttribute = 0;\r
+\r
+    // Read the attributes.\r
+    while( p ) {\r
+        p = XMLUtil::SkipWhiteSpace( p );\r
+        if ( !(*p) ) {\r
+            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() );\r
+            return 0;\r
+        }\r
+\r
+        // attribute.\r
+        if (XMLUtil::IsNameStartChar( *p ) ) {\r
+            TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\r
+            XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\r
+            attrib->_memPool = &_document->_attributePool;\r
+                       attrib->_memPool->SetTracked();\r
+\r
+            p = attrib->ParseDeep( p, _document->ProcessEntities() );\r
+            if ( !p || Attribute( attrib->Name() ) ) {\r
+                DeleteAttribute( attrib );\r
+                _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p );\r
+                return 0;\r
+            }\r
+            // There is a minor bug here: if the attribute in the source xml\r
+            // document is duplicated, it will not be detected and the\r
+            // attribute will be doubly added. However, tracking the 'prevAttribute'\r
+            // avoids re-scanning the attribute list. Preferring performance for\r
+            // now, may reconsider in the future.\r
+            if ( prevAttribute ) {\r
+                prevAttribute->_next = attrib;\r
+            }\r
+            else {\r
+                _rootAttribute = attrib;\r
+            }\r
+            prevAttribute = attrib;\r
+        }\r
+        // end of the tag\r
+        else if ( *p == '>' ) {\r
+            ++p;\r
+            break;\r
+        }\r
+        // end of the tag\r
+        else if ( *p == '/' && *(p+1) == '>' ) {\r
+            _closingType = CLOSED;\r
+            return p+2;        // done; sealed element.\r
+        }\r
+        else {\r
+            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p );\r
+            return 0;\r
+        }\r
+    }\r
+    return p;\r
+}\r
+\r
+void XMLElement::DeleteAttribute( XMLAttribute* attribute )\r
+{\r
+    if ( attribute == 0 ) {\r
+        return;\r
+    }\r
+    MemPool* pool = attribute->_memPool;\r
+    attribute->~XMLAttribute();\r
+    pool->Free( attribute );\r
+}\r
+\r
+//\r
+//     <ele></ele>\r
+//     <ele>foo<b>bar</b></ele>\r
+//\r
+char* XMLElement::ParseDeep( char* p, StrPair* strPair )\r
+{\r
+    // Read the element name.\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+\r
+    // The closing element is the </element> form. It is\r
+    // parsed just like a regular element then deleted from\r
+    // the DOM.\r
+    if ( *p == '/' ) {\r
+        _closingType = CLOSING;\r
+        ++p;\r
+    }\r
+\r
+    p = _value.ParseName( p );\r
+    if ( _value.Empty() ) {\r
+        return 0;\r
+    }\r
+\r
+    p = ParseAttributes( p );\r
+    if ( !p || !*p || _closingType ) {\r
+        return p;\r
+    }\r
+\r
+    p = XMLNode::ParseDeep( p, strPair );\r
+    return p;\r
+}\r
+\r
+\r
+\r
+XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLElement* element = doc->NewElement( Value() );                                  // fixme: this will always allocate memory. Intern?\r
+    for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) {\r
+        element->SetAttribute( a->Name(), a->Value() );                                        // fixme: this will always allocate memory. Intern?\r
+    }\r
+    return element;\r
+}\r
+\r
+\r
+bool XMLElement::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLElement* other = compare->ToElement();\r
+    if ( other && XMLUtil::StringEqual( other->Name(), Name() )) {\r
+\r
+        const XMLAttribute* a=FirstAttribute();\r
+        const XMLAttribute* b=other->FirstAttribute();\r
+\r
+        while ( a && b ) {\r
+            if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) {\r
+                return false;\r
+            }\r
+            a = a->Next();\r
+            b = b->Next();\r
+        }\r
+        if ( a || b ) {\r
+            // different count\r
+            return false;\r
+        }\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+\r
+bool XMLElement::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    if ( visitor->VisitEnter( *this, _rootAttribute ) ) {\r
+        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\r
+            if ( !node->Accept( visitor ) ) {\r
+                break;\r
+            }\r
+        }\r
+    }\r
+    return visitor->VisitExit( *this );\r
+}\r
+\r
+\r
+// --------- XMLDocument ----------- //\r
+\r
+// Warning: List must match 'enum XMLError'\r
+const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = {\r
+    "XML_SUCCESS",\r
+    "XML_NO_ATTRIBUTE",\r
+    "XML_WRONG_ATTRIBUTE_TYPE",\r
+    "XML_ERROR_FILE_NOT_FOUND",\r
+    "XML_ERROR_FILE_COULD_NOT_BE_OPENED",\r
+    "XML_ERROR_FILE_READ_ERROR",\r
+    "XML_ERROR_ELEMENT_MISMATCH",\r
+    "XML_ERROR_PARSING_ELEMENT",\r
+    "XML_ERROR_PARSING_ATTRIBUTE",\r
+    "XML_ERROR_IDENTIFYING_TAG",\r
+    "XML_ERROR_PARSING_TEXT",\r
+    "XML_ERROR_PARSING_CDATA",\r
+    "XML_ERROR_PARSING_COMMENT",\r
+    "XML_ERROR_PARSING_DECLARATION",\r
+    "XML_ERROR_PARSING_UNKNOWN",\r
+    "XML_ERROR_EMPTY_DOCUMENT",\r
+    "XML_ERROR_MISMATCHED_ELEMENT",\r
+    "XML_ERROR_PARSING",\r
+    "XML_CAN_NOT_CONVERT_TEXT",\r
+    "XML_NO_TEXT_NODE"\r
+};\r
+\r
+\r
+XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) :\r
+    XMLNode( 0 ),\r
+    _writeBOM( false ),\r
+    _processEntities( processEntities ),\r
+    _errorID( XML_NO_ERROR ),\r
+    _whitespace( whitespace ),\r
+    _errorStr1( 0 ),\r
+    _errorStr2( 0 ),\r
+    _charBuffer( 0 )\r
+{\r
+    // avoid VC++ C4355 warning about 'this' in initializer list (C4355 is off by default in VS2012+)\r
+    _document = this;\r
+}\r
+\r
+\r
+XMLDocument::~XMLDocument()\r
+{\r
+    Clear();\r
+}\r
+\r
+\r
+void XMLDocument::Clear()\r
+{\r
+    DeleteChildren();\r
+\r
+#ifdef DEBUG\r
+    const bool hadError = Error();\r
+#endif\r
+    _errorID = XML_NO_ERROR;\r
+    _errorStr1 = 0;\r
+    _errorStr2 = 0;\r
+\r
+    delete [] _charBuffer;\r
+    _charBuffer = 0;\r
+\r
+#if 0\r
+    _textPool.Trace( "text" );\r
+    _elementPool.Trace( "element" );\r
+    _commentPool.Trace( "comment" );\r
+    _attributePool.Trace( "attribute" );\r
+#endif\r
+    \r
+#ifdef DEBUG\r
+    if ( !hadError ) {\r
+        TIXMLASSERT( _elementPool.CurrentAllocs()   == _elementPool.Untracked() );\r
+        TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );\r
+        TIXMLASSERT( _textPool.CurrentAllocs()      == _textPool.Untracked() );\r
+        TIXMLASSERT( _commentPool.CurrentAllocs()   == _commentPool.Untracked() );\r
+    }\r
+#endif\r
+}\r
+\r
+\r
+XMLElement* XMLDocument::NewElement( const char* name )\r
+{\r
+    TIXMLASSERT( sizeof( XMLElement ) == _elementPool.ItemSize() );\r
+    XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this );\r
+    ele->_memPool = &_elementPool;\r
+    ele->SetName( name );\r
+    return ele;\r
+}\r
+\r
+\r
+XMLComment* XMLDocument::NewComment( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLComment ) == _commentPool.ItemSize() );\r
+    XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this );\r
+    comment->_memPool = &_commentPool;\r
+    comment->SetValue( str );\r
+    return comment;\r
+}\r
+\r
+\r
+XMLText* XMLDocument::NewText( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
+    XMLText* text = new (_textPool.Alloc()) XMLText( this );\r
+    text->_memPool = &_textPool;\r
+    text->SetValue( str );\r
+    return text;\r
+}\r
+\r
+\r
+XMLDeclaration* XMLDocument::NewDeclaration( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );\r
+    XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this );\r
+    dec->_memPool = &_commentPool;\r
+    dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" );\r
+    return dec;\r
+}\r
+\r
+\r
+XMLUnknown* XMLDocument::NewUnknown( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLUnknown ) == _commentPool.ItemSize() );\r
+    XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this );\r
+    unk->_memPool = &_commentPool;\r
+    unk->SetValue( str );\r
+    return unk;\r
+}\r
+\r
+static FILE* callfopen( const char* filepath, const char* mode )\r
+{\r
+    TIXMLASSERT( filepath );\r
+    TIXMLASSERT( mode );\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\r
+    FILE* fp = 0;\r
+    errno_t err = fopen_s( &fp, filepath, mode );\r
+    if ( err ) {\r
+        return 0;\r
+    }\r
+#else\r
+    FILE* fp = fopen( filepath, mode );\r
+#endif\r
+    return fp;\r
+}\r
+    \r
+void XMLDocument::DeleteNode( XMLNode* node )  {\r
+    TIXMLASSERT( node );\r
+    TIXMLASSERT(node->_document == this );\r
+    if (node->_parent) {\r
+        node->_parent->DeleteChild( node );\r
+    }\r
+    else {\r
+        // Isn't in the tree.\r
+        // Use the parent delete.\r
+        // Also, we need to mark it tracked: we 'know'\r
+        // it was never used.\r
+        node->_memPool->SetTracked();\r
+        // Call the static XMLNode version:\r
+        XMLNode::DeleteNode(node);\r
+    }\r
+}\r
+\r
+\r
+XMLError XMLDocument::LoadFile( const char* filename )\r
+{\r
+    Clear();\r
+    FILE* fp = callfopen( filename, "rb" );\r
+    if ( !fp ) {\r
+        SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 );\r
+        return _errorID;\r
+    }\r
+    LoadFile( fp );\r
+    fclose( fp );\r
+    return _errorID;\r
+}\r
+\r
+// This is likely overengineered template art to have a check that unsigned long value incremented\r
+// by one still fits into size_t. If size_t type is larger than unsigned long type\r
+// (x86_64-w64-mingw32 target) then the check is redundant and gcc and clang emit\r
+// -Wtype-limits warning. This piece makes the compiler select code with a check when a check\r
+// is useful and code with no check when a check is redundant depending on how size_t and unsigned long\r
+// types sizes relate to each other.\r
+template\r
+<bool = (sizeof(unsigned long) >= sizeof(size_t))>\r
+struct LongFitsIntoSizeTMinusOne {\r
+    static bool Fits( unsigned long value )\r
+    {\r
+        return value < (size_t)-1;\r
+    }\r
+};\r
+\r
+template <>\r
+bool LongFitsIntoSizeTMinusOne<false>::Fits( unsigned long /*value*/ )\r
+{\r
+    return true;\r
+}\r
+\r
+XMLError XMLDocument::LoadFile( FILE* fp )\r
+{\r
+    Clear();\r
+\r
+    fseek( fp, 0, SEEK_SET );\r
+    if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) {\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    fseek( fp, 0, SEEK_END );\r
+    const long filelength = ftell( fp );\r
+    fseek( fp, 0, SEEK_SET );\r
+    if ( filelength == -1L ) {\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+    TIXMLASSERT( filelength >= 0 );\r
+\r
+    if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) {\r
+        // Cannot handle files which won't fit in buffer together with null terminator\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    if ( filelength == 0 ) {\r
+        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    const size_t size = filelength;\r
+    TIXMLASSERT( _charBuffer == 0 );\r
+    _charBuffer = new char[size+1];\r
+    size_t read = fread( _charBuffer, 1, size, fp );\r
+    if ( read != size ) {\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    _charBuffer[size] = 0;\r
+\r
+    Parse();\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::SaveFile( const char* filename, bool compact )\r
+{\r
+    FILE* fp = callfopen( filename, "w" );\r
+    if ( !fp ) {\r
+        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );\r
+        return _errorID;\r
+    }\r
+    SaveFile(fp, compact);\r
+    fclose( fp );\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::SaveFile( FILE* fp, bool compact )\r
+{\r
+    // Clear any error from the last save, otherwise it will get reported\r
+    // for *this* call.\r
+    SetError( XML_NO_ERROR, 0, 0 );\r
+    XMLPrinter stream( fp, compact );\r
+    Print( &stream );\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::Parse( const char* p, size_t len )\r
+{\r
+    Clear();\r
+\r
+    if ( len == 0 || !p || !*p ) {\r
+        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+        return _errorID;\r
+    }\r
+    if ( len == (size_t)(-1) ) {\r
+        len = strlen( p );\r
+    }\r
+    TIXMLASSERT( _charBuffer == 0 );\r
+    _charBuffer = new char[ len+1 ];\r
+    memcpy( _charBuffer, p, len );\r
+    _charBuffer[len] = 0;\r
+\r
+    Parse();\r
+    if ( Error() ) {\r
+        // clean up now essentially dangling memory.\r
+        // and the parse fail can put objects in the\r
+        // pools that are dead and inaccessible.\r
+        DeleteChildren();\r
+        _elementPool.Clear();\r
+        _attributePool.Clear();\r
+        _textPool.Clear();\r
+        _commentPool.Clear();\r
+    }\r
+    return _errorID;\r
+}\r
+\r
+\r
+void XMLDocument::Print( XMLPrinter* streamer ) const\r
+{\r
+    if ( streamer ) {\r
+        Accept( streamer );\r
+    }\r
+    else {\r
+        XMLPrinter stdoutStreamer( stdout );\r
+        Accept( &stdoutStreamer );\r
+    }\r
+}\r
+\r
+\r
+void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )\r
+{\r
+    TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );\r
+    _errorID = error;\r
+    _errorStr1 = str1;\r
+    _errorStr2 = str2;\r
+}\r
+\r
+const char* XMLDocument::ErrorName() const\r
+{\r
+       TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );\r
+    const char* errorName = _errorNames[_errorID];\r
+    TIXMLASSERT( errorName && errorName[0] );\r
+    return errorName;\r
+}\r
+\r
+void XMLDocument::PrintError() const\r
+{\r
+    if ( Error() ) {\r
+        static const int LEN = 20;\r
+        char buf1[LEN] = { 0 };\r
+        char buf2[LEN] = { 0 };\r
+\r
+        if ( _errorStr1 ) {\r
+            TIXML_SNPRINTF( buf1, LEN, "%s", _errorStr1 );\r
+        }\r
+        if ( _errorStr2 ) {\r
+            TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 );\r
+        }\r
+\r
+        // Should check INT_MIN <= _errorID && _errorId <= INT_MAX, but that\r
+        // causes a clang "always true" -Wtautological-constant-out-of-range-compare warning\r
+        TIXMLASSERT( 0 <= _errorID && XML_ERROR_COUNT - 1 <= INT_MAX );\r
+        printf( "XMLDocument error id=%d '%s' str1=%s str2=%s\n",\r
+                static_cast<int>( _errorID ), ErrorName(), buf1, buf2 );\r
+    }\r
+}\r
+\r
+void XMLDocument::Parse()\r
+{\r
+    TIXMLASSERT( NoChildren() ); // Clear() must have been called previously\r
+    TIXMLASSERT( _charBuffer );\r
+    char* p = _charBuffer;\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    p = const_cast<char*>( XMLUtil::ReadBOM( p, &_writeBOM ) );\r
+    if ( !*p ) {\r
+        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+        return;\r
+    }\r
+    ParseDeep(p, 0 );\r
+}\r
+\r
+XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :\r
+    _elementJustOpened( false ),\r
+    _firstElement( true ),\r
+    _fp( file ),\r
+    _depth( depth ),\r
+    _textDepth( -1 ),\r
+    _processEntities( true ),\r
+    _compactMode( compact )\r
+{\r
+    for( int i=0; i<ENTITY_RANGE; ++i ) {\r
+        _entityFlag[i] = false;\r
+        _restrictedEntityFlag[i] = false;\r
+    }\r
+    for( int i=0; i<NUM_ENTITIES; ++i ) {\r
+        const char entityValue = entities[i].value;\r
+        TIXMLASSERT( 0 <= entityValue && entityValue < ENTITY_RANGE );\r
+        _entityFlag[ (unsigned char)entityValue ] = true;\r
+    }\r
+    _restrictedEntityFlag[(unsigned char)'&'] = true;\r
+    _restrictedEntityFlag[(unsigned char)'<'] = true;\r
+    _restrictedEntityFlag[(unsigned char)'>'] = true;  // not required, but consistency is nice\r
+    _buffer.Push( 0 );\r
+}\r
+\r
+\r
+void XMLPrinter::Print( const char* format, ... )\r
+{\r
+    va_list     va;\r
+    va_start( va, format );\r
+\r
+    if ( _fp ) {\r
+        vfprintf( _fp, format, va );\r
+    }\r
+    else {\r
+        const int len = TIXML_VSCPRINTF( format, va );\r
+        // Close out and re-start the va-args\r
+        va_end( va );\r
+        TIXMLASSERT( len >= 0 );\r
+        va_start( va, format );\r
+        TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 );\r
+        char* p = _buffer.PushArr( len ) - 1;  // back up over the null terminator.\r
+               TIXML_VSNPRINTF( p, len+1, format, va );\r
+    }\r
+    va_end( va );\r
+}\r
+\r
+\r
+void XMLPrinter::PrintSpace( int depth )\r
+{\r
+    for( int i=0; i<depth; ++i ) {\r
+        Print( "    " );\r
+    }\r
+}\r
+\r
+\r
+void XMLPrinter::PrintString( const char* p, bool restricted )\r
+{\r
+    // Look for runs of bytes between entities to print.\r
+    const char* q = p;\r
+\r
+    if ( _processEntities ) {\r
+        const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;\r
+        while ( *q ) {\r
+            TIXMLASSERT( p <= q );\r
+            // Remember, char is sometimes signed. (How many times has that bitten me?)\r
+            if ( *q > 0 && *q < ENTITY_RANGE ) {\r
+                // Check for entities. If one is found, flush\r
+                // the stream up until the entity, write the\r
+                // entity, and keep looking.\r
+                if ( flag[(unsigned char)(*q)] ) {\r
+                    while ( p < q ) {\r
+                        const size_t delta = q - p;\r
+                        // %.*s accepts type int as "precision"\r
+                        const int toPrint = ( INT_MAX < delta ) ? INT_MAX : (int)delta;\r
+                        Print( "%.*s", toPrint, p );\r
+                        p += toPrint;\r
+                    }\r
+                    bool entityPatternPrinted = false;\r
+                    for( int i=0; i<NUM_ENTITIES; ++i ) {\r
+                        if ( entities[i].value == *q ) {\r
+                            Print( "&%s;", entities[i].pattern );\r
+                            entityPatternPrinted = true;\r
+                            break;\r
+                        }\r
+                    }\r
+                    if ( !entityPatternPrinted ) {\r
+                        // TIXMLASSERT( entityPatternPrinted ) causes gcc -Wunused-but-set-variable in release\r
+                        TIXMLASSERT( false );\r
+                    }\r
+                    ++p;\r
+                }\r
+            }\r
+            ++q;\r
+            TIXMLASSERT( p <= q );\r
+        }\r
+    }\r
+    // Flush the remaining string. This will be the entire\r
+    // string if an entity wasn't found.\r
+    TIXMLASSERT( p <= q );\r
+    if ( !_processEntities || ( p < q ) ) {\r
+        Print( "%s", p );\r
+    }\r
+}\r
+\r
+\r
+void XMLPrinter::PushHeader( bool writeBOM, bool writeDec )\r
+{\r
+    if ( writeBOM ) {\r
+        static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };\r
+        Print( "%s", bom );\r
+    }\r
+    if ( writeDec ) {\r
+        PushDeclaration( "xml version=\"1.0\"" );\r
+    }\r
+}\r
+\r
+\r
+void XMLPrinter::OpenElement( const char* name, bool compactMode )\r
+{\r
+    SealElementIfJustOpened();\r
+    _stack.Push( name );\r
+\r
+    if ( _textDepth < 0 && !_firstElement && !compactMode ) {\r
+        Print( "\n" );\r
+    }\r
+    if ( !compactMode ) {\r
+        PrintSpace( _depth );\r
+    }\r
+\r
+    Print( "<%s", name );\r
+    _elementJustOpened = true;\r
+    _firstElement = false;\r
+    ++_depth;\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, const char* value )\r
+{\r
+    TIXMLASSERT( _elementJustOpened );\r
+    Print( " %s=\"", name );\r
+    PrintString( value, false );\r
+    Print( "\"" );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, int v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, unsigned v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, bool v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, double v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::CloseElement( bool compactMode )\r
+{\r
+    --_depth;\r
+    const char* name = _stack.Pop();\r
+\r
+    if ( _elementJustOpened ) {\r
+        Print( "/>" );\r
+    }\r
+    else {\r
+        if ( _textDepth < 0 && !compactMode) {\r
+            Print( "\n" );\r
+            PrintSpace( _depth );\r
+        }\r
+        Print( "</%s>", name );\r
+    }\r
+\r
+    if ( _textDepth == _depth ) {\r
+        _textDepth = -1;\r
+    }\r
+    if ( _depth == 0 && !compactMode) {\r
+        Print( "\n" );\r
+    }\r
+    _elementJustOpened = false;\r
+}\r
+\r
+\r
+void XMLPrinter::SealElementIfJustOpened()\r
+{\r
+    if ( !_elementJustOpened ) {\r
+        return;\r
+    }\r
+    _elementJustOpened = false;\r
+    Print( ">" );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( const char* text, bool cdata )\r
+{\r
+    _textDepth = _depth-1;\r
+\r
+    SealElementIfJustOpened();\r
+    if ( cdata ) {\r
+        Print( "<![CDATA[%s]]>", text );\r
+    }\r
+    else {\r
+        PrintString( text, true );\r
+    }\r
+}\r
+\r
+void XMLPrinter::PushText( int value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( unsigned value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( bool value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( float value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( double value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushComment( const char* comment )\r
+{\r
+    SealElementIfJustOpened();\r
+    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print( "\n" );\r
+        PrintSpace( _depth );\r
+    }\r
+    _firstElement = false;\r
+    Print( "<!--%s-->", comment );\r
+}\r
+\r
+\r
+void XMLPrinter::PushDeclaration( const char* value )\r
+{\r
+    SealElementIfJustOpened();\r
+    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print( "\n" );\r
+        PrintSpace( _depth );\r
+    }\r
+    _firstElement = false;\r
+    Print( "<?%s?>", value );\r
+}\r
+\r
+\r
+void XMLPrinter::PushUnknown( const char* value )\r
+{\r
+    SealElementIfJustOpened();\r
+    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print( "\n" );\r
+        PrintSpace( _depth );\r
+    }\r
+    _firstElement = false;\r
+    Print( "<!%s>", value );\r
+}\r
+\r
+\r
+bool XMLPrinter::VisitEnter( const XMLDocument& doc )\r
+{\r
+    _processEntities = doc.ProcessEntities();\r
+    if ( doc.HasBOM() ) {\r
+        PushHeader( true, false );\r
+    }\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute )\r
+{\r
+    const XMLElement* parentElem = 0;\r
+    if ( element.Parent() ) {\r
+        parentElem = element.Parent()->ToElement();\r
+    }\r
+    const bool compactMode = parentElem ? CompactMode( *parentElem ) : _compactMode;\r
+    OpenElement( element.Name(), compactMode );\r
+    while ( attribute ) {\r
+        PushAttribute( attribute->Name(), attribute->Value() );\r
+        attribute = attribute->Next();\r
+    }\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::VisitExit( const XMLElement& element )\r
+{\r
+    CloseElement( CompactMode(element) );\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::Visit( const XMLText& text )\r
+{\r
+    PushText( text.Value(), text.CData() );\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::Visit( const XMLComment& comment )\r
+{\r
+    PushComment( comment.Value() );\r
+    return true;\r
+}\r
+\r
+bool XMLPrinter::Visit( const XMLDeclaration& declaration )\r
+{\r
+    PushDeclaration( declaration.Value() );\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::Visit( const XMLUnknown& unknown )\r
+{\r
+    PushUnknown( unknown.Value() );\r
+    return true;\r
+}\r
+\r
+}   // namespace tinyxml2\r
+\r
diff --git a/lib/third_party/tinyxml/tinyxml2.h b/lib/third_party/tinyxml/tinyxml2.h
new file mode 100644 (file)
index 0000000..fb7464a
--- /dev/null
@@ -0,0 +1,2102 @@
+/*\r
+Original code by Lee Thomason (www.grinninglizard.com)\r
+\r
+This software is provided 'as-is', without any express or implied\r
+warranty. In no event will the authors be held liable for any\r
+damages arising from the use of this software.\r
+\r
+Permission is granted to anyone to use this software for any\r
+purpose, including commercial applications, and to alter it and\r
+redistribute it freely, subject to the following restrictions:\r
+\r
+1. The origin of this software must not be misrepresented; you must\r
+not claim that you wrote the original software. If you use this\r
+software in a product, an acknowledgment in the product documentation\r
+would be appreciated but is not required.\r
+\r
+2. Altered source versions must be plainly marked as such, and\r
+must not be misrepresented as being the original software.\r
+\r
+3. This notice may not be removed or altered from any source\r
+distribution.\r
+*/\r
+\r
+#ifndef TINYXML2_INCLUDED\r
+#define TINYXML2_INCLUDED\r
+\r
+#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)\r
+#   include <ctype.h>\r
+#   include <limits.h>\r
+#   include <stdio.h>\r
+#   include <stdlib.h>\r
+#   include <string.h>\r
+#else\r
+#   include <cctype>\r
+#   include <climits>\r
+#   include <cstdio>\r
+#   include <cstdlib>\r
+#   include <cstring>\r
+#endif\r
+\r
+/*\r
+   TODO: intern strings instead of allocation.\r
+*/\r
+/*\r
+       gcc:\r
+        g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe\r
+\r
+    Formatting, Artistic Style:\r
+        AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h\r
+*/\r
+\r
+#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__)\r
+#   ifndef DEBUG\r
+#       define DEBUG\r
+#   endif\r
+#endif\r
+\r
+#ifdef _MSC_VER\r
+#   pragma warning(push)\r
+#   pragma warning(disable: 4251)\r
+#endif\r
+\r
+#ifdef _WIN32\r
+#   ifdef TINYXML2_EXPORT\r
+#       define TINYXML2_LIB __declspec(dllexport)\r
+#   elif defined(TINYXML2_IMPORT)\r
+#       define TINYXML2_LIB __declspec(dllimport)\r
+#   else\r
+#       define TINYXML2_LIB\r
+#   endif\r
+#else\r
+#   define TINYXML2_LIB\r
+#endif\r
+\r
+\r
+#if defined(DEBUG)\r
+#   if defined(_MSC_VER)\r
+#       // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like\r
+#       define TIXMLASSERT( x )           if ( !((void)0,(x))) { __debugbreak(); }\r
+#   elif defined (ANDROID_NDK)\r
+#       include <android/log.h>\r
+#       define TIXMLASSERT( x )           if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }\r
+#   else\r
+#       include <assert.h>\r
+#       define TIXMLASSERT                assert\r
+#   endif\r
+#else\r
+#   define TIXMLASSERT( x )               {}\r
+#endif\r
+\r
+\r
+/* Versioning, past 1.0.14:\r
+       http://semver.org/\r
+*/\r
+static const int TIXML2_MAJOR_VERSION = 3;\r
+static const int TIXML2_MINOR_VERSION = 0;\r
+static const int TIXML2_PATCH_VERSION = 0;\r
+\r
+namespace tinyxml2\r
+{\r
+class XMLDocument;\r
+class XMLElement;\r
+class XMLAttribute;\r
+class XMLComment;\r
+class XMLText;\r
+class XMLDeclaration;\r
+class XMLUnknown;\r
+class XMLPrinter;\r
+\r
+/*\r
+       A class that wraps strings. Normally stores the start and end\r
+       pointers into the XML file itself, and will apply normalization\r
+       and entity translation if actually read. Can also store (and memory\r
+       manage) a traditional char[]\r
+*/\r
+class StrPair\r
+{\r
+public:\r
+    enum {\r
+        NEEDS_ENTITY_PROCESSING                        = 0x01,\r
+        NEEDS_NEWLINE_NORMALIZATION            = 0x02,\r
+        NEEDS_WHITESPACE_COLLAPSING     = 0x04,\r
+\r
+        TEXT_ELEMENT                           = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\r
+        TEXT_ELEMENT_LEAVE_ENTITIES            = NEEDS_NEWLINE_NORMALIZATION,\r
+        ATTRIBUTE_NAME                         = 0,\r
+        ATTRIBUTE_VALUE                                = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\r
+        ATTRIBUTE_VALUE_LEAVE_ENTITIES         = NEEDS_NEWLINE_NORMALIZATION,\r
+        COMMENT                                        = NEEDS_NEWLINE_NORMALIZATION\r
+    };\r
+\r
+    StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}\r
+    ~StrPair();\r
+\r
+    void Set( char* start, char* end, int flags ) {\r
+        Reset();\r
+        _start  = start;\r
+        _end    = end;\r
+        _flags  = flags | NEEDS_FLUSH;\r
+    }\r
+\r
+    const char* GetStr();\r
+\r
+    bool Empty() const {\r
+        return _start == _end;\r
+    }\r
+\r
+    void SetInternedStr( const char* str ) {\r
+        Reset();\r
+        _start = const_cast<char*>(str);\r
+    }\r
+\r
+    void SetStr( const char* str, int flags=0 );\r
+\r
+    char* ParseText( char* in, const char* endTag, int strFlags );\r
+    char* ParseName( char* in );\r
+\r
+    void TransferTo( StrPair* other );\r
+\r
+private:\r
+    void Reset();\r
+    void CollapseWhitespace();\r
+\r
+    enum {\r
+        NEEDS_FLUSH = 0x100,\r
+        NEEDS_DELETE = 0x200\r
+    };\r
+\r
+    int     _flags;\r
+    char*   _start;\r
+    char*   _end;\r
+\r
+    StrPair( const StrPair& other );   // not supported\r
+    void operator=( StrPair& other );  // not supported, use TransferTo()\r
+};\r
+\r
+\r
+/*\r
+       A dynamic array of Plain Old Data. Doesn't support constructors, etc.\r
+       Has a small initial memory pool, so that low or no usage will not\r
+       cause a call to new/delete\r
+*/\r
+template <class T, int INITIAL_SIZE>\r
+class DynArray\r
+{\r
+public:\r
+    DynArray() {\r
+        _mem = _pool;\r
+        _allocated = INITIAL_SIZE;\r
+        _size = 0;\r
+    }\r
+\r
+    ~DynArray() {\r
+        if ( _mem != _pool ) {\r
+            delete [] _mem;\r
+        }\r
+    }\r
+\r
+    void Clear() {\r
+        _size = 0;\r
+    }\r
+\r
+    void Push( T t ) {\r
+        TIXMLASSERT( _size < INT_MAX );\r
+        EnsureCapacity( _size+1 );\r
+        _mem[_size++] = t;\r
+    }\r
+\r
+    T* PushArr( int count ) {\r
+        TIXMLASSERT( count >= 0 );\r
+        TIXMLASSERT( _size <= INT_MAX - count );\r
+        EnsureCapacity( _size+count );\r
+        T* ret = &_mem[_size];\r
+        _size += count;\r
+        return ret;\r
+    }\r
+\r
+    T Pop() {\r
+        TIXMLASSERT( _size > 0 );\r
+        return _mem[--_size];\r
+    }\r
+\r
+    void PopArr( int count ) {\r
+        TIXMLASSERT( _size >= count );\r
+        _size -= count;\r
+    }\r
+\r
+    bool Empty() const                                 {\r
+        return _size == 0;\r
+    }\r
+\r
+    T& operator[](int i)                               {\r
+        TIXMLASSERT( i>= 0 && i < _size );\r
+        return _mem[i];\r
+    }\r
+\r
+    const T& operator[](int i) const   {\r
+        TIXMLASSERT( i>= 0 && i < _size );\r
+        return _mem[i];\r
+    }\r
+\r
+    const T& PeekTop() const            {\r
+        TIXMLASSERT( _size > 0 );\r
+        return _mem[ _size - 1];\r
+    }\r
+\r
+    int Size() const                                   {\r
+        TIXMLASSERT( _size >= 0 );\r
+        return _size;\r
+    }\r
+\r
+    int Capacity() const                               {\r
+        TIXMLASSERT( _allocated >= INITIAL_SIZE );\r
+        return _allocated;\r
+    }\r
+\r
+    const T* Mem() const                               {\r
+        TIXMLASSERT( _mem );\r
+        return _mem;\r
+    }\r
+\r
+    T* Mem()                                                   {\r
+        TIXMLASSERT( _mem );\r
+        return _mem;\r
+    }\r
+\r
+private:\r
+    DynArray( const DynArray& ); // not supported\r
+    void operator=( const DynArray& ); // not supported\r
+\r
+    void EnsureCapacity( int cap ) {\r
+        TIXMLASSERT( cap > 0 );\r
+        if ( cap > _allocated ) {\r
+            TIXMLASSERT( cap <= INT_MAX / 2 );\r
+            int newAllocated = cap * 2;\r
+            T* newMem = new T[newAllocated];\r
+            memcpy( newMem, _mem, sizeof(T)*_size );   // warning: not using constructors, only works for PODs\r
+            if ( _mem != _pool ) {\r
+                delete [] _mem;\r
+            }\r
+            _mem = newMem;\r
+            _allocated = newAllocated;\r
+        }\r
+    }\r
+\r
+    T*  _mem;\r
+    T   _pool[INITIAL_SIZE];\r
+    int _allocated;            // objects allocated\r
+    int _size;                 // number objects in use\r
+};\r
+\r
+\r
+/*\r
+       Parent virtual class of a pool for fast allocation\r
+       and deallocation of objects.\r
+*/\r
+class MemPool\r
+{\r
+public:\r
+    MemPool() {}\r
+    virtual ~MemPool() {}\r
+\r
+    virtual int ItemSize() const = 0;\r
+    virtual void* Alloc() = 0;\r
+    virtual void Free( void* ) = 0;\r
+    virtual void SetTracked() = 0;\r
+    virtual void Clear() = 0;\r
+};\r
+\r
+\r
+/*\r
+       Template child class to create pools of the correct type.\r
+*/\r
+template< int SIZE >\r
+class MemPoolT : public MemPool\r
+{\r
+public:\r
+    MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0)       {}\r
+    ~MemPoolT() {\r
+        Clear();\r
+    }\r
+    \r
+    void Clear() {\r
+        // Delete the blocks.\r
+        while( !_blockPtrs.Empty()) {\r
+            Block* b  = _blockPtrs.Pop();\r
+            delete b;\r
+        }\r
+        _root = 0;\r
+        _currentAllocs = 0;\r
+        _nAllocs = 0;\r
+        _maxAllocs = 0;\r
+        _nUntracked = 0;\r
+    }\r
+\r
+    virtual int ItemSize() const       {\r
+        return SIZE;\r
+    }\r
+    int CurrentAllocs() const          {\r
+        return _currentAllocs;\r
+    }\r
+\r
+    virtual void* Alloc() {\r
+        if ( !_root ) {\r
+            // Need a new block.\r
+            Block* block = new Block();\r
+            _blockPtrs.Push( block );\r
+\r
+            for( int i=0; i<COUNT-1; ++i ) {\r
+                block->chunk[i].next = &block->chunk[i+1];\r
+            }\r
+            block->chunk[COUNT-1].next = 0;\r
+            _root = block->chunk;\r
+        }\r
+        void* result = _root;\r
+        _root = _root->next;\r
+\r
+        ++_currentAllocs;\r
+        if ( _currentAllocs > _maxAllocs ) {\r
+            _maxAllocs = _currentAllocs;\r
+        }\r
+        _nAllocs++;\r
+        _nUntracked++;\r
+        return result;\r
+    }\r
+    \r
+    virtual void Free( void* mem ) {\r
+        if ( !mem ) {\r
+            return;\r
+        }\r
+        --_currentAllocs;\r
+        Chunk* chunk = static_cast<Chunk*>( mem );\r
+#ifdef DEBUG\r
+        memset( chunk, 0xfe, sizeof(Chunk) );\r
+#endif\r
+        chunk->next = _root;\r
+        _root = chunk;\r
+    }\r
+    void Trace( const char* name ) {\r
+        printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",\r
+                name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() );\r
+    }\r
+\r
+    void SetTracked() {\r
+        _nUntracked--;\r
+    }\r
+\r
+    int Untracked() const {\r
+        return _nUntracked;\r
+    }\r
+\r
+       // This number is perf sensitive. 4k seems like a good tradeoff on my machine.\r
+       // The test file is large, 170k.\r
+       // Release:             VS2010 gcc(no opt)\r
+       //              1k:             4000\r
+       //              2k:             4000\r
+       //              4k:             3900    21000\r
+       //              16k:    5200\r
+       //              32k:    4300\r
+       //              64k:    4000    21000\r
+    enum { COUNT = (4*1024)/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private\r
+\r
+private:\r
+    MemPoolT( const MemPoolT& ); // not supported\r
+    void operator=( const MemPoolT& ); // not supported\r
+\r
+    union Chunk {\r
+        Chunk*  next;\r
+        char    mem[SIZE];\r
+    };\r
+    struct Block {\r
+        Chunk chunk[COUNT];\r
+    };\r
+    DynArray< Block*, 10 > _blockPtrs;\r
+    Chunk* _root;\r
+\r
+    int _currentAllocs;\r
+    int _nAllocs;\r
+    int _maxAllocs;\r
+    int _nUntracked;\r
+};\r
+\r
+\r
+\r
+/**\r
+       Implements the interface to the "Visitor pattern" (see the Accept() method.)\r
+       If you call the Accept() method, it requires being passed a XMLVisitor\r
+       class to handle callbacks. For nodes that contain other nodes (Document, Element)\r
+       you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs\r
+       are simply called with Visit().\r
+\r
+       If you return 'true' from a Visit method, recursive parsing will continue. If you return\r
+       false, <b>no children of this node or its siblings</b> will be visited.\r
+\r
+       All flavors of Visit methods have a default implementation that returns 'true' (continue\r
+       visiting). You need to only override methods that are interesting to you.\r
+\r
+       Generally Accept() is called on the XMLDocument, although all nodes support visiting.\r
+\r
+       You should never change the document from a callback.\r
+\r
+       @sa XMLNode::Accept()\r
+*/\r
+class TINYXML2_LIB XMLVisitor\r
+{\r
+public:\r
+    virtual ~XMLVisitor() {}\r
+\r
+    /// Visit a document.\r
+    virtual bool VisitEnter( const XMLDocument& /*doc*/ )                      {\r
+        return true;\r
+    }\r
+    /// Visit a document.\r
+    virtual bool VisitExit( const XMLDocument& /*doc*/ )                       {\r
+        return true;\r
+    }\r
+\r
+    /// Visit an element.\r
+    virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ )   {\r
+        return true;\r
+    }\r
+    /// Visit an element.\r
+    virtual bool VisitExit( const XMLElement& /*element*/ )                    {\r
+        return true;\r
+    }\r
+\r
+    /// Visit a declaration.\r
+    virtual bool Visit( const XMLDeclaration& /*declaration*/ )                {\r
+        return true;\r
+    }\r
+    /// Visit a text node.\r
+    virtual bool Visit( const XMLText& /*text*/ )                                      {\r
+        return true;\r
+    }\r
+    /// Visit a comment node.\r
+    virtual bool Visit( const XMLComment& /*comment*/ )                                {\r
+        return true;\r
+    }\r
+    /// Visit an unknown node.\r
+    virtual bool Visit( const XMLUnknown& /*unknown*/ )                                {\r
+        return true;\r
+    }\r
+};\r
+\r
+// WARNING: must match XMLDocument::_errorNames[]\r
+enum XMLError {\r
+    XML_SUCCESS = 0,\r
+    XML_NO_ERROR = 0,\r
+    XML_NO_ATTRIBUTE,\r
+    XML_WRONG_ATTRIBUTE_TYPE,\r
+    XML_ERROR_FILE_NOT_FOUND,\r
+    XML_ERROR_FILE_COULD_NOT_BE_OPENED,\r
+    XML_ERROR_FILE_READ_ERROR,\r
+    XML_ERROR_ELEMENT_MISMATCH,\r
+    XML_ERROR_PARSING_ELEMENT,\r
+    XML_ERROR_PARSING_ATTRIBUTE,\r
+    XML_ERROR_IDENTIFYING_TAG,\r
+    XML_ERROR_PARSING_TEXT,\r
+    XML_ERROR_PARSING_CDATA,\r
+    XML_ERROR_PARSING_COMMENT,\r
+    XML_ERROR_PARSING_DECLARATION,\r
+    XML_ERROR_PARSING_UNKNOWN,\r
+    XML_ERROR_EMPTY_DOCUMENT,\r
+    XML_ERROR_MISMATCHED_ELEMENT,\r
+    XML_ERROR_PARSING,\r
+    XML_CAN_NOT_CONVERT_TEXT,\r
+    XML_NO_TEXT_NODE,\r
+\r
+       XML_ERROR_COUNT\r
+};\r
+\r
+\r
+/*\r
+       Utility functionality.\r
+*/\r
+class XMLUtil\r
+{\r
+public:\r
+    static const char* SkipWhiteSpace( const char* p ) {\r
+        TIXMLASSERT( p );\r
+        while( IsWhiteSpace(*p) ) {\r
+            ++p;\r
+        }\r
+        TIXMLASSERT( p );\r
+        return p;\r
+    }\r
+    static char* SkipWhiteSpace( char* p )                             {\r
+        return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p) ) );\r
+    }\r
+\r
+    // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't\r
+    // correct, but simple, and usually works.\r
+    static bool IsWhiteSpace( char p )                                 {\r
+        return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );\r
+    }\r
+    \r
+    inline static bool IsNameStartChar( unsigned char ch ) {\r
+        if ( ch >= 128 ) {\r
+            // This is a heuristic guess in attempt to not implement Unicode-aware isalpha()\r
+            return true;\r
+        }\r
+        if ( isalpha( ch ) ) {\r
+            return true;\r
+        }\r
+        return ch == ':' || ch == '_';\r
+    }\r
+    \r
+    inline static bool IsNameChar( unsigned char ch ) {\r
+        return IsNameStartChar( ch )\r
+               || isdigit( ch )\r
+               || ch == '.'\r
+               || ch == '-';\r
+    }\r
+\r
+    inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX )  {\r
+        if ( p == q ) {\r
+            return true;\r
+        }\r
+        return strncmp( p, q, nChar ) == 0;\r
+    }\r
+    \r
+    inline static bool IsUTF8Continuation( char p ) {\r
+        return ( p & 0x80 ) != 0;\r
+    }\r
+\r
+    static const char* ReadBOM( const char* p, bool* hasBOM );\r
+    // p is the starting location,\r
+    // the UTF-8 value of the entity will be placed in value, and length filled in.\r
+    static const char* GetCharacterRef( const char* p, char* value, int* length );\r
+    static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );\r
+\r
+    // converts primitive types to strings\r
+    static void ToStr( int v, char* buffer, int bufferSize );\r
+    static void ToStr( unsigned v, char* buffer, int bufferSize );\r
+    static void ToStr( bool v, char* buffer, int bufferSize );\r
+    static void ToStr( float v, char* buffer, int bufferSize );\r
+    static void ToStr( double v, char* buffer, int bufferSize );\r
+\r
+    // converts strings to primitive types\r
+    static bool        ToInt( const char* str, int* value );\r
+    static bool ToUnsigned( const char* str, unsigned* value );\r
+    static bool        ToBool( const char* str, bool* value );\r
+    static bool        ToFloat( const char* str, float* value );\r
+    static bool ToDouble( const char* str, double* value );\r
+};\r
+\r
+\r
+/** XMLNode is a base class for every object that is in the\r
+       XML Document Object Model (DOM), except XMLAttributes.\r
+       Nodes have siblings, a parent, and children which can\r
+       be navigated. A node is always in a XMLDocument.\r
+       The type of a XMLNode can be queried, and it can\r
+       be cast to its more defined type.\r
+\r
+       A XMLDocument allocates memory for all its Nodes.\r
+       When the XMLDocument gets deleted, all its Nodes\r
+       will also be deleted.\r
+\r
+       @verbatim\r
+       A Document can contain: Element (container or leaf)\r
+                                                       Comment (leaf)\r
+                                                       Unknown (leaf)\r
+                                                       Declaration( leaf )\r
+\r
+       An Element can contain: Element (container or leaf)\r
+                                                       Text    (leaf)\r
+                                                       Attributes (not on tree)\r
+                                                       Comment (leaf)\r
+                                                       Unknown (leaf)\r
+\r
+       @endverbatim\r
+*/\r
+class TINYXML2_LIB XMLNode\r
+{\r
+    friend class XMLDocument;\r
+    friend class XMLElement;\r
+public:\r
+\r
+    /// Get the XMLDocument that owns this XMLNode.\r
+    const XMLDocument* GetDocument() const     {\r
+        TIXMLASSERT( _document );\r
+        return _document;\r
+    }\r
+    /// Get the XMLDocument that owns this XMLNode.\r
+    XMLDocument* GetDocument()                         {\r
+        TIXMLASSERT( _document );\r
+        return _document;\r
+    }\r
+\r
+    /// Safely cast to an Element, or null.\r
+    virtual XMLElement*                ToElement()             {\r
+        return 0;\r
+    }\r
+    /// Safely cast to Text, or null.\r
+    virtual XMLText*           ToText()                {\r
+        return 0;\r
+    }\r
+    /// Safely cast to a Comment, or null.\r
+    virtual XMLComment*                ToComment()             {\r
+        return 0;\r
+    }\r
+    /// Safely cast to a Document, or null.\r
+    virtual XMLDocument*       ToDocument()    {\r
+        return 0;\r
+    }\r
+    /// Safely cast to a Declaration, or null.\r
+    virtual XMLDeclaration*    ToDeclaration() {\r
+        return 0;\r
+    }\r
+    /// Safely cast to an Unknown, or null.\r
+    virtual XMLUnknown*                ToUnknown()             {\r
+        return 0;\r
+    }\r
+\r
+    virtual const XMLElement*          ToElement() const               {\r
+        return 0;\r
+    }\r
+    virtual const XMLText*                     ToText() const                  {\r
+        return 0;\r
+    }\r
+    virtual const XMLComment*          ToComment() const               {\r
+        return 0;\r
+    }\r
+    virtual const XMLDocument*         ToDocument() const              {\r
+        return 0;\r
+    }\r
+    virtual const XMLDeclaration*      ToDeclaration() const   {\r
+        return 0;\r
+    }\r
+    virtual const XMLUnknown*          ToUnknown() const               {\r
+        return 0;\r
+    }\r
+\r
+    /** The meaning of 'value' changes for the specific type.\r
+       @verbatim\r
+       Document:       empty (NULL is returned, not an empty string)\r
+       Element:        name of the element\r
+       Comment:        the comment text\r
+       Unknown:        the tag contents\r
+       Text:           the text string\r
+       @endverbatim\r
+    */\r
+    const char* Value() const;\r
+\r
+    /** Set the Value of an XML node.\r
+       @sa Value()\r
+    */\r
+    void SetValue( const char* val, bool staticMem=false );\r
+\r
+    /// Get the parent of this node on the DOM.\r
+    const XMLNode*     Parent() const                  {\r
+        return _parent;\r
+    }\r
+\r
+    XMLNode* Parent()                                          {\r
+        return _parent;\r
+    }\r
+\r
+    /// Returns true if this node has no children.\r
+    bool NoChildren() const                                    {\r
+        return !_firstChild;\r
+    }\r
+\r
+    /// Get the first child node, or null if none exists.\r
+    const XMLNode*  FirstChild() const         {\r
+        return _firstChild;\r
+    }\r
+\r
+    XMLNode*           FirstChild()                    {\r
+        return _firstChild;\r
+    }\r
+\r
+    /** Get the first child element, or optionally the first child\r
+        element with the specified name.\r
+    */\r
+    const XMLElement* FirstChildElement( const char* name = 0 ) const;\r
+\r
+    XMLElement* FirstChildElement( const char* name = 0 )      {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( name ));\r
+    }\r
+\r
+    /// Get the last child node, or null if none exists.\r
+    const XMLNode*     LastChild() const                                               {\r
+        return _lastChild;\r
+    }\r
+\r
+    XMLNode*           LastChild()                                                             {\r
+        return _lastChild;\r
+    }\r
+\r
+    /** Get the last child element or optionally the last child\r
+        element with the specified name.\r
+    */\r
+    const XMLElement* LastChildElement( const char* name = 0 ) const;\r
+\r
+    XMLElement* LastChildElement( const char* name = 0 )       {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(name) );\r
+    }\r
+\r
+    /// Get the previous (left) sibling node of this node.\r
+    const XMLNode*     PreviousSibling() const                                 {\r
+        return _prev;\r
+    }\r
+\r
+    XMLNode*   PreviousSibling()                                                       {\r
+        return _prev;\r
+    }\r
+\r
+    /// Get the previous (left) sibling element of this node, with an optionally supplied name.\r
+    const XMLElement*  PreviousSiblingElement( const char* name = 0 ) const ;\r
+\r
+    XMLElement*        PreviousSiblingElement( const char* name = 0 ) {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( name ) );\r
+    }\r
+\r
+    /// Get the next (right) sibling node of this node.\r
+    const XMLNode*     NextSibling() const                                             {\r
+        return _next;\r
+    }\r
+\r
+    XMLNode*   NextSibling()                                                           {\r
+        return _next;\r
+    }\r
+\r
+    /// Get the next (right) sibling element of this node, with an optionally supplied name.\r
+    const XMLElement*  NextSiblingElement( const char* name = 0 ) const;\r
+\r
+    XMLElement*        NextSiblingElement( const char* name = 0 )      {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( name ) );\r
+    }\r
+\r
+    /**\r
+       Add a child node as the last (right) child.\r
+               If the child node is already part of the document,\r
+               it is moved from its old location to the new location.\r
+               Returns the addThis argument or 0 if the node does not\r
+               belong to the same document.\r
+    */\r
+    XMLNode* InsertEndChild( XMLNode* addThis );\r
+\r
+    XMLNode* LinkEndChild( XMLNode* addThis )  {\r
+        return InsertEndChild( addThis );\r
+    }\r
+    /**\r
+       Add a child node as the first (left) child.\r
+               If the child node is already part of the document,\r
+               it is moved from its old location to the new location.\r
+               Returns the addThis argument or 0 if the node does not\r
+               belong to the same document.\r
+    */\r
+    XMLNode* InsertFirstChild( XMLNode* addThis );\r
+    /**\r
+       Add a node after the specified child node.\r
+               If the child node is already part of the document,\r
+               it is moved from its old location to the new location.\r
+               Returns the addThis argument or 0 if the afterThis node\r
+               is not a child of this node, or if the node does not\r
+               belong to the same document.\r
+    */\r
+    XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );\r
+\r
+    /**\r
+       Delete all the children of this node.\r
+    */\r
+    void DeleteChildren();\r
+\r
+    /**\r
+       Delete a child of this node.\r
+    */\r
+    void DeleteChild( XMLNode* node );\r
+\r
+    /**\r
+       Make a copy of this node, but not its children.\r
+       You may pass in a Document pointer that will be\r
+       the owner of the new Node. If the 'document' is\r
+       null, then the node returned will be allocated\r
+       from the current Document. (this->GetDocument())\r
+\r
+       Note: if called on a XMLDocument, this will return null.\r
+    */\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;\r
+\r
+    /**\r
+       Test if 2 nodes are the same, but don't test children.\r
+       The 2 nodes do not need to be in the same Document.\r
+\r
+       Note: if called on a XMLDocument, this will return false.\r
+    */\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const = 0;\r
+\r
+    /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the\r
+       XML tree will be conditionally visited and the host will be called back\r
+       via the XMLVisitor interface.\r
+\r
+       This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse\r
+       the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this\r
+       interface versus any other.)\r
+\r
+       The interface has been based on ideas from:\r
+\r
+       - http://www.saxproject.org/\r
+       - http://c2.com/cgi/wiki?HierarchicalVisitorPattern\r
+\r
+       Which are both good references for "visiting".\r
+\r
+       An example of using Accept():\r
+       @verbatim\r
+       XMLPrinter printer;\r
+       tinyxmlDoc.Accept( &printer );\r
+       const char* xmlcstr = printer.CStr();\r
+       @endverbatim\r
+    */\r
+    virtual bool Accept( XMLVisitor* visitor ) const = 0;\r
+\r
+protected:\r
+    XMLNode( XMLDocument* );\r
+    virtual ~XMLNode();\r
+\r
+    virtual char* ParseDeep( char*, StrPair* );\r
+\r
+    XMLDocument*       _document;\r
+    XMLNode*           _parent;\r
+    mutable StrPair    _value;\r
+\r
+    XMLNode*           _firstChild;\r
+    XMLNode*           _lastChild;\r
+\r
+    XMLNode*           _prev;\r
+    XMLNode*           _next;\r
+\r
+private:\r
+    MemPool*           _memPool;\r
+    void Unlink( XMLNode* child );\r
+    static void DeleteNode( XMLNode* node );\r
+    void InsertChildPreamble( XMLNode* insertThis ) const;\r
+\r
+    XMLNode( const XMLNode& ); // not supported\r
+    XMLNode& operator=( const XMLNode& );      // not supported\r
+};\r
+\r
+\r
+/** XML text.\r
+\r
+       Note that a text node can have child element nodes, for example:\r
+       @verbatim\r
+       <root>This is <b>bold</b></root>\r
+       @endverbatim\r
+\r
+       A text node can have 2 ways to output the next. "normal" output\r
+       and CDATA. It will default to the mode it was parsed from the XML file and\r
+       you generally want to leave it alone, but you can change the output mode with\r
+       SetCData() and query it with CData().\r
+*/\r
+class TINYXML2_LIB XMLText : public XMLNode\r
+{\r
+    friend class XMLBase;\r
+    friend class XMLDocument;\r
+public:\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    virtual XMLText* ToText()                  {\r
+        return this;\r
+    }\r
+    virtual const XMLText* ToText() const      {\r
+        return this;\r
+    }\r
+\r
+    /// Declare whether this should be CDATA or standard text.\r
+    void SetCData( bool isCData )                      {\r
+        _isCData = isCData;\r
+    }\r
+    /// Returns true if this is a CDATA text element.\r
+    bool CData() const                                         {\r
+        return _isCData;\r
+    }\r
+\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLText( XMLDocument* doc )        : XMLNode( doc ), _isCData( false )     {}\r
+    virtual ~XMLText()                                                                                         {}\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+\r
+private:\r
+    bool _isCData;\r
+\r
+    XMLText( const XMLText& ); // not supported\r
+    XMLText& operator=( const XMLText& );      // not supported\r
+};\r
+\r
+\r
+/** An XML Comment. */\r
+class TINYXML2_LIB XMLComment : public XMLNode\r
+{\r
+    friend class XMLDocument;\r
+public:\r
+    virtual XMLComment*        ToComment()                                     {\r
+        return this;\r
+    }\r
+    virtual const XMLComment* ToComment() const                {\r
+        return this;\r
+    }\r
+\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLComment( XMLDocument* doc );\r
+    virtual ~XMLComment();\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+\r
+private:\r
+    XMLComment( const XMLComment& );   // not supported\r
+    XMLComment& operator=( const XMLComment& );        // not supported\r
+};\r
+\r
+\r
+/** In correct XML the declaration is the first entry in the file.\r
+       @verbatim\r
+               <?xml version="1.0" standalone="yes"?>\r
+       @endverbatim\r
+\r
+       TinyXML-2 will happily read or write files without a declaration,\r
+       however.\r
+\r
+       The text of the declaration isn't interpreted. It is parsed\r
+       and written as a string.\r
+*/\r
+class TINYXML2_LIB XMLDeclaration : public XMLNode\r
+{\r
+    friend class XMLDocument;\r
+public:\r
+    virtual XMLDeclaration*    ToDeclaration()                                 {\r
+        return this;\r
+    }\r
+    virtual const XMLDeclaration* ToDeclaration() const                {\r
+        return this;\r
+    }\r
+\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLDeclaration( XMLDocument* doc );\r
+    virtual ~XMLDeclaration();\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+\r
+private:\r
+    XMLDeclaration( const XMLDeclaration& );   // not supported\r
+    XMLDeclaration& operator=( const XMLDeclaration& );        // not supported\r
+};\r
+\r
+\r
+/** Any tag that TinyXML-2 doesn't recognize is saved as an\r
+       unknown. It is a tag of text, but should not be modified.\r
+       It will be written back to the XML, unchanged, when the file\r
+       is saved.\r
+\r
+       DTD tags get thrown into XMLUnknowns.\r
+*/\r
+class TINYXML2_LIB XMLUnknown : public XMLNode\r
+{\r
+    friend class XMLDocument;\r
+public:\r
+    virtual XMLUnknown*        ToUnknown()                                     {\r
+        return this;\r
+    }\r
+    virtual const XMLUnknown* ToUnknown() const                {\r
+        return this;\r
+    }\r
+\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLUnknown( XMLDocument* doc );\r
+    virtual ~XMLUnknown();\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+\r
+private:\r
+    XMLUnknown( const XMLUnknown& );   // not supported\r
+    XMLUnknown& operator=( const XMLUnknown& );        // not supported\r
+};\r
+\r
+\r
+\r
+/** An attribute is a name-value pair. Elements have an arbitrary\r
+       number of attributes, each with a unique name.\r
+\r
+       @note The attributes are not XMLNodes. You may only query the\r
+       Next() attribute in a list.\r
+*/\r
+class TINYXML2_LIB XMLAttribute\r
+{\r
+    friend class XMLElement;\r
+public:\r
+    /// The name of the attribute.\r
+    const char* Name() const;\r
+\r
+    /// The value of the attribute.\r
+    const char* Value() const;\r
+\r
+    /// The next attribute in the list.\r
+    const XMLAttribute* Next() const {\r
+        return _next;\r
+    }\r
+\r
+    /** IntValue interprets the attribute as an integer, and returns the value.\r
+        If the value isn't an integer, 0 will be returned. There is no error checking;\r
+       use QueryIntValue() if you need error checking.\r
+    */\r
+    int                 IntValue() const                               {\r
+        int i=0;\r
+        QueryIntValue( &i );\r
+        return i;\r
+    }\r
+    /// Query as an unsigned integer. See IntValue()\r
+    unsigned UnsignedValue() const                     {\r
+        unsigned i=0;\r
+        QueryUnsignedValue( &i );\r
+        return i;\r
+    }\r
+    /// Query as a boolean. See IntValue()\r
+    bool        BoolValue() const                              {\r
+        bool b=false;\r
+        QueryBoolValue( &b );\r
+        return b;\r
+    }\r
+    /// Query as a double. See IntValue()\r
+    double      DoubleValue() const                    {\r
+        double d=0;\r
+        QueryDoubleValue( &d );\r
+        return d;\r
+    }\r
+    /// Query as a float. See IntValue()\r
+    float       FloatValue() const                             {\r
+        float f=0;\r
+        QueryFloatValue( &f );\r
+        return f;\r
+    }\r
+\r
+    /** QueryIntValue interprets the attribute as an integer, and returns the value\r
+       in the provided parameter. The function will return XML_NO_ERROR on success,\r
+       and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.\r
+    */\r
+    XMLError QueryIntValue( int* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryUnsignedValue( unsigned int* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryBoolValue( bool* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryDoubleValue( double* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryFloatValue( float* value ) const;\r
+\r
+    /// Set the attribute to a string value.\r
+    void SetAttribute( const char* value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( int value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( unsigned value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( bool value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( double value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( float value );\r
+\r
+private:\r
+    enum { BUF_SIZE = 200 };\r
+\r
+    XMLAttribute() : _next( 0 ), _memPool( 0 ) {}\r
+    virtual ~XMLAttribute()    {}\r
+\r
+    XMLAttribute( const XMLAttribute& );       // not supported\r
+    void operator=( const XMLAttribute& );     // not supported\r
+    void SetName( const char* name );\r
+\r
+    char* ParseDeep( char* p, bool processEntities );\r
+\r
+    mutable StrPair _name;\r
+    mutable StrPair _value;\r
+    XMLAttribute*   _next;\r
+    MemPool*        _memPool;\r
+};\r
+\r
+\r
+/** The element is a container class. It has a value, the element name,\r
+       and can contain other elements, text, comments, and unknowns.\r
+       Elements also contain an arbitrary number of attributes.\r
+*/\r
+class TINYXML2_LIB XMLElement : public XMLNode\r
+{\r
+    friend class XMLBase;\r
+    friend class XMLDocument;\r
+public:\r
+    /// Get the name of an element (which is the Value() of the node.)\r
+    const char* Name() const           {\r
+        return Value();\r
+    }\r
+    /// Set the name of the element.\r
+    void SetName( const char* str, bool staticMem=false )      {\r
+        SetValue( str, staticMem );\r
+    }\r
+\r
+    virtual XMLElement* ToElement()                            {\r
+        return this;\r
+    }\r
+    virtual const XMLElement* ToElement() const {\r
+        return this;\r
+    }\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    /** Given an attribute name, Attribute() returns the value\r
+       for the attribute of that name, or null if none\r
+       exists. For example:\r
+\r
+       @verbatim\r
+       const char* value = ele->Attribute( "foo" );\r
+       @endverbatim\r
+\r
+       The 'value' parameter is normally null. However, if specified,\r
+       the attribute will only be returned if the 'name' and 'value'\r
+       match. This allow you to write code:\r
+\r
+       @verbatim\r
+       if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar();\r
+       @endverbatim\r
+\r
+       rather than:\r
+       @verbatim\r
+       if ( ele->Attribute( "foo" ) ) {\r
+               if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();\r
+       }\r
+       @endverbatim\r
+    */\r
+    const char* Attribute( const char* name, const char* value=0 ) const;\r
+\r
+    /** Given an attribute name, IntAttribute() returns the value\r
+       of the attribute interpreted as an integer. 0 will be\r
+       returned if there is an error. For a method with error\r
+       checking, see QueryIntAttribute()\r
+    */\r
+    int                 IntAttribute( const char* name ) const         {\r
+        int i=0;\r
+        QueryIntAttribute( name, &i );\r
+        return i;\r
+    }\r
+    /// See IntAttribute()\r
+    unsigned UnsignedAttribute( const char* name ) const {\r
+        unsigned i=0;\r
+        QueryUnsignedAttribute( name, &i );\r
+        return i;\r
+    }\r
+    /// See IntAttribute()\r
+    bool        BoolAttribute( const char* name ) const        {\r
+        bool b=false;\r
+        QueryBoolAttribute( name, &b );\r
+        return b;\r
+    }\r
+    /// See IntAttribute()\r
+    double      DoubleAttribute( const char* name ) const      {\r
+        double d=0;\r
+        QueryDoubleAttribute( name, &d );\r
+        return d;\r
+    }\r
+    /// See IntAttribute()\r
+    float       FloatAttribute( const char* name ) const       {\r
+        float f=0;\r
+        QueryFloatAttribute( name, &f );\r
+        return f;\r
+    }\r
+\r
+    /** Given an attribute name, QueryIntAttribute() returns\r
+       XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion\r
+       can't be performed, or XML_NO_ATTRIBUTE if the attribute\r
+       doesn't exist. If successful, the result of the conversion\r
+       will be written to 'value'. If not successful, nothing will\r
+       be written to 'value'. This allows you to provide default\r
+       value:\r
+\r
+       @verbatim\r
+       int value = 10;\r
+       QueryIntAttribute( "foo", &value );             // if "foo" isn't found, value will still be 10\r
+       @endverbatim\r
+    */\r
+    XMLError QueryIntAttribute( const char* name, int* value ) const                           {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryIntValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const     {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryUnsignedValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryBoolAttribute( const char* name, bool* value ) const                         {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryBoolValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryDoubleAttribute( const char* name, double* value ) const                     {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryDoubleValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryFloatAttribute( const char* name, float* value ) const                       {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryFloatValue( value );\r
+    }\r
+\r
+       \r
+    /** Given an attribute name, QueryAttribute() returns\r
+       XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion\r
+       can't be performed, or XML_NO_ATTRIBUTE if the attribute\r
+       doesn't exist. It is overloaded for the primitive types,\r
+               and is a generally more convenient replacement of\r
+               QueryIntAttribute() and related functions.\r
+               \r
+               If successful, the result of the conversion\r
+       will be written to 'value'. If not successful, nothing will\r
+       be written to 'value'. This allows you to provide default\r
+       value:\r
+\r
+       @verbatim\r
+       int value = 10;\r
+       QueryAttribute( "foo", &value );                // if "foo" isn't found, value will still be 10\r
+       @endverbatim\r
+    */\r
+       int QueryAttribute( const char* name, int* value ) const {\r
+               return QueryIntAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, unsigned int* value ) const {\r
+               return QueryUnsignedAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, bool* value ) const {\r
+               return QueryBoolAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, double* value ) const {\r
+               return QueryDoubleAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, float* value ) const {\r
+               return QueryFloatAttribute( name, value );\r
+       }\r
+\r
+       /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, const char* value )   {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, int value )                   {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, unsigned value )              {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, bool value )                  {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, double value )                {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, float value )         {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+\r
+    /**\r
+       Delete an attribute.\r
+    */\r
+    void DeleteAttribute( const char* name );\r
+\r
+    /// Return the first attribute in the list.\r
+    const XMLAttribute* FirstAttribute() const {\r
+        return _rootAttribute;\r
+    }\r
+    /// Query a specific attribute in the list.\r
+    const XMLAttribute* FindAttribute( const char* name ) const;\r
+\r
+    /** Convenience function for easy access to the text inside an element. Although easy\r
+       and concise, GetText() is limited compared to getting the XMLText child\r
+       and accessing it directly.\r
+\r
+       If the first child of 'this' is a XMLText, the GetText()\r
+       returns the character string of the Text node, else null is returned.\r
+\r
+       This is a convenient method for getting the text of simple contained text:\r
+       @verbatim\r
+       <foo>This is text</foo>\r
+               const char* str = fooElement->GetText();\r
+       @endverbatim\r
+\r
+       'str' will be a pointer to "This is text".\r
+\r
+       Note that this function can be misleading. If the element foo was created from\r
+       this XML:\r
+       @verbatim\r
+               <foo><b>This is text</b></foo>\r
+       @endverbatim\r
+\r
+       then the value of str would be null. The first child node isn't a text node, it is\r
+       another element. From this XML:\r
+       @verbatim\r
+               <foo>This is <b>text</b></foo>\r
+       @endverbatim\r
+       GetText() will return "This is ".\r
+    */\r
+    const char* GetText() const;\r
+\r
+    /** Convenience function for easy access to the text inside an element. Although easy\r
+       and concise, SetText() is limited compared to creating an XMLText child\r
+       and mutating it directly.\r
+\r
+       If the first child of 'this' is a XMLText, SetText() sets its value to\r
+               the given string, otherwise it will create a first child that is an XMLText.\r
+\r
+       This is a convenient method for setting the text of simple contained text:\r
+       @verbatim\r
+       <foo>This is text</foo>\r
+               fooElement->SetText( "Hullaballoo!" );\r
+       <foo>Hullaballoo!</foo>\r
+               @endverbatim\r
+\r
+       Note that this function can be misleading. If the element foo was created from\r
+       this XML:\r
+       @verbatim\r
+               <foo><b>This is text</b></foo>\r
+       @endverbatim\r
+\r
+       then it will not change "This is text", but rather prefix it with a text element:\r
+       @verbatim\r
+               <foo>Hullaballoo!<b>This is text</b></foo>\r
+       @endverbatim\r
+               \r
+               For this XML:\r
+       @verbatim\r
+               <foo />\r
+       @endverbatim\r
+       SetText() will generate\r
+       @verbatim\r
+               <foo>Hullaballoo!</foo>\r
+       @endverbatim\r
+    */\r
+       void SetText( const char* inText );\r
+    /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
+    void SetText( int value );\r
+    /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
+    void SetText( unsigned value );  \r
+    /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
+    void SetText( bool value );  \r
+    /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
+    void SetText( double value );  \r
+    /// Convenience method for setting text inside an element. See SetText() for important limitations.\r
+    void SetText( float value );  \r
+\r
+    /**\r
+       Convenience method to query the value of a child text node. This is probably best\r
+       shown by example. Given you have a document is this form:\r
+       @verbatim\r
+               <point>\r
+                       <x>1</x>\r
+                       <y>1.4</y>\r
+               </point>\r
+       @endverbatim\r
+\r
+       The QueryIntText() and similar functions provide a safe and easier way to get to the\r
+       "value" of x and y.\r
+\r
+       @verbatim\r
+               int x = 0;\r
+               float y = 0;    // types of x and y are contrived for example\r
+               const XMLElement* xElement = pointElement->FirstChildElement( "x" );\r
+               const XMLElement* yElement = pointElement->FirstChildElement( "y" );\r
+               xElement->QueryIntText( &x );\r
+               yElement->QueryFloatText( &y );\r
+       @endverbatim\r
+\r
+       @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted\r
+                        to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.\r
+\r
+    */\r
+    XMLError QueryIntText( int* ival ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryUnsignedText( unsigned* uval ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryBoolText( bool* bval ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryDoubleText( double* dval ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryFloatText( float* fval ) const;\r
+\r
+    // internal:\r
+    enum {\r
+        OPEN,          // <foo>\r
+        CLOSED,                // <foo/>\r
+        CLOSING                // </foo>\r
+    };\r
+    int ClosingType() const {\r
+        return _closingType;\r
+    }\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    char* ParseDeep( char* p, StrPair* endTag );\r
+\r
+private:\r
+    XMLElement( XMLDocument* doc );\r
+    virtual ~XMLElement();\r
+    XMLElement( const XMLElement& );   // not supported\r
+    void operator=( const XMLElement& );       // not supported\r
+\r
+    XMLAttribute* FindAttribute( const char* name ) {\r
+        return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute( name ));\r
+    }\r
+    XMLAttribute* FindOrCreateAttribute( const char* name );\r
+    //void LinkAttribute( XMLAttribute* attrib );\r
+    char* ParseAttributes( char* p );\r
+    static void DeleteAttribute( XMLAttribute* attribute );\r
+\r
+    enum { BUF_SIZE = 200 };\r
+    int _closingType;\r
+    // The attribute list is ordered; there is no 'lastAttribute'\r
+    // because the list needs to be scanned for dupes before adding\r
+    // a new attribute.\r
+    XMLAttribute* _rootAttribute;\r
+};\r
+\r
+\r
+enum Whitespace {\r
+    PRESERVE_WHITESPACE,\r
+    COLLAPSE_WHITESPACE\r
+};\r
+\r
+\r
+/** A Document binds together all the functionality.\r
+       It can be saved, loaded, and printed to the screen.\r
+       All Nodes are connected and allocated to a Document.\r
+       If the Document is deleted, all its Nodes are also deleted.\r
+*/\r
+class TINYXML2_LIB XMLDocument : public XMLNode\r
+{\r
+    friend class XMLElement;\r
+public:\r
+    /// constructor\r
+    XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE );\r
+    ~XMLDocument();\r
+\r
+    virtual XMLDocument* ToDocument()                          {\r
+        TIXMLASSERT( this == _document );\r
+        return this;\r
+    }\r
+    virtual const XMLDocument* ToDocument() const      {\r
+        TIXMLASSERT( this == _document );\r
+        return this;\r
+    }\r
+\r
+    /**\r
+       Parse an XML file from a character string.\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+\r
+       You may optionally pass in the 'nBytes', which is\r
+       the number of bytes which will be parsed. If not\r
+       specified, TinyXML-2 will assume 'xml' points to a\r
+       null terminated string.\r
+    */\r
+    XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );\r
+\r
+    /**\r
+       Load an XML file from disk.\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError LoadFile( const char* filename );\r
+\r
+    /**\r
+       Load an XML file from disk. You are responsible\r
+       for providing and closing the FILE*. \r
+     \r
+        NOTE: The file should be opened as binary ("rb")\r
+        not text in order for TinyXML-2 to correctly\r
+        do newline normalization.\r
+\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError LoadFile( FILE* );\r
+\r
+    /**\r
+       Save the XML file to disk.\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError SaveFile( const char* filename, bool compact = false );\r
+\r
+    /**\r
+       Save the XML file to disk. You are responsible\r
+       for providing and closing the FILE*.\r
+\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError SaveFile( FILE* fp, bool compact = false );\r
+\r
+    bool ProcessEntities() const               {\r
+        return _processEntities;\r
+    }\r
+    Whitespace WhitespaceMode() const  {\r
+        return _whitespace;\r
+    }\r
+\r
+    /**\r
+       Returns true if this document has a leading Byte Order Mark of UTF8.\r
+    */\r
+    bool HasBOM() const {\r
+        return _writeBOM;\r
+    }\r
+    /** Sets whether to write the BOM when writing the file.\r
+    */\r
+    void SetBOM( bool useBOM ) {\r
+        _writeBOM = useBOM;\r
+    }\r
+\r
+    /** Return the root element of DOM. Equivalent to FirstChildElement().\r
+        To get the first node, use FirstChild().\r
+    */\r
+    XMLElement* RootElement()                          {\r
+        return FirstChildElement();\r
+    }\r
+    const XMLElement* RootElement() const      {\r
+        return FirstChildElement();\r
+    }\r
+\r
+    /** Print the Document. If the Printer is not provided, it will\r
+        print to stdout. If you provide Printer, this can print to a file:\r
+       @verbatim\r
+       XMLPrinter printer( fp );\r
+       doc.Print( &printer );\r
+       @endverbatim\r
+\r
+       Or you can use a printer to print to memory:\r
+       @verbatim\r
+       XMLPrinter printer;\r
+       doc.Print( &printer );\r
+       // printer.CStr() has a const char* to the XML\r
+       @endverbatim\r
+    */\r
+    void Print( XMLPrinter* streamer=0 ) const;\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    /**\r
+       Create a new Element associated with\r
+       this Document. The memory for the Element\r
+       is managed by the Document.\r
+    */\r
+    XMLElement* NewElement( const char* name );\r
+    /**\r
+       Create a new Comment associated with\r
+       this Document. The memory for the Comment\r
+       is managed by the Document.\r
+    */\r
+    XMLComment* NewComment( const char* comment );\r
+    /**\r
+       Create a new Text associated with\r
+       this Document. The memory for the Text\r
+       is managed by the Document.\r
+    */\r
+    XMLText* NewText( const char* text );\r
+    /**\r
+       Create a new Declaration associated with\r
+       this Document. The memory for the object\r
+       is managed by the Document.\r
+\r
+       If the 'text' param is null, the standard\r
+       declaration is used.:\r
+       @verbatim\r
+               <?xml version="1.0" encoding="UTF-8"?>\r
+       @endverbatim\r
+    */\r
+    XMLDeclaration* NewDeclaration( const char* text=0 );\r
+    /**\r
+       Create a new Unknown associated with\r
+       this Document. The memory for the object\r
+       is managed by the Document.\r
+    */\r
+    XMLUnknown* NewUnknown( const char* text );\r
+\r
+    /**\r
+       Delete a node associated with this document.\r
+       It will be unlinked from the DOM.\r
+    */\r
+    void DeleteNode( XMLNode* node );\r
+\r
+    void SetError( XMLError error, const char* str1, const char* str2 );\r
+\r
+    /// Return true if there was an error parsing the document.\r
+    bool Error() const {\r
+        return _errorID != XML_NO_ERROR;\r
+    }\r
+    /// Return the errorID.\r
+    XMLError  ErrorID() const {\r
+        return _errorID;\r
+    }\r
+       const char* ErrorName() const;\r
+\r
+    /// Return a possibly helpful diagnostic location or string.\r
+    const char* GetErrorStr1() const {\r
+        return _errorStr1;\r
+    }\r
+    /// Return a possibly helpful secondary diagnostic location or string.\r
+    const char* GetErrorStr2() const {\r
+        return _errorStr2;\r
+    }\r
+    /// If there is an error, print it to stdout.\r
+    void PrintError() const;\r
+    \r
+    /// Clear the document, resetting it to the initial state.\r
+    void Clear();\r
+\r
+    // internal\r
+    char* Identify( char* p, XMLNode** node );\r
+\r
+    virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const   {\r
+        return 0;\r
+    }\r
+    virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const      {\r
+        return false;\r
+    }\r
+\r
+private:\r
+    XMLDocument( const XMLDocument& ); // not supported\r
+    void operator=( const XMLDocument& );      // not supported\r
+\r
+    bool        _writeBOM;\r
+    bool        _processEntities;\r
+    XMLError    _errorID;\r
+    Whitespace  _whitespace;\r
+    const char* _errorStr1;\r
+    const char* _errorStr2;\r
+    char*       _charBuffer;\r
+\r
+    MemPoolT< sizeof(XMLElement) >      _elementPool;\r
+    MemPoolT< sizeof(XMLAttribute) > _attributePool;\r
+    MemPoolT< sizeof(XMLText) >                 _textPool;\r
+    MemPoolT< sizeof(XMLComment) >      _commentPool;\r
+\r
+       static const char* _errorNames[XML_ERROR_COUNT];\r
+\r
+    void Parse();\r
+};\r
+\r
+\r
+/**\r
+       A XMLHandle is a class that wraps a node pointer with null checks; this is\r
+       an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2\r
+       DOM structure. It is a separate utility class.\r
+\r
+       Take an example:\r
+       @verbatim\r
+       <Document>\r
+               <Element attributeA = "valueA">\r
+                       <Child attributeB = "value1" />\r
+                       <Child attributeB = "value2" />\r
+               </Element>\r
+       </Document>\r
+       @endverbatim\r
+\r
+       Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very\r
+       easy to write a *lot* of code that looks like:\r
+\r
+       @verbatim\r
+       XMLElement* root = document.FirstChildElement( "Document" );\r
+       if ( root )\r
+       {\r
+               XMLElement* element = root->FirstChildElement( "Element" );\r
+               if ( element )\r
+               {\r
+                       XMLElement* child = element->FirstChildElement( "Child" );\r
+                       if ( child )\r
+                       {\r
+                               XMLElement* child2 = child->NextSiblingElement( "Child" );\r
+                               if ( child2 )\r
+                               {\r
+                                       // Finally do something useful.\r
+       @endverbatim\r
+\r
+       And that doesn't even cover "else" cases. XMLHandle addresses the verbosity\r
+       of such code. A XMLHandle checks for null pointers so it is perfectly safe\r
+       and correct to use:\r
+\r
+       @verbatim\r
+       XMLHandle docHandle( &document );\r
+       XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement();\r
+       if ( child2 )\r
+       {\r
+               // do something useful\r
+       @endverbatim\r
+\r
+       Which is MUCH more concise and useful.\r
+\r
+       It is also safe to copy handles - internally they are nothing more than node pointers.\r
+       @verbatim\r
+       XMLHandle handleCopy = handle;\r
+       @endverbatim\r
+\r
+       See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.\r
+*/\r
+class TINYXML2_LIB XMLHandle\r
+{\r
+public:\r
+    /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.\r
+    XMLHandle( XMLNode* node )                                                                                         {\r
+        _node = node;\r
+    }\r
+    /// Create a handle from a node.\r
+    XMLHandle( XMLNode& node )                                                                                         {\r
+        _node = &node;\r
+    }\r
+    /// Copy constructor\r
+    XMLHandle( const XMLHandle& ref )                                                                          {\r
+        _node = ref._node;\r
+    }\r
+    /// Assignment\r
+    XMLHandle& operator=( const XMLHandle& ref )                                                       {\r
+        _node = ref._node;\r
+        return *this;\r
+    }\r
+\r
+    /// Get the first child of this handle.\r
+    XMLHandle FirstChild()                                                                                                     {\r
+        return XMLHandle( _node ? _node->FirstChild() : 0 );\r
+    }\r
+    /// Get the first child element of this handle.\r
+    XMLHandle FirstChildElement( const char* name = 0 )                                                {\r
+        return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 );\r
+    }\r
+    /// Get the last child of this handle.\r
+    XMLHandle LastChild()                                                                                                      {\r
+        return XMLHandle( _node ? _node->LastChild() : 0 );\r
+    }\r
+    /// Get the last child element of this handle.\r
+    XMLHandle LastChildElement( const char* name = 0 )                                         {\r
+        return XMLHandle( _node ? _node->LastChildElement( name ) : 0 );\r
+    }\r
+    /// Get the previous sibling of this handle.\r
+    XMLHandle PreviousSibling()                                                                                                {\r
+        return XMLHandle( _node ? _node->PreviousSibling() : 0 );\r
+    }\r
+    /// Get the previous sibling element of this handle.\r
+    XMLHandle PreviousSiblingElement( const char* name = 0 )                           {\r
+        return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );\r
+    }\r
+    /// Get the next sibling of this handle.\r
+    XMLHandle NextSibling()                                                                                                    {\r
+        return XMLHandle( _node ? _node->NextSibling() : 0 );\r
+    }\r
+    /// Get the next sibling element of this handle.\r
+    XMLHandle NextSiblingElement( const char* name = 0 )                                       {\r
+        return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 );\r
+    }\r
+\r
+    /// Safe cast to XMLNode. This can return null.\r
+    XMLNode* ToNode()                                                  {\r
+        return _node;\r
+    }\r
+    /// Safe cast to XMLElement. This can return null.\r
+    XMLElement* ToElement()                                    {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToElement() );\r
+    }\r
+    /// Safe cast to XMLText. This can return null.\r
+    XMLText* ToText()                                                  {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToText() );\r
+    }\r
+    /// Safe cast to XMLUnknown. This can return null.\r
+    XMLUnknown* ToUnknown()                                    {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToUnknown() );\r
+    }\r
+    /// Safe cast to XMLDeclaration. This can return null.\r
+    XMLDeclaration* ToDeclaration()                    {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToDeclaration() );\r
+    }\r
+\r
+private:\r
+    XMLNode* _node;\r
+};\r
+\r
+\r
+/**\r
+       A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the\r
+       same in all regards, except for the 'const' qualifiers. See XMLHandle for API.\r
+*/\r
+class TINYXML2_LIB XMLConstHandle\r
+{\r
+public:\r
+    XMLConstHandle( const XMLNode* node )                                                                                      {\r
+        _node = node;\r
+    }\r
+    XMLConstHandle( const XMLNode& node )                                                                                      {\r
+        _node = &node;\r
+    }\r
+    XMLConstHandle( const XMLConstHandle& ref )                                                                                {\r
+        _node = ref._node;\r
+    }\r
+\r
+    XMLConstHandle& operator=( const XMLConstHandle& ref )                                                     {\r
+        _node = ref._node;\r
+        return *this;\r
+    }\r
+\r
+    const XMLConstHandle FirstChild() const                                                                                    {\r
+        return XMLConstHandle( _node ? _node->FirstChild() : 0 );\r
+    }\r
+    const XMLConstHandle FirstChildElement( const char* name = 0 ) const                               {\r
+        return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 );\r
+    }\r
+    const XMLConstHandle LastChild()   const                                                                           {\r
+        return XMLConstHandle( _node ? _node->LastChild() : 0 );\r
+    }\r
+    const XMLConstHandle LastChildElement( const char* name = 0 ) const                                {\r
+        return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 );\r
+    }\r
+    const XMLConstHandle PreviousSibling() const                                                                       {\r
+        return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );\r
+    }\r
+    const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const          {\r
+        return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );\r
+    }\r
+    const XMLConstHandle NextSibling() const                                                                           {\r
+        return XMLConstHandle( _node ? _node->NextSibling() : 0 );\r
+    }\r
+    const XMLConstHandle NextSiblingElement( const char* name = 0 ) const                      {\r
+        return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 );\r
+    }\r
+\r
+\r
+    const XMLNode* ToNode() const                              {\r
+        return _node;\r
+    }\r
+    const XMLElement* ToElement() const                        {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToElement() );\r
+    }\r
+    const XMLText* ToText() const                              {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToText() );\r
+    }\r
+    const XMLUnknown* ToUnknown() const                        {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToUnknown() );\r
+    }\r
+    const XMLDeclaration* ToDeclaration() const        {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToDeclaration() );\r
+    }\r
+\r
+private:\r
+    const XMLNode* _node;\r
+};\r
+\r
+\r
+/**\r
+       Printing functionality. The XMLPrinter gives you more\r
+       options than the XMLDocument::Print() method.\r
+\r
+       It can:\r
+       -# Print to memory.\r
+       -# Print to a file you provide.\r
+       -# Print XML without a XMLDocument.\r
+\r
+       Print to Memory\r
+\r
+       @verbatim\r
+       XMLPrinter printer;\r
+       doc.Print( &printer );\r
+       SomeFunction( printer.CStr() );\r
+       @endverbatim\r
+\r
+       Print to a File\r
+\r
+       You provide the file pointer.\r
+       @verbatim\r
+       XMLPrinter printer( fp );\r
+       doc.Print( &printer );\r
+       @endverbatim\r
+\r
+       Print without a XMLDocument\r
+\r
+       When loading, an XML parser is very useful. However, sometimes\r
+       when saving, it just gets in the way. The code is often set up\r
+       for streaming, and constructing the DOM is just overhead.\r
+\r
+       The Printer supports the streaming case. The following code\r
+       prints out a trivially simple XML file without ever creating\r
+       an XML document.\r
+\r
+       @verbatim\r
+       XMLPrinter printer( fp );\r
+       printer.OpenElement( "foo" );\r
+       printer.PushAttribute( "foo", "bar" );\r
+       printer.CloseElement();\r
+       @endverbatim\r
+*/\r
+class TINYXML2_LIB XMLPrinter : public XMLVisitor\r
+{\r
+public:\r
+    /** Construct the printer. If the FILE* is specified,\r
+       this will print to the FILE. Else it will print\r
+       to memory, and the result is available in CStr().\r
+       If 'compact' is set to true, then output is created\r
+       with only required whitespace and newlines.\r
+    */\r
+    XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );\r
+    virtual ~XMLPrinter()      {}\r
+\r
+    /** If streaming, write the BOM and declaration. */\r
+    void PushHeader( bool writeBOM, bool writeDeclaration );\r
+    /** If streaming, start writing an element.\r
+        The element must be closed with CloseElement()\r
+    */\r
+    void OpenElement( const char* name, bool compactMode=false );\r
+    /// If streaming, add an attribute to an open element.\r
+    void PushAttribute( const char* name, const char* value );\r
+    void PushAttribute( const char* name, int value );\r
+    void PushAttribute( const char* name, unsigned value );\r
+    void PushAttribute( const char* name, bool value );\r
+    void PushAttribute( const char* name, double value );\r
+    /// If streaming, close the Element.\r
+    virtual void CloseElement( bool compactMode=false );\r
+\r
+    /// Add a text node.\r
+    void PushText( const char* text, bool cdata=false );\r
+    /// Add a text node from an integer.\r
+    void PushText( int value );\r
+    /// Add a text node from an unsigned.\r
+    void PushText( unsigned value );\r
+    /// Add a text node from a bool.\r
+    void PushText( bool value );\r
+    /// Add a text node from a float.\r
+    void PushText( float value );\r
+    /// Add a text node from a double.\r
+    void PushText( double value );\r
+\r
+    /// Add a comment\r
+    void PushComment( const char* comment );\r
+\r
+    void PushDeclaration( const char* value );\r
+    void PushUnknown( const char* value );\r
+\r
+    virtual bool VisitEnter( const XMLDocument& /*doc*/ );\r
+    virtual bool VisitExit( const XMLDocument& /*doc*/ )                       {\r
+        return true;\r
+    }\r
+\r
+    virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );\r
+    virtual bool VisitExit( const XMLElement& element );\r
+\r
+    virtual bool Visit( const XMLText& text );\r
+    virtual bool Visit( const XMLComment& comment );\r
+    virtual bool Visit( const XMLDeclaration& declaration );\r
+    virtual bool Visit( const XMLUnknown& unknown );\r
+\r
+    /**\r
+       If in print to memory mode, return a pointer to\r
+       the XML file in memory.\r
+    */\r
+    const char* CStr() const {\r
+        return _buffer.Mem();\r
+    }\r
+    /**\r
+       If in print to memory mode, return the size\r
+       of the XML file in memory. (Note the size returned\r
+       includes the terminating null.)\r
+    */\r
+    int CStrSize() const {\r
+        return _buffer.Size();\r
+    }\r
+    /**\r
+       If in print to memory mode, reset the buffer to the\r
+       beginning.\r
+    */\r
+    void ClearBuffer() {\r
+        _buffer.Clear();\r
+        _buffer.Push(0);\r
+    }\r
+\r
+protected:\r
+       virtual bool CompactMode( const XMLElement& )   { return _compactMode; }\r
+\r
+       /** Prints out the space before an element. You may override to change\r
+           the space and tabs used. A PrintSpace() override should call Print().\r
+       */\r
+    virtual void PrintSpace( int depth );\r
+    void Print( const char* format, ... );\r
+\r
+    void SealElementIfJustOpened();\r
+    bool _elementJustOpened;\r
+    DynArray< const char*, 10 > _stack;\r
+\r
+private:\r
+    void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities.\r
+\r
+    bool _firstElement;\r
+    FILE* _fp;\r
+    int _depth;\r
+    int _textDepth;\r
+    bool _processEntities;\r
+       bool _compactMode;\r
+\r
+    enum {\r
+        ENTITY_RANGE = 64,\r
+        BUF_SIZE = 200\r
+    };\r
+    bool _entityFlag[ENTITY_RANGE];\r
+    bool _restrictedEntityFlag[ENTITY_RANGE];\r
+\r
+    DynArray< char, 20 > _buffer;\r
+};\r
+\r
+\r
+}      // tinyxml2\r
+\r
+#if defined(_MSC_VER)\r
+#   pragma warning(pop)\r
+#endif\r
+\r
+#endif // TINYXML2_INCLUDED\r
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0d25544
--- /dev/null
@@ -0,0 +1,7 @@
+SUBDIRS(
+  cpPluginsIO
+  cpPluginsImageFilters
+  cpPluginsWidgets
+  )
+
+## eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/CMakeLists.txt b/plugins/cpPluginsIO/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1a8c84d
--- /dev/null
@@ -0,0 +1,73 @@
+SET(lib_NAME cpPluginsIO)
+SET(lib_DIR  cpPluginsIO)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB lib_HEADERS_H   "*.h")
+FILE(GLOB lib_HEADERS_HPP "*.hpp")
+FILE(GLOB lib_HEADERS_HXX "*.hxx")
+FILE(GLOB lib_SOURCES_C   "*.c")
+FILE(GLOB lib_SOURCES_CPP "*.cpp")
+FILE(GLOB lib_SOURCES_CXX "*.cxx")
+
+# ===================================
+# = Integrate all source file names =
+# ===================================
+
+SET(
+  lib_HEADERS
+  ${lib_HEADERS_H}
+  ${lib_HEADERS_HPP}
+  ${lib_HEADERS_HXX}
+  )
+
+SET(
+  lib_SOURCES
+  ${lib_SOURCES_C}
+  ${lib_SOURCES_CPP}
+  ${lib_SOURCES_CXX}
+  )
+
+SET(
+  target_LIBRARIES
+  cpPlugins
+  )
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${lib_NAME}_Host.cxx
+  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
+  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
+  )
+ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
+SET_TARGET_PROPERTIES(
+  ${lib_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${lib_NAME}
+  BASE_NAME ${lib_NAME}
+  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
+  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${lib_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+
+## eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/DataReproducer.cxx b/plugins/cpPluginsIO/DataReproducer.cxx
new file mode 100644 (file)
index 0000000..27f9ea5
--- /dev/null
@@ -0,0 +1,32 @@
+#include <cpPluginsIO/DataReproducer.h>
+#include <cpPlugins/DataObject.h>
+
+// -------------------------------------------------------------------------
+cpPluginsIO::DataReproducer::
+DataReproducer( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::DataObject >( "Output" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsIO::DataReproducer::
+~DataReproducer( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsIO::DataReproducer::
+_GenerateData( )
+{
+  auto i = this->m_Inputs.find( "Input" );
+  auto o = this->m_Outputs.find( "Output" );
+  if( i == this->m_Inputs.end( ) || o == this->m_Outputs.end( ) )
+    return( "IO::DataReproducer: No input/output ports." );
+  o->second->SetITK( i->second->GetITK< itk::LightObject >( ) );
+  o->second->SetVTK( i->second->GetVTK< vtkObjectBase >( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/DataReproducer.h b/plugins/cpPluginsIO/DataReproducer.h
new file mode 100644 (file)
index 0000000..ba43876
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef __CPPLUGINSIO__DATAREPRODUCER__H__
+#define __CPPLUGINSIO__DATAREPRODUCER__H__
+
+#include <cpPluginsIO/cpPluginsIO_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsIO
+{
+  /**
+   */
+  class cpPluginsIO_EXPORT DataReproducer
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef DataReproducer                  Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( DataReproducer, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( DataReproducer, IO );
+
+  protected:
+    DataReproducer( );
+    virtual ~DataReproducer( );
+
+    virtual std::string _GenerateData( );
+
+  private:
+    // Purposely not implemented
+    DataReproducer( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIO__DATAREPRODUCER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/DicomSeriesReader.cxx b/plugins/cpPluginsIO/DicomSeriesReader.cxx
new file mode 100644 (file)
index 0000000..e53e249
--- /dev/null
@@ -0,0 +1,233 @@
+#include <cpPluginsIO/DicomSeriesReader.h>
+
+#ifdef cpPlugins_QT4
+#include <queue>
+#include <map>
+#include <sstream>
+#include <vector>
+
+#include <QApplication>
+#include <QDialogButtonBox>
+#include <QDir>
+#include <QFileDialog>
+#include <QGridLayout>
+#include <QLabel>
+#include <QTreeWidget>
+#include <QVBoxLayout>
+
+#include <cpPlugins/ParametersQtDialog.h>
+
+#include <itkGDCMSeriesFileNames.h>
+
+/**
+ */
+class cpPluginsIO_DicomSeriesReader_ParametersQtDialog
+  : public cpPlugins::ParametersQtDialog
+{
+public:
+  cpPluginsIO_DicomSeriesReader_ParametersQtDialog(
+    QWidget* parent = 0, Qt::WindowFlags f = 0
+    )
+    : cpPlugins::ParametersQtDialog( parent, f )
+    {
+    }
+  virtual ~cpPluginsIO_DicomSeriesReader_ParametersQtDialog( )
+    {
+    }
+
+protected:
+  virtual void _dlg_OpenMultipleFiles( )
+    {
+      // DICOM series analyzer
+      itk::GDCMSeriesFileNames::GlobalWarningDisplayOff( );
+      itk::GDCMSeriesFileNames::Pointer series =
+        itk::GDCMSeriesFileNames::New( );
+
+      // Show dialog and check if it was accepted
+      QWidget* parent = dynamic_cast< QWidget* >( this->parent( ) );
+      QFileDialog dialog( parent );
+      dialog.setFileMode( QFileDialog::DirectoryOnly );
+      dialog.setDirectory( QFileDialog::tr( "." ) );
+      if( !dialog.exec( ) )
+        return;
+
+      // Prepare dialog
+      QApplication::setOverrideCursor( Qt::WaitCursor );
+      if( parent != NULL )
+        parent->setEnabled( false );
+
+      QDialog* tree_dialog = new QDialog( parent );
+      QTreeWidget* tree_widget = new QTreeWidget( tree_dialog );
+      QList< QTreeWidgetItem* > tree_items;
+      std::map<
+        std::string,
+        std::map< std::string, std::vector< std::string > >
+        > found_files;
+
+      std::string main_dir_name =
+        dialog.selectedFiles( ).begin( )->toStdString( );
+      std::queue< std::string > q;
+      q.push( main_dir_name );
+      while( !( q.empty( ) ) )
+      {
+        std::string dir_name = q.front( );
+        q.pop( );
+
+        // Get DICOM information
+        series->SetUseSeriesDetails( true );
+        series->AddSeriesRestriction( "0008|0021" );
+        series->SetDirectory( dir_name );
+        const std::vector< std::string >& seriesUID = series->GetSeriesUIDs( );
+        if( seriesUID.size( ) > 0 )
+        {
+          QTreeWidgetItem* new_item = new QTreeWidgetItem(
+            ( QTreeWidgetItem* )( NULL ),
+            QStringList( dir_name.c_str( ) )
+            );
+          QTreeWidgetItem* new_leaf = NULL;
+          std::vector< std::string >::const_iterator sIt = seriesUID.begin( );
+          for( ; sIt != seriesUID.end( ); ++sIt )
+          {
+            std::vector< std::string > filenames = series->GetFileNames( *sIt );
+            if( filenames.size( ) > 0 )
+            {
+              std::stringstream ss;
+              ss << "(" << filenames.size( ) << "): " << *sIt;
+              new_leaf =
+                new QTreeWidgetItem(
+                  new_item, QStringList( ss.str( ).c_str( ) )
+                  );
+              new_item->addChild( new_leaf );
+              found_files[ dir_name ][ *sIt ] = filenames;
+
+            } // fi
+
+          } // rof
+
+          if( new_leaf != NULL )
+            tree_items.append( new_item );
+          else
+            delete new_item;
+
+        } // fi
+
+        // Update queue
+        QDir dir( dir_name.c_str( ) );
+        QFileInfoList contents = dir.entryInfoList( );
+        QFileInfoList::const_iterator i = contents.begin( );
+        for( ; i != contents.end( ); ++i )
+        {
+          if( i->isDir( ) )
+          {
+            std::string new_dir_name = i->absoluteFilePath( ).toStdString( );
+            if( new_dir_name.size( ) > dir_name.size( ) )
+              q.push( new_dir_name );
+
+          } // fi
+
+        } // rof
+
+      } // elihw
+
+      // Show second dialog
+      if( tree_items.size( ) == 0 )
+      {
+        delete tree_widget;
+        delete tree_dialog;
+        return;
+
+      } // fi
+
+      QLabel* title = new QLabel( tree_dialog );
+      title->setText( "Choose a DICOM series" );
+      QGridLayout* mainLayout = new QGridLayout( tree_dialog );
+      QVBoxLayout* toolsLayout = new QVBoxLayout( );
+      toolsLayout->addWidget( title );
+      mainLayout->addLayout( toolsLayout, 0, 0, 1, 1 );
+
+      tree_widget->insertTopLevelItems( 0, tree_items );
+      toolsLayout->addWidget( tree_widget );
+
+      QDialogButtonBox* bb = new QDialogButtonBox(
+        QDialogButtonBox::Ok | QDialogButtonBox::Cancel
+        );
+      tree_dialog->connect(
+        bb, SIGNAL( accepted( ) ), tree_dialog, SLOT( accept( ) )
+        );
+      tree_dialog->connect(
+        bb, SIGNAL( rejected( ) ), tree_dialog, SLOT( reject( ) )
+        );
+      toolsLayout->addWidget( bb );
+
+      QApplication::restoreOverrideCursor( );
+      if( parent != NULL )
+        parent->setEnabled( true );
+
+      if( tree_dialog->exec( ) == 0 )
+        return;
+
+      QTreeWidgetItem* item = tree_widget->currentItem( );
+      if( item != NULL )
+      {
+        QTreeWidgetItem* item_parent = item->parent( );
+        if( item_parent != NULL )
+        {
+          QApplication::setOverrideCursor( Qt::WaitCursor );
+          if( parent != NULL )
+            parent->setEnabled( false );
+
+          auto parameters = this->m_ProcessObject->GetParameters( );
+          std::string serie_dir = item_parent->text( 0 ).toStdString( );
+          std::string serie_id = item->text( 0 ).toStdString( );
+          serie_id = serie_id.substr( serie_id.find_first_of( " " ) + 1 );
+          parameters->ClearOpenFileNameList( "FileNames" );
+          const std::vector< std::string >& names =
+            found_files[ serie_dir ][ serie_id ];
+          for( unsigned int f = 0; f < names.size( ); ++f )
+            parameters->AddToOpenFileNameList( "FileNames", names[ f ] );
+          this->updateView( );
+
+          QApplication::restoreOverrideCursor( );
+          if( parent != NULL )
+            parent->setEnabled( true );
+
+        } // fi
+
+      } // fi
+      itk::GDCMSeriesFileNames::GlobalWarningDisplayOn( );
+    }
+};
+
+#endif // cpPlugins_QT4
+
+// -------------------------------------------------------------------------
+cpPlugins::ParametersQtDialog* cpPluginsIO::DicomSeriesReader::
+CreateQtDialog( )
+{
+#ifdef cpPlugins_QT4
+  cpPluginsIO_DicomSeriesReader_ParametersQtDialog* dlg = NULL;
+  if( QApplication::instance( ) != NULL )
+  {
+    dlg = new cpPluginsIO_DicomSeriesReader_ParametersQtDialog( );
+    dlg->setProcessObject( this );
+
+  } // fi
+  return( dlg );
+#else // cpPlugins_QT4
+  return( NULL );
+#endif // cpPlugins_QT4
+}
+
+// -------------------------------------------------------------------------
+cpPluginsIO::DicomSeriesReader::
+DicomSeriesReader( )
+  : Superclass( )
+{
+}
+// -------------------------------------------------------------------------
+cpPluginsIO::DicomSeriesReader::
+~DicomSeriesReader( )
+{
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/DicomSeriesReader.h b/plugins/cpPluginsIO/DicomSeriesReader.h
new file mode 100644 (file)
index 0000000..1533cd7
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef __CPPLUGINSIO__DICOMSERIESREADER__H__
+#define __CPPLUGINSIO__DICOMSERIESREADER__H__
+
+#include <cpPluginsIO/ImageReader.h>
+
+namespace cpPluginsIO
+{
+  /**
+   */
+  class cpPluginsIO_EXPORT DicomSeriesReader
+    : public ImageReader
+  {
+  public:
+    typedef DicomSeriesReader               Self;
+    typedef ImageReader                     Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( DicomSeriesReader, ImageReader );
+    cpPlugins_Id_Macro( DicomSeriesReader, IO );
+
+  public:
+    // Qt dialog creation
+    virtual cpPlugins::ParametersQtDialog* CreateQtDialog( ) override;
+
+  protected:
+    DicomSeriesReader( );
+    virtual ~DicomSeriesReader( );
+
+  private:
+    // Purposely not implemented
+    DicomSeriesReader( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIO__DICOMSERIESREADER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/ImageReader.cxx b/plugins/cpPluginsIO/ImageReader.cxx
new file mode 100644 (file)
index 0000000..c515c9e
--- /dev/null
@@ -0,0 +1,220 @@
+#include <cpPluginsIO/ImageReader.h>
+#include <cpPlugins/Image.h>
+
+#include <itkImageFileReader.h>
+#include <itkImageSeriesReader.h>
+#include <itkImageFileReader.hxx>
+#include <itkImageSeriesReader.hxx>
+#include <itkImageAlgorithm.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsIO::ImageReader::
+ImageReader( )
+  : Superclass( )
+{
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+  this->m_Parameters.Clear( );
+  this->m_Parameters.ConfigureAsOpenFileNameList( "FileNames" );
+  this->m_Parameters.SetAcceptedFileExtensions(
+    "FileNames",
+    "Image files (*.bmp *.png *.jpg *.jpeg *.dcm *.mhd *.nhdr *.nrrd *.tiff)"
+    );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsIO::ImageReader::
+~ImageReader( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsIO::ImageReader::
+_GenerateData( )
+{
+  // Get filenames
+  auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" );
+  std::string r = "";
+  if( fnames.size( ) >= 1 )
+  {
+    // Guess image properties
+    itk::ImageIOBase::Pointer io =
+      itk::ImageIOFactory::CreateImageIO(
+        fnames[ 0 ].c_str( ),
+        itk::ImageIOFactory::ReadMode
+        );
+    if( io.IsNotNull( ) )
+    {
+      io->SetFileName( fnames[ 0 ] );
+      io->ReadImageInformation( );
+      if( fnames.size( ) >= 1 )
+      {
+        switch( io->GetNumberOfDimensions( ) )
+        {
+        case 1: r = this->_GD0< 1 >( io ); break;
+        case 2: r = this->_GD0< 2 >( io ); break;
+        case 3: r = this->_GD0< 3 >( io ); break;
+        case 4: r = this->_GD0< 4 >( io ); break;
+        default:
+          r = "IO::ImageReader: Image dimension not supported.";
+          break;
+        } // hctiws
+
+      } // fi
+    }
+    else
+      r =
+        "IO::ImageReader: Could not CreateImageIO for \"" +
+        fnames[ 0 ] +
+        "\"";
+  }
+  else
+    r = "IO::ImageReader: No image(s) given";
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+std::string cpPluginsIO::ImageReader::
+_GD0( itk::ImageIOBase* io )
+{
+  itk::ImageIOBase::IOComponentType ct = io->GetComponentType( );
+  itk::ImageIOBase::IOPixelType pt = io->GetPixelType( );
+
+  std::string r = "";
+  if( pt == itk::ImageIOBase::SCALAR )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::CHAR   : r = this->_GD1<           char, D >( io ); break;
+    case itk::ImageIOBase::SHORT  : r = this->_GD1<          short, D >( io ); break;
+    case itk::ImageIOBase::INT    : r = this->_GD1<            int, D >( io ); break;
+    case itk::ImageIOBase::LONG   : r = this->_GD1<           long, D >( io ); break;
+    case itk::ImageIOBase::FLOAT  : r = this->_GD1<          float, D >( io ); break;
+    case itk::ImageIOBase::DOUBLE : r = this->_GD1<         double, D >( io ); break;
+    case itk::ImageIOBase::UCHAR  : r = this->_GD1<  unsigned char, D >( io ); break;
+    case itk::ImageIOBase::USHORT : r = this->_GD1< unsigned short, D >( io ); break;
+    case itk::ImageIOBase::UINT   : r = this->_GD1<   unsigned int, D >( io ); break;
+    case itk::ImageIOBase::ULONG  : r = this->_GD1<  unsigned long, D >( io ); break;
+    default:
+      r = "IO::ImageReader: Scalar pixel type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::RGB )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::CHAR   : r = this->_GD1< itk::RGBPixel<           char >, D >( io ); break;
+    case itk::ImageIOBase::SHORT  : r = this->_GD1< itk::RGBPixel<          short >, D >( io ); break;
+    case itk::ImageIOBase::INT    : r = this->_GD1< itk::RGBPixel<            int >, D >( io ); break;
+    case itk::ImageIOBase::LONG   : r = this->_GD1< itk::RGBPixel<           long >, D >( io ); break;
+    case itk::ImageIOBase::FLOAT  : r = this->_GD1< itk::RGBPixel<          float >, D >( io ); break;
+    case itk::ImageIOBase::DOUBLE : r = this->_GD1< itk::RGBPixel<         double >, D >( io ); break;
+    case itk::ImageIOBase::UCHAR  : r = this->_GD1< itk::RGBPixel<  unsigned char >, D >( io ); break;
+    case itk::ImageIOBase::USHORT : r = this->_GD1< itk::RGBPixel< unsigned short >, D >( io ); break;
+    case itk::ImageIOBase::UINT   : r = this->_GD1< itk::RGBPixel<   unsigned int >, D >( io ); break;
+    case itk::ImageIOBase::ULONG  : r = this->_GD1< itk::RGBPixel<  unsigned long >, D >( io ); break;
+    default:
+      r = "IO::ImageReader: RGB pixel type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::RGBA )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::CHAR   : r = this->_GD1< itk::RGBAPixel<           char >, D >( io ); break;
+    case itk::ImageIOBase::SHORT  : r = this->_GD1< itk::RGBAPixel<          short >, D >( io ); break;
+    case itk::ImageIOBase::INT    : r = this->_GD1< itk::RGBAPixel<            int >, D >( io ); break;
+    case itk::ImageIOBase::LONG   : r = this->_GD1< itk::RGBAPixel<           long >, D >( io ); break;
+    case itk::ImageIOBase::FLOAT  : r = this->_GD1< itk::RGBAPixel<          float >, D >( io ); break;
+    case itk::ImageIOBase::DOUBLE : r = this->_GD1< itk::RGBAPixel<         double >, D >( io ); break;
+    case itk::ImageIOBase::UCHAR  : r = this->_GD1< itk::RGBAPixel<  unsigned char >, D >( io ); break;
+    case itk::ImageIOBase::USHORT : r = this->_GD1< itk::RGBAPixel< unsigned short >, D >( io ); break;
+    case itk::ImageIOBase::UINT   : r = this->_GD1< itk::RGBAPixel<   unsigned int >, D >( io ); break;
+    case itk::ImageIOBase::ULONG  : r = this->_GD1< itk::RGBAPixel<  unsigned long >, D >( io ); break;
+    default:
+      r = "IO::ImageReader: RGBA pixel type not supported.";
+      break;
+    } // hctiws
+  }
+  /* TODO
+     else if( pt == itk::ImageIOBase::VECTOR )
+     {
+     }
+     else if( pt == itk::ImageIOBase::POINT )
+     {
+     }
+     else if( pt == itk::ImageIOBase::COVARIANTVECTOR )
+     {
+     }
+     else if( pt == itk::ImageIOBase::SYMMETRICSECONDRANKTENSOR )
+     {
+     }
+     else if( pt == itk::ImageIOBase::DIFFUSIONTENSOR3D )
+     {
+     }
+     else if( pt == itk::ImageIOBase::COMPLEX )
+     {
+     }
+     else if( pt == itk::ImageIOBase::OFFSET )
+     {
+     }
+     else if( pt == itk::ImageIOBase::FIXEDARRAY )
+     {
+     }
+     else if( pt == itk::ImageIOBase::MATRIX )
+     {
+     }
+  */
+  else
+    r = "IO::ImageReader: Image pixel type not yet supported.";
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class P, unsigned int D >
+std::string cpPluginsIO::ImageReader::
+_GD1( itk::ImageIOBase* io )
+{
+  typedef itk::Image< P, D > _I;
+
+  // Get filenames
+  std::string r = "";
+  auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" );
+  if( fnames.size( ) == 1 )
+  {
+    auto f = this->_CreateITK< itk::ImageFileReader< _I > >( );
+    f->SetFileName( fnames[ 0 ] );
+    f->SetImageIO( io );
+    try
+    {
+      f->Update( );
+      this->GetOutput( "Output" )->SetITK( f->GetOutput( ) );
+    }
+    catch( itk::ExceptionObject& err )
+    {
+      r = "IO::ImageReader: " + std::string( err.GetDescription( ) );
+    }
+  }
+  else // if( fnames.size( ) > 1 )
+  {
+    auto f = this->_CreateITK< itk::ImageSeriesReader< _I > >( );
+    for( auto i = fnames.begin( ); i != fnames.end( ); ++i )
+      f->AddFileName( *i );
+    f->SetImageIO( io );
+    try
+    {
+      f->Update( );
+      this->GetOutput( "Output" )->SetITK( f->GetOutput( ) );
+    }
+    catch( itk::ExceptionObject& err )
+    {
+      r = "IO::ImageReader: " + std::string( err.GetDescription( ) );
+    }
+
+  } // fi
+  return( r );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/ImageReader.h b/plugins/cpPluginsIO/ImageReader.h
new file mode 100644 (file)
index 0000000..a0b5c19
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef __CPPLUGINSIO__IMAGEREADER__H__
+#define __CPPLUGINSIO__IMAGEREADER__H__
+
+#include <cpPluginsIO/cpPluginsIO_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace itk
+{
+  class ImageIOBase;
+}
+
+namespace cpPluginsIO
+{
+  /**
+   */
+  class cpPluginsIO_EXPORT ImageReader
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef ImageReader                     Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( ImageReader, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( ImageReader, IO );
+
+  protected:
+    ImageReader( );
+    virtual ~ImageReader( );
+
+    virtual std::string _GenerateData( ) override;
+
+    template< unsigned int D >
+      inline std::string _GD0( itk::ImageIOBase* io );
+
+    template< class P, unsigned int D >
+      inline std::string _GD1( itk::ImageIOBase* io );
+
+  private:
+    // Purposely not implemented
+    ImageReader( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIO__IMAGEREADER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/ImageWriter.cxx b/plugins/cpPluginsIO/ImageWriter.cxx
new file mode 100644 (file)
index 0000000..4418c66
--- /dev/null
@@ -0,0 +1,75 @@
+#include <cpPluginsIO/ImageWriter.h>
+#include <cpPlugins/Image.h>
+
+#include <itkImageFileWriter.h>
+#include <itkImageFileWriter.hxx>
+#include <itkImageAlgorithm.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsIO::ImageWriter::
+ImageWriter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->m_Parameters.Clear( );
+  this->m_Parameters.ConfigureAsSaveFileName( "FileName" );
+  this->m_Parameters.SetAcceptedFileExtensions(
+    "FileName",
+    "Image files (*.bmp *.png *.jpg *.jpeg *.dcm *.mhd *.nhdr *.nrrd *.tiff)"
+    );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsIO::ImageWriter::
+~ImageWriter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsIO::ImageWriter::
+_GenerateData( )
+{
+  auto input = this->GetInputData( "Input" );
+  try
+  {
+    std::string   r = cpPlugin_Image_Demangle_Dim( _GD0, input, 3 );
+    if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 2 );
+    if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 4 );
+    if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 1 );
+    return( r );
+  }
+  catch( itk::ExceptionObject& err )
+  {
+    return( "IO::ImageWriter: " + std::string( err.GetDescription( ) ) );
+  }
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsIO::ImageWriter::
+_GD0( I* image )
+{
+  static const unsigned int D = I::ImageDimension;
+  if( image == NULL )
+    return( "IO::ImageWriter: Invalid image dimension." );
+
+  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD1, image, D );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllColor( r, _GD1, image, D );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsIO::ImageWriter::
+_GD1( I* image )
+{
+  if( image == NULL )
+    return( "IO::ImageWriter: Invalid pixel type." );
+  auto f = this->_CreateITK< itk::ImageFileWriter< I > >( );
+  f->SetFileName( this->m_Parameters.GetOpenFileName( "FileName" ) );
+  f->SetInput( image );
+  f->Update( );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsIO/ImageWriter.h b/plugins/cpPluginsIO/ImageWriter.h
new file mode 100644 (file)
index 0000000..a6c9b79
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIO__IMAGEWRITER__H__
+#define __CPPLUGINSIO__IMAGEWRITER__H__
+
+#include <cpPluginsIO/cpPluginsIO_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsIO
+{
+  /**
+   */
+  class cpPluginsIO_EXPORT ImageWriter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef ImageWriter                     Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( ImageWriter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( ImageWriter, IO );
+
+  protected:
+    ImageWriter( );
+    virtual ~ImageWriter( );
+
+    virtual std::string _GenerateData( ) override;
+
+    template< class I >
+      inline std::string _GD0( I* image );
+
+    template< class I >
+      inline std::string _GD1( I* image );
+
+  private:
+    // Purposely not implemented
+    ImageWriter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIO__IMAGEWRITER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx
new file mode 100644 (file)
index 0000000..5915829
--- /dev/null
@@ -0,0 +1,93 @@
+#include <cpPluginsImageFilters/BinaryThresholdImageFilter.h>
+#include <cpPlugins/Image.h>
+
+#include <itkBinaryThresholdImageFilter.h>
+#include <itkBinaryThresholdImageFilter.hxx>
+#include <itkImageToImageFilter.hxx>
+#include <itkInPlaceImageFilter.hxx>
+#include <itkUnaryFunctorImageFilter.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::BinaryThresholdImageFilter::
+BinaryThresholdImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+
+  this->m_Parameters.ConfigureAsReal( "LowerThresholdValue" );
+  this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" );
+  this->m_Parameters.ConfigureAsUint( "InsideValue" );
+  this->m_Parameters.ConfigureAsUint( "OutsideValue" );
+
+  this->m_Parameters.SetReal( "LowerThresholdValue", 0 );
+  this->m_Parameters.SetReal( "UpperThresholdValue", 10000 );
+  this->m_Parameters.SetUint( "InsideValue", 1 );
+  this->m_Parameters.SetUint( "OutsideValue", 0 );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::BinaryThresholdImageFilter::
+~BinaryThresholdImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::BinaryThresholdImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsImageFilters::BinaryThresholdImageFilter::
+_GD0( I* image )
+{
+  if( image != NULL )
+    return(
+      this->_GD1< I, itk::Image< unsigned char, I::ImageDimension > >(
+        image
+        )
+      );
+  else
+    return(
+      "ImageFilters::BinaryThresholdImageFilter: No valid input image."
+      );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+std::string cpPluginsImageFilters::BinaryThresholdImageFilter::
+_GD1( I* image )
+{
+  typedef itk::BinaryThresholdImageFilter< I, O > _F;
+  typedef typename I::PixelType _IP;
+  typedef typename O::PixelType _OP;
+
+  // Get parameters
+  _IP lower_val = _IP( this->m_Parameters.GetReal( "LowerThresholdValue" ) );
+  _IP upper_val = _IP( this->m_Parameters.GetReal( "UpperThresholdValue" ) );
+  _OP in_val    = _OP( this->m_Parameters.GetUint( "InsideValue" ) );
+  _OP out_val   = _OP( this->m_Parameters.GetUint( "OutsideValue" ) );
+
+  // Configure filter
+  _F* filter = this->_CreateITK< _F >( );
+  filter->SetInput( image );
+  filter->SetLowerThreshold( lower_val );
+  filter->SetUpperThreshold( upper_val );
+  filter->SetInsideValue( in_val );
+  filter->SetOutsideValue( out_val );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.h b/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.h
new file mode 100644 (file)
index 0000000..1d80104
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT BinaryThresholdImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef BinaryThresholdImageFilter      Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( BinaryThresholdImageFilter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( BinaryThresholdImageFilter, ImageFilters );
+
+  protected:
+    BinaryThresholdImageFilter( );
+    virtual ~BinaryThresholdImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class I >
+      inline std::string _GD0( I* image );
+
+    template< class I, class O >
+      inline std::string _GD1( I* image );
+
+  private:
+    // Purposely not implemented
+    BinaryThresholdImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/CMakeLists.txt b/plugins/cpPluginsImageFilters/CMakeLists.txt
new file mode 100644 (file)
index 0000000..94af7c5
--- /dev/null
@@ -0,0 +1,74 @@
+SET(lib_NAME cpPluginsImageFilters)
+SET(lib_DIR  cpPluginsImageFilters)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB lib_HEADERS_H   "*.h")
+FILE(GLOB lib_HEADERS_HPP "*.hpp")
+FILE(GLOB lib_HEADERS_HXX "*.hxx")
+FILE(GLOB lib_SOURCES_C   "*.c")
+FILE(GLOB lib_SOURCES_CPP "*.cpp")
+FILE(GLOB lib_SOURCES_CXX "*.cxx")
+
+# ===================================
+# = Integrate all source file names =
+# ===================================
+
+SET(
+  lib_HEADERS
+  ${lib_HEADERS_H}
+  ${lib_HEADERS_HPP}
+  ${lib_HEADERS_HXX}
+  )
+
+SET(
+  lib_SOURCES
+  ${lib_SOURCES_C}
+  ${lib_SOURCES_CPP}
+  ${lib_SOURCES_CXX}
+  )
+
+SET(
+  target_LIBRARIES
+  cpExtensions
+  cpPlugins
+  )
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${lib_NAME}_Host.cxx
+  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
+  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
+  )
+ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
+SET_TARGET_PROPERTIES(
+  ${lib_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${lib_NAME}
+  BASE_NAME ${lib_NAME}
+  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
+  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${lib_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+
+## eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx
new file mode 100644 (file)
index 0000000..c08eb20
--- /dev/null
@@ -0,0 +1,88 @@
+#include <cpPluginsImageFilters/OtsuThresholdImageFilter.h>
+#include <cpPlugins/Image.h>
+
+#include <itkOtsuThresholdImageFilter.h>
+#include <itkBinaryFunctorImageFilter.hxx>
+#include <itkHistogram.hxx>
+#include <itkHistogramAlgorithmBase.hxx>
+#include <itkHistogramThresholdImageFilter.hxx>
+#include <itkImageToHistogramFilter.hxx>
+#include <itkMaskedImageToHistogramFilter.hxx>
+#include <itkOtsuMultipleThresholdsCalculator.hxx>
+#include <itkOtsuThresholdCalculator.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::OtsuThresholdImageFilter::
+OtsuThresholdImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+
+  this->m_Parameters.ConfigureAsUint( "NumberOfHistogramBins" );
+  this->m_Parameters.ConfigureAsUint( "InsideValue" );
+  this->m_Parameters.ConfigureAsUint( "OutsideValue" );
+
+  this->m_Parameters.SetUint( "NumberOfHistogramBins", 100 );
+  this->m_Parameters.SetUint( "InsideValue", 255 );
+  this->m_Parameters.SetUint( "OutsideValue", 0 );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::OtsuThresholdImageFilter::
+~OtsuThresholdImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::OtsuThresholdImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsImageFilters::OtsuThresholdImageFilter::
+_GD0( I* image )
+{
+  if( image != NULL )
+    return(
+      this->_GD1< I, itk::Image< unsigned char, I::ImageDimension > >( image )
+      );
+  else
+    return( "ImageFilters::OtsuThresholdImageFilter: No valid input image." );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+std::string cpPluginsImageFilters::OtsuThresholdImageFilter::
+_GD1( I* image )
+{
+  typedef itk::OtsuThresholdImageFilter< I, O > _F;
+  typedef typename O::PixelType _OP;
+
+  // Get parameters
+  unsigned int bins = this->m_Parameters.GetUint( "NumberOfHistogramBins" );
+  _OP in_val = _OP( this->m_Parameters.GetUint( "InsideValue" ) );
+  _OP out_val = _OP( this->m_Parameters.GetUint( "OutsideValue" ) );
+
+  // Configure filter
+  _F* filter = this->_CreateITK< _F >( );
+  filter->SetInput( dynamic_cast< I* >( image ) );
+  filter->SetNumberOfHistogramBins( bins );
+  filter->SetInsideValue( out_val ); // WARNING: these are inverted
+  filter->SetOutsideValue( in_val );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.h b/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.h
new file mode 100644 (file)
index 0000000..6c20f50
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__OTSUTHRESHOLDIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__OTSUTHRESHOLDIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT OtsuThresholdImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef OtsuThresholdImageFilter        Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( OtsuThresholdImageFilter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( OtsuThresholdImageFilter, ImageFilters );
+
+  protected:
+    OtsuThresholdImageFilter( );
+    virtual ~OtsuThresholdImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class I >
+      inline std::string _GD0( I* image );
+
+    template< class I, class O >
+      inline std::string _GD1( I* image );
+
+  private:
+    // Purposely not implemented
+    OtsuThresholdImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__OTSUTHRESHOLDIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.cxx b/plugins/cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.cxx
new file mode 100644 (file)
index 0000000..fcb03cd
--- /dev/null
@@ -0,0 +1,106 @@
+#include <cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.h>
+#include <cpPlugins/Image.h>
+
+#include <itkSignedMaurerDistanceMapImageFilter.h>
+#include <itkSignedMaurerDistanceMapImageFilter.hxx>
+#include <itkBinaryThresholdImageFilter.hxx>
+#include <itkImageToImageFilter.hxx>
+#include <itkInPlaceImageFilter.hxx>
+#include <itkUnaryFunctorImageFilter.hxx>
+#include <itkBinaryContourImageFilter.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::SignedMaurerDistanceMapImageFilter::
+SignedMaurerDistanceMapImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+
+  this->m_Parameters.ConfigureAsReal( "BackgroundValue" );
+  this->m_Parameters.ConfigureAsBool( "InsideIsPositive" );
+  this->m_Parameters.ConfigureAsBool( "SquaredDistance" );
+  this->m_Parameters.ConfigureAsBool( "UseImageSpacing" );
+
+  std::vector< std::string > choices;
+  choices.push_back( "float" );
+  choices.push_back( "double" );
+  this->m_Parameters.ConfigureAsChoices( "OutputResolution", choices );
+
+  this->m_Parameters.SetReal( "BackgroundValue", 0 );
+  this->m_Parameters.SetBool( "InsideIsPositive", true );
+  this->m_Parameters.SetBool( "SquaredDistance", false );
+  this->m_Parameters.SetBool( "UseImageSpacing", true );
+  this->m_Parameters.SetSelectedChoice( "OutputResolution", "float" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::SignedMaurerDistanceMapImageFilter::
+~SignedMaurerDistanceMapImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::SignedMaurerDistanceMapImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsImageFilters::SignedMaurerDistanceMapImageFilter::
+_GD0( I* image )
+{
+  if( image != NULL )
+  {
+    std::string out_res =
+      this->m_Parameters.GetSelectedChoice( "OutputResolution" );
+    if( out_res == "float" )
+      return(
+        this->_GD1< I, itk::Image< float, I::ImageDimension > >( image )
+        );
+  else if( out_res == "double" )
+    return(
+      this->_GD1< I, itk::Image< double, I::ImageDimension > >( image )
+      );
+  else
+    return( "ImageFilters::SignedMaurerDistanceMapImageFilter: Output resolution not supported." );
+  }
+  else
+    return(
+      "ImageFilters::SignedMaurerDistanceMapImageFilter: No valid input image."
+      );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+std::string cpPluginsImageFilters::SignedMaurerDistanceMapImageFilter::
+_GD1( I* image )
+{
+  typedef itk::SignedMaurerDistanceMapImageFilter< I, O > _F;
+
+  // Get parameters
+  double back_value = this->m_Parameters.GetReal( "BackgroundValue" );
+  bool pos_inside = this->m_Parameters.GetBool( "InsideIsPositive" );
+  bool sqr_dist = this->m_Parameters.GetBool( "SquaredDistance" );
+  bool use_spac = this->m_Parameters.GetBool( "UseImageSpacing" );
+
+  // Configure filter
+  _F* filter = this->_CreateITK< _F >( );
+  filter->SetInput( image );
+  filter->SetBackgroundValue( ( typename I::PixelType )( back_value ) );
+  filter->SetInsideIsPositive( pos_inside );
+  filter->SetSquaredDistance( sqr_dist );
+  filter->SetUseImageSpacing( use_spac );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.h b/plugins/cpPluginsImageFilters/SignedMaurerDistanceMapImageFilter.h
new file mode 100644 (file)
index 0000000..745193d
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT SignedMaurerDistanceMapImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef SignedMaurerDistanceMapImageFilter Self;
+    typedef cpPlugins::ProcessObject           Superclass;
+    typedef itk::SmartPointer< Self >          Pointer;
+    typedef itk::SmartPointer< const Self >    ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro(
+      SignedMaurerDistanceMapImageFilter, cpPlugins::ProcessObject
+      );
+    cpPlugins_Id_Macro(
+      SignedMaurerDistanceMapImageFilter,
+      ImageFilters
+      );
+
+  protected:
+    SignedMaurerDistanceMapImageFilter( );
+    virtual ~SignedMaurerDistanceMapImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class I >
+      inline std::string _GD0( I* image );
+
+    template< class I, class O >
+      inline std::string _GD1( I* image );
+
+  private:
+    // Purposely not implemented
+    SignedMaurerDistanceMapImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsWidgets/CMakeLists.txt b/plugins/cpPluginsWidgets/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a01eca9
--- /dev/null
@@ -0,0 +1,74 @@
+SET(lib_NAME cpPluginsWidgets)
+SET(lib_DIR  cpPluginsWidgets)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB lib_HEADERS_H   "*.h")
+FILE(GLOB lib_HEADERS_HPP "*.hpp")
+FILE(GLOB lib_HEADERS_HXX "*.hxx")
+FILE(GLOB lib_SOURCES_C   "*.c")
+FILE(GLOB lib_SOURCES_CPP "*.cpp")
+FILE(GLOB lib_SOURCES_CXX "*.cxx")
+
+# ===================================
+# = Integrate all source file names =
+# ===================================
+
+SET(
+  lib_HEADERS
+  ${lib_HEADERS_H}
+  ${lib_HEADERS_HPP}
+  ${lib_HEADERS_HXX}
+  )
+
+SET(
+  lib_SOURCES
+  ${lib_SOURCES_C}
+  ${lib_SOURCES_CPP}
+  ${lib_SOURCES_CXX}
+  )
+
+SET(
+  target_LIBRARIES
+  cpExtensions
+  cpPlugins
+  )
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${lib_NAME}_Host.cxx
+  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
+  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
+  )
+ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
+SET_TARGET_PROPERTIES(
+  ${lib_NAME} PROPERTIES
+  VERSION "${prj_VER}"
+  SOVERSION "${prj_sVER}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${lib_NAME}
+  BASE_NAME ${lib_NAME}
+  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
+  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${lib_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+
+## eof - $RCSfile$
diff --git a/plugins/cpPluginsWidgets/SeedWidget.cxx b/plugins/cpPluginsWidgets/SeedWidget.cxx
new file mode 100644 (file)
index 0000000..c5c014e
--- /dev/null
@@ -0,0 +1,214 @@
+#include "SeedWidget.h"
+
+#include <cpPlugins/Image.h>
+#include <cpExtensions/QT/SimpleMPRWidget.h>
+#include <cpExtensions/Interaction/ImageInteractorStyle.h>
+#include <vtkRenderWindowInteractor.h>
+#include <itkSimpleDataObjectDecorator.h>
+
+// -------------------------------------------------------------------------
+itk::ModifiedTimeType cpPluginsWidgets::SeedWidget::
+GetMTime( ) const
+{
+  // std::cout << "Seed GetMTime" << std::endl;
+  return( 0 /*this->Superclass::GetMTime( )*/ );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsWidgets::SeedWidget::
+SeedWidget( )
+  : Superclass( ),
+    m_Configured( false )
+{
+  this->_AddInput( "ReferenceImage" );
+  this->_AddOutput< cpPlugins::DataObject >( "Output" );
+
+  this->m_Parameters.ConfigureAsBool( "SeedsAreInRealSpace" );
+  this->m_Parameters.SetBool( "SeedsAreInRealSpace", false );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsWidgets::SeedWidget::
+~SeedWidget( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsWidgets::SeedWidget::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "ReferenceImage" );
+  std::string   r = cpPlugin_Image_Demangle_Dim( _GD0, image, 3 );
+  if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, image, 2 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsWidgets::SeedWidget::
+_GD0( I* image )
+{
+  if( image != NULL )
+  {
+    if( this->m_Parameters.GetBool( "SeedsAreInRealSpace" ) )
+      return( this->_GD1_Points< I >( image ) );
+    else
+      return( this->_GD1_Vertices< I >( image ) );
+  }
+  else
+    return( "Widgets::SeedWidget: Input image dimension not supported." );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsWidgets::SeedWidget::
+_GD1_Points( I* image )
+{
+  typedef cpExtensions::Interaction::ImageInteractorStyle _S;
+  typedef itk::Point< double, I::ImageDimension > _P;
+  typedef itk::SimpleDataObjectDecorator< std::vector< _P > > _Container;
+
+  auto container = this->_CreateITK< _Container >( );
+
+  double aux_pnt[ 3 ];
+  unsigned int dim = ( I::ImageDimension < 3 )? I::ImageDimension: 3;
+
+  container->Get( ).clear( );
+
+  // MPR
+  if( this->m_MPRViewer != NULL )
+  {
+    for( unsigned int i = 0; i < 4; ++i )
+    {
+      _S* s =
+        dynamic_cast< _S* >(
+          this->m_MPRViewer->GetInteractor( i )->GetInteractorStyle( )
+          );
+      if( s != NULL )
+      {
+        if( this->m_Configured )
+        {
+          for( unsigned int i = 0; i < s->GetNumberOfSeeds( ); ++i )
+          {
+            s->GetSeedAsPoint( i, aux_pnt );
+            _P seed;
+            for( unsigned int d = 0; d < dim; ++d )
+              seed[ d ] = aux_pnt[ d ];
+            container->Get( ).push_back( seed );
+
+          } // rof
+        }
+        else
+          s->SeedWidgetOn( );
+
+      } // fi
+
+    } // rof
+
+  } // fi
+
+  // Single interactor
+  _S* s = dynamic_cast< _S* >( this->m_SingleInteractor );
+  if( s != NULL )
+  {
+    if( this->m_Configured )
+    {
+      for( unsigned int i = 0; i < s->GetNumberOfSeeds( ); ++i )
+      {
+        s->GetSeedAsPoint( i, aux_pnt );
+        _P seed;
+        for( unsigned int d = 0; d < dim; ++d )
+          seed[ d ] = aux_pnt[ d ];
+        container->Get( ).push_back( seed );
+
+      } // rof
+    }
+    else
+      s->SeedWidgetOn( );
+
+  } // fi
+  this->m_Configured = true;
+
+  this->GetOutputData( "Output" )->SetITK( container );
+  return( "" );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPluginsWidgets::SeedWidget::
+_GD1_Vertices( I* image )
+{
+  typedef cpExtensions::Interaction::ImageInteractorStyle _S;
+  typedef
+    itk::SimpleDataObjectDecorator< std::vector< typename I::IndexType > >
+    _Container;
+  auto container = this->_CreateITK< _Container >( );
+
+  double aux_pnt[ 3 ];
+  unsigned int dim = ( I::ImageDimension < 3 )? I::ImageDimension: 3;
+
+  container->Get( ).clear( );
+
+  // MPR
+  if( this->m_MPRViewer != NULL )
+  {
+    for( unsigned int i = 0; i < 4; ++i )
+    {
+      _S* s =
+        dynamic_cast< _S* >(
+          this->m_MPRViewer->GetInteractor( i )->GetInteractorStyle( )
+          );
+      if( s != NULL )
+      {
+        if( this->m_Configured )
+        {
+          for( unsigned int i = 0; i < s->GetNumberOfSeeds( ); ++i )
+          {
+            s->GetSeedAsPoint( i, aux_pnt );
+            typename I::PointType seed;
+            for( unsigned int d = 0; d < dim; ++d )
+              seed[ d ] = aux_pnt[ d ];
+            typename I::IndexType idx;
+            if( image->TransformPhysicalPointToIndex( seed, idx ) )
+              container->Get( ).push_back( idx );
+
+          } // rof
+        }
+        else
+          s->SeedWidgetOn( );
+
+      } // fi
+
+    } // rof
+
+  } // fi
+
+  // Single interactor
+  _S* s = dynamic_cast< _S* >( this->m_SingleInteractor );
+  if( s != NULL )
+  {
+    if( this->m_Configured )
+    {
+      for( unsigned int i = 0; i < s->GetNumberOfSeeds( ); ++i )
+      {
+        s->GetSeedAsPoint( i, aux_pnt );
+        typename I::PointType seed;
+        for( unsigned int d = 0; d < dim; ++d )
+          seed[ d ] = aux_pnt[ d ];
+        typename I::IndexType idx;
+        if( image->TransformPhysicalPointToIndex( seed, idx ) )
+          container->Get( ).push_back( idx );
+
+      } // rof
+    }
+    else
+      s->SeedWidgetOn( );
+
+  } // fi
+  this->m_Configured = true;
+
+  this->GetOutputData( "Output" )->SetITK( container );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsWidgets/SeedWidget.h b/plugins/cpPluginsWidgets/SeedWidget.h
new file mode 100644 (file)
index 0000000..7b02d94
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef __CPPLUGINSWIDGETS__SEEDWIDGET__H__
+#define __CPPLUGINSWIDGETS__SEEDWIDGET__H__
+
+#include <plugins/cpPluginsWidgets/cpPluginsWidgets_Export.h>
+#include <cpPlugins/BaseWidget.h>
+
+namespace cpPluginsWidgets
+{
+  /**
+   */
+  class cpPluginsWidgets_EXPORT SeedWidget
+    : public cpPlugins::BaseWidget
+  {
+  public:
+    typedef SeedWidget                      Self;
+    typedef cpPlugins::BaseWidget           Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( SeedWidget, cpPlugins::BaseWidget );
+    cpPlugins_Id_Macro( SeedWidget, Widgets );
+
+  public:
+    virtual itk::ModifiedTimeType GetMTime( ) const;
+
+  protected:
+    SeedWidget( );
+    virtual ~SeedWidget( );
+
+    virtual std::string _GenerateData( );
+
+    template< class I >
+      inline std::string _GD0( I* image );
+
+    template< class I >
+      inline std::string _GD1_Points( I* image );
+
+    template< class I >
+      inline std::string _GD1_Vertices( I* image );
+
+  private:
+    // Purposely not implemented
+    SeedWidget( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    bool m_Configured;
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSWIDGETS__SEEDWIDGET__H__
+
+// eof - $RCSfile$