Commit 054da3bd authored by Julien Wintz's avatar Julien Wintz

Merge branch 'master' of github.com:d-tk/dtk

parents ebdf8a9b a4fd7089
......@@ -442,6 +442,7 @@ mark_as_advanced(Qt5Qml_DIR)
mark_as_advanced(Qt5Quick_DIR)
mark_as_advanced(Qt5QuickTest_DIR)
mark_as_advanced(Qt5Script_DIR)
mark_as_advanced(Qt5Svg_DIR)
mark_as_advanced(Qt5Test_DIR)
mark_as_advanced(Qt5Widgets_DIR)
mark_as_advanced(Qt5Xml_DIR)
......
......@@ -20,6 +20,10 @@ set(${PROJECT_NAME}_SOURCES
add_executable(${PROJECT_NAME}
${${PROJECT_NAME}_SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_RPATH 0)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
target_link_libraries(${PROJECT_NAME}
dtkCoreSupport
dtkComposer
......
......@@ -179,7 +179,7 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname
${_testrunner} ${ARGV3}
# Running gcovr
COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml
COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/build/' -e '${CMAKE_SOURCE_DIR}/tst/' -o ${_outputname}.xml
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running gcovr to produce Cobertura code coverage report."
)
......
......@@ -77,7 +77,7 @@ set(DTK_HAVE_ZLIB @DTK_HAVE_ZLIB@)
if(DTK_BUILD_COMPOSER)
set(dtk_INCLUDE_DIRS ${dtk_INCLUDE_DIRS}
"@CMAKE_INSTALL_PREFIX@/include/dtkComposer")
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkComposer")
endif(DTK_BUILD_COMPOSER)
######################################################################
......
......@@ -30,6 +30,9 @@ set(dtk_INCLUDE_DIRS
"@CMAKE_INSTALL_PREFIX@/include/dtkMeta"
"@CMAKE_INSTALL_PREFIX@/include/dtkTest")
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH} "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/")
set(DTK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(dtk_INSTALL_DOCS "@CMAKE_INSTALL_PREFIX@/doc")
......@@ -76,6 +79,18 @@ if(DTK_BUILD_COMPOSER)
"@CMAKE_INSTALL_PREFIX@/include/dtkComposer")
endif(DTK_BUILD_COMPOSER)
## ###################################################################
## Always full RPATH
## ###################################################################
include(GNUInstallDirs)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
ENDIF("${isSystemDir}" STREQUAL "-1")
######################################################################
### dtkConfig.cmake.in ends here
......@@ -105,6 +105,20 @@ add_custom_target(dtkDistributed-doc
add_dependencies(dtkDistributed-doc dtkCore-doc)
## ###################################################################
## dtkComposer
## ###################################################################
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dtkComposer/dtkcomposer.qdocconf.in ${CMAKE_CURRENT_BINARY_DIR}/dtkcomposer.qdocconf IMMEDIATE @ONLY)
add_custom_target(dtkComposer-doc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${DTK_QDOC_EXECUTABLE} dtkcomposer.qdocconf
COMMAND ${QT5_QHGN_EXECUTABLE} ${dtk_INSTALL_DOCS}/dtkcomposer/dtkcomposer.qhp -o ${dtk_INSTALL_DOCS}/dtkcomposer.qch
COMMENT "-- Generating dtkComposer documentation")
add_dependencies(dtkComposer-doc dtkCore-doc)
## ###################################################################
## ALL
## ###################################################################
......@@ -115,7 +129,7 @@ add_custom_target(doc
COMMAND ${QT5_QHGN_EXECUTABLE} ${dtk_INSTALL_DOCS}/dtkdoc/dtkdoc.qhp -o ${dtk_INSTALL_DOCS}/dtkdoc.qch
COMMENT "-- Generating dtk documentation")
add_dependencies(doc dtkMeta-doc dtkLog-doc dtkCore-doc dtkDistributed-doc)
add_dependencies(doc dtkMeta-doc dtkLog-doc dtkCore-doc dtkDistributed-doc dtkComposer-doc)
######################################################################
### CMakeLists.txt ends here
## Version: $Id$
##
##
######################################################################
##
### Commentary:
##
##
### Commentary:
##
######################################################################
##
##
### Change Log:
##
##
######################################################################
##
##
### Code:
include(@dtk_CONFIG_DOCS@/dtk-config.qdocconf)
......@@ -44,15 +44,18 @@ exampledirs += ../../../doc/dtk/snp
imagedirs += ../../../doc/dtk/img
excludedirs += ../../../doc/dtk/snp
outputdir = @dtk_INSTALL_DOCS@/dtkdoc
indexes = \
@dtk_INSTALL_DOCS@/dtklog/dtklog.index \
@dtk_INSTALL_DOCS@/dtkmeta/dtkmeta.index \
@dtk_INSTALL_DOCS@/dtkcore/dtkcore.index \
@dtk_INSTALL_DOCS@/dtkcomposer/dtkcomposer.index \
@dtk_INSTALL_DOCS@/dtkdistributed/dtkdistributed.index \
@dtk_INSTALL_DOCS@/dtkio/dtkio.index \
@dtk_INSTALL_DOCS@/dtklinearalgebradense/dtklinearalgebradense.index
@dtk_INSTALL_DOCS@/dtklinearalgebradense/dtklinearalgebradense.index \
@dtk_INSTALL_DOCS@/dtkimaging/dtkimaging.index
outputdir = @dtk_INSTALL_DOCS@/dtkdoc
######################################################################
### dtk.qdocconf.in ends here
/* dtk-allAPI.qdoc ---
*
* Author: Thibaud Kloczko
* Created: mer. avril 9 10:18:20 2014 (+0200)
* Version:
* Last-Updated: lun. nov. 23 14:17:46 2015 (+0100)
* By: Thibaud Kloczko
* Update #: 5
*/
// Version: $Id$
//
//
/* Change Log:
*
*/
// Commentary:
//
//
// Change Log:
//
//
// Code:
/*!
\group dtk-allAPI
......@@ -20,4 +20,6 @@
This page lists the C++ APIs in dtk. The \l{All Modules} page contains a list
of all dtk modules.
*/
1
//
// dtk-allAPI.qdoc ends here
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
/*!
\page dtk-guides.html
\title All dtk Guides
\brief A list of all the guides in dtk.
\table 80%
\header
\li Guide
\li Description
\row
\li \l{How to Add a new ITK filter} {How to Add a new ITK filter}
\li Describes the steps to add a plugin to dtkImaging containing an ITK filter.
\endtable
*/
//
// dtk-guides.qdoc ends here
......@@ -42,6 +42,7 @@
\list
\li \l{All Modules}{All dtk Modules}
\li \l{All dtk Classes}{All dtk Classes}
\li \l{All dtk Guides}{All dtk Guides}
\endlist
\enddiv
\enddiv
......
......@@ -33,6 +33,9 @@
\row
\li \l{Core Module} {Core}
\li Fundamental concepts and related tools.
\row
\li \l{Composer Module} {Composer}
\li Visual programming framework.
\row
\li \l{Meta Module} {Meta}
\li Meta concepts.
......@@ -57,6 +60,9 @@
\row
\li \l{dtkIo Module} {Input/Output}
\li High level interface to deal with input/output Data Model (ASCII, Hdf5,..).
\row
\li \l{dtkImaging Module} {Imaging}
\li High level interface for image processing.
\endtable
\section1 dtk Applications
......
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:
include(@dtk_CONFIG_DOCS@/dtk-config.qdocconf)
project = dtkComposer
description = dtkComposer Reference Documentation
url = ../dtkcomposer
qhp.projects = dtkComposer
qhp.dtkComposer.file = dtkcomposer.qhp
qhp.dtkComposer.namespace = fr.inria.dtk.dtkcomposer
qhp.dtkComposer.virtualFolder = dtkcomposer
qhp.dtkComposer.indexTitle = Composer Module
qhp.dtkComposer.indexRoot =
qhp.dtkComposer.filterAttributes = dtkcomposer
qhp.dtkComposer.customFilters.dtk.name = dtkComposer
qhp.dtkComposer.customFilters.dtk.filterAttributes = dtkcomposer
qhp.dtkComposer.subprojects = classes
qhp.dtkComposer.subprojects.classes.title = C++ Classes
qhp.dtkComposer.subprojects.classes.indexTitle = Composer C++ Classes
qhp.dtkComposer.subprojects.classes.selectors = class fake:headerfile
qhp.dtkComposer.subprojects.classes.sortPages = true
headerdirs += ../../../src/dtkComposer
sourcedirs += ../../../src/dtkComposer \
../../../doc/dtkComposer/src
exampledirs += ../../../doc/dtkComposer/snp
imagedirs += ../../../doc/dtkComposer/img
excludedirs += ../../../doc/dtkComposer/snp
navigation.landingpage = "Composer Module"
navigation.cppclassespage = "Composer C++ Classes"
outputdir = @dtk_INSTALL_DOCS@/dtkcomposer
indexes = \
@QT5_DOCUMENTATION_D@/qtcore/qtcore.index \
@dtk_INSTALL_DOCS@/dtkcore/dtkcore.index \
@dtk_INSTALL_DOCS@/dtkdoc/dtkdoc.index
######################################################################
### dtkcomposer.qdocconf.in ends here
/*!
\page dtkcomposer-index.html
\title Composer Module
\brief A module which provides a set of C++ technologies for building visual programs
\section1 Reference
These are links to the API reference materials.
\list
\li \l{Composer C++ Classes}{C++ Classes API}
\endlist
\sa {All Modules}
*/
/*!
\module dtkComposer
\title Composer C++ Classes
\ingroup dtk-allAPI
\brief Provides all the mechanisms to provide a visual programming framework.
Composer layer provides a visual programming framework that enables not only to manipulate fundamental concepts defined in the Core layer (data, process, view) but also to integrate some features from other layers (e.g. dtkDistributed layer or dtkLinearAlgebraSparse layer). As the Core layer, it can be extended in any application logic so as to handle additional concepts.
Composer layer is made up of three main frameworks, namely logic, scene and evaluation, that are at the heart of the visual programming concept. Three additional frameworks (command, interfaces, integration) provides peripheral tools that extend functionalities both in terms of programmation and interaction.
\section1 Logic framework
This framework defines the logic of the data flow through two main concepts: the concept of node and the concept of transmitter.
dtkComposerNode
A node is a more or less atomic piece of the data flow that embeds a given logic. Three kind of nodes exist:
\list
\li Leaf nodes wrap logics provided by other layers of dtk or application logics (e.g. dtkCore or numCore).
\li Composite nodes enables to define sub part of composition in order to provide some services or just to simplify the data flow for the end user.
\li Control nodes define control structure that allow to perform loop or switch between some parts of the composition.
\endlist
\section1 dtkComposerTransmitter
Transmitters enable data transmission between nodes. Transmission can be carried out according to two modes, namely a strong types data mode based on templates and a weak typed data mode based on QVariant. Furthermore, four types of transmitters exist:
\list
\li dtkComposerTransmitterEmitter enables to send data according to the strong types way.
\li dtkComposerTransmitterReceiver enables to receive data according to the strong types way.
\li dtkComposerTransmitterProxy is used as relay between emitters and receivers, it is not typed at all.
\li dtkComposerTransmitterVariant can play the role of both an emitter or a receiver. It is weakly typed, that is to say it can connect two nodes that exchange data of not exactly the same type (e.g. integer and real).
\endlist
\section1 Shortcuts
To facilitate the use of the composer, some shortcuts can be employed:
\list
\li [ CTRL ] [ R ] : Evaluate a composition
\li [ CTRL ] [ G ] : Group selected nodes into a composite node
\li [ CTRL ] [ U ] : Ungroup a composite node
\li [ CTRL ] [ Z ] : Undo
\li [ CTRL ] [ backspace ] : delete a selected node
\li [ CTRL ] [ O ] : load a composition
\li [ CTRL ] [ SHIFT ] [ 1 ] : load last composition
\li [ CTRL ] [ S ] : save a composition
\endlist
*/
......@@ -39,6 +39,8 @@ set(${PROJECT_NAME}_HEADERS
dtkCorePluginManager.tpp
dtkCoreSettings
dtkCoreSettings.h
dtkHash
dtkHash.h
dtkIterator
dtkIterator.h
dtkSpinLock.h
......
......@@ -87,5 +87,57 @@ public:
#define DTK_DEFINE_PLUGIN(type) \
Q_PLUGIN_METADATA(IID DTK_DECLARE_PLUGIN_INTERFACE(type))
// /////////////////////////////////////////////////////////////////
// DTK_DECLARE_CONCEPT
// /////////////////////////////////////////////////////////////////
#define DTK_DECLARE_CONCEPT(type, Export, Namespace) \
namespace Namespace \
{ \
Export type##PluginFactory& pluginFactory(); \
Export type##PluginManager& pluginManager(); \
Export type *create(const QString& key); \
Export void initialize(const QString& path); \
Export void uninitialize(void); \
}
// /////////////////////////////////////////////////////////////////
// DTK_DEFINE_CONCEPT
// /////////////////////////////////////////////////////////////////
#define DTK_DEFINE_CONCEPT(type, Namespace) \
namespace Namespace \
{ \
namespace _private \
{ \
type##PluginFactory factory; \
type##PluginManager manager; \
} \
\
type##PluginFactory& pluginFactory() \
{ \
return _private::factory; \
} \
\
type##PluginManager& pluginManager() \
{ \
return _private::manager; \
} \
\
type *create(const QString& key) \
{ \
return pluginFactory().create(key); \
} \
\
void initialize(const QString& path) \
{ \
pluginManager().initialize(path); \
} \
void uninitialize(void) \
{ \
pluginManager().uninitialize(); \
} \
}
//
// dtkCorePlugin.h ends here
#include <dtkHash.h>
\ No newline at end of file
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#include <complex>
#include <deque>
#include <functional>
#include <list>
#include <map>
#include <set>
#include <utility>
#include <vector>
// /////////////////////////////////////////////////////////////////
// Helper functions
// /////////////////////////////////////////////////////////////////
template <typename SizeT> inline void dtkHashCombineImpl(SizeT& seed, SizeT value)
{
seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2);
}
template < typename T > inline void dtkHashCombine(std::size_t& seed, const T& v)
{
std::hash<T> hasher;
dtkHashCombineImpl(seed, hasher(v));
}
template < typename It > inline std::size_t dtkHashRange(It first, It last)
{
std::size_t seed = 0;
for(; first != last; ++first) {
dtkHashCombineImpl(seed, *first);
}
return seed;
}
// /////////////////////////////////////////////////////////////////
// dtkHash functor
// /////////////////////////////////////////////////////////////////
struct dtkHash
{
public:
template < typename T, typename U > std::size_t operator()(const std::pair<T, U>& c) const;
template < typename T, typename A > std::size_t operator()(const std::vector<T, A>& c) const;
template < typename T, typename A > std::size_t operator()(const std::list<T, A>& c) const;
template < typename T, typename A > std::size_t operator()(const std::deque<T, A>& c) const;
template < typename K, typename C, typename A > std::size_t operator()(const std::set<K, C, A>& c) const;
template < typename K, typename C, typename A > std::size_t operator()(const std::multiset<K, C, A>& c) const;
template < typename K, typename T, typename C, typename A > std::size_t operator()(const std::map<K, T, C, A>& c) const;
template < typename K, typename T, typename C, typename A > std::size_t operator()(const std::multimap<K, T, C, A>& c) const;
template < typename T > std::size_t operator()(const std::complex<T>& c) const;
};
// /////////////////////////////////////////////////////////////////
// dtkHash functor implementation
// /////////////////////////////////////////////////////////////////
template < typename T, typename U > inline std::size_t dtkHash::operator()(const std::pair<T, U>& c) const
{
std::size_t seed = 0;
dtkHashCombine(seed, c.first);
dtkHashCombine(seed, c.second);
return seed;
}
template < typename T, typename A > inline std::size_t dtkHash::operator()(const std::vector<T, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename T, typename A > inline std::size_t dtkHash::operator()(const std::list<T, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename T, typename A > inline std::size_t dtkHash::operator()(const std::deque<T, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename K, typename C, typename A > inline std::size_t dtkHash::operator()(const std::set<K, C, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename K, typename C, typename A > inline std::size_t dtkHash::operator()(const std::multiset<K, C, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename K, typename T, typename C, typename A> inline std::size_t dtkHash::operator()(const std::map<K, T, C, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename K, typename T, typename C, typename A > inline std::size_t dtkHash::operator()(const std::multimap<K, T, C, A>& c) const
{
return dtkHashRange(c.begin(), c.end());
}
template < typename T > inline std::size_t dtkHash::operator()(const std::complex<T>& c) const
{
std::size_t seed = 0;
dtkHashCombine(seed, c.imag());
dtkHashCombine(seed, c.real());
return seed;
}
//
// dtkHash.h ends here
......@@ -558,9 +558,37 @@ void dtkDistributedGraphTopology::assemble(void)
auto it = m_dd.map_hybrid.cbegin();
auto ite = m_dd.map_hybrid.cend();
qlonglong buffer_array[512];
qlonglong last_key=it.key();
int local_counter=0;
qlonglong buffer_index = it.key();
for(; it != ite; ++it) {
m_neighbour_count->addAssign(it.key(), (*it).size());
if(it.key() < last_key)
qDebug() << "PB QMAP not ordered !!!" << it.key() << last_key;
qlonglong gap = it.key() - last_key;
//buffer is full or there is a gap too large, send it
if((local_counter+gap+1)>=511) {
m_neighbour_count->addAssign(buffer_index, buffer_array, local_counter);
buffer_index = it.key();
last_key = it.key();
local_counter=0;
gap=0;
}
//otherwise test if we have to fill buffer_array with 0
for(auto i=0; i <(gap-1); ++i) {
buffer_array[local_counter++]=0;
}
//then had this value to the buffer
buffer_array[local_counter++] = (*it).size();
last_key = it.key();
}
//finally send the last values
m_neighbour_count->addAssign(buffer_index, buffer_array, local_counter);
}
this->m_comm->barrier();
......
......@@ -49,7 +49,7 @@ QString dtkMetaType::description(const QVariant& v)
}
} else if (!userStream) {