Skip to content

Commit

Permalink
Reorganize tree to have sources in src/
Browse files Browse the repository at this point in the history
  • Loading branch information
ypnos committed May 27, 2020
1 parent 8b15b2d commit d96d364
Show file tree
Hide file tree
Showing 176 changed files with 125 additions and 111 deletions.
50 changes: 15 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ include(flags)

set(APP_NAME belki)

add_executable(${APP_NAME} MACOSX_BUNDLE main.cpp)
add_executable(${APP_NAME} MACOSX_BUNDLE src/main.cpp)
set_target_properties(${APP_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
export_version(main.cpp)

## PLATFORM SUPPORT
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
Expand All @@ -51,45 +50,26 @@ if (APPLE)
target_sources(${APP_NAME} PRIVATE resources/icon.icns)
endif()

## SOURCES
# mean shift
target_sources(${APP_NAME} PRIVATE
meanshift/fams.h meanshift/fams.cpp
meanshift/io.cpp meanshift/mode_pruning.cpp
)
## COMPONENTS (they add to target 'belki')
target_include_directories(${APP_NAME} PRIVATE src/core)
add_subdirectory(src/core)
add_subdirectory(src/compute)
add_subdirectory(src/storage)
add_subdirectory(src/widgets)
add_subdirectory(src/profiles)
add_subdirectory(src/scatterplot)
add_subdirectory(src/heatmap)
add_subdirectory(src/distmat)
add_subdirectory(src/featweights)

# resources
## RESOURCES
target_sources(${APP_NAME} PRIVATE
resources/index.qrc
resources/icons-stock/index.qrc
resources/icons-custom/index.qrc
)

# main application
target_sources(${APP_NAME} PRIVATE
datahub.h datahub.cpp
dataset.h dataset.cpp
fileio.h fileio.cpp
guistate.h guistate.cpp
jobregistry.h jobregistry.cpp
model.h
proteindb.h proteindb.cpp
utils.h
viewer.h viewer.cpp
windowstate.h windowstate.cpp
)

# components (they add to target 'belki')
add_subdirectory(compute)
add_subdirectory(storage)
add_subdirectory(widgets)
add_subdirectory(profiles)
add_subdirectory(scatterplot)
add_subdirectory(heatmap)
add_subdirectory(distmat)
add_subdirectory(featweights)

export_version(widgets/mainwindow.cpp) # for About box
export_version(src/main.cpp)
export_version(src/widgets/mainwindow.cpp) # for About box

## link to modules
target_include_directories(${APP_NAME} SYSTEM PUBLIC ${DEP_INCLUDES})
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pkg_check_modules(ARPACK REQUIRED arpack)
find_package(Eigen3 3.3 REQUIRED NO_MODULE)

list(APPEND DEP_INCLUDES
${PROJECT_SOURCE_DIR}/include # for self-distributed Tapkee
${PROJECT_SOURCE_DIR}/tapkee # for self-distributed Tapkee
${ARPACK_INCLUDE_DIRS}
)

Expand Down
7 changes: 7 additions & 0 deletions compute/CMakeLists.txt → src/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ target_sources(${APP_NAME} PRIVATE
dimred.h dimred.cpp
features.h features.cpp
)

# mean shift
target_sources(${APP_NAME} PRIVATE
meanshift/fams.h meanshift/fams.cpp
meanshift/io.cpp meanshift/mode_pruning.cpp
)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion compute/components.cpp → src/compute/components.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "components.h"
#include "dataset.h"
#include "compute/features.h"
#include "features.h"

#include <tbb/parallel_for.h>
#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion compute/components.h → src/compute/components.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define COMPONENTS_H

#include "model.h"
#include "profiles/bnmsmodel.h" // TODO: awkward, see comment in that file
#include "../profiles/bnmsmodel.h" // TODO: awkward, see comment in that file

#include <QObject>
#include <QThread>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
target_sources(${APP_NAME} PRIVATE
datahub.h datahub.cpp
dataset.h dataset.cpp
fileio.h fileio.cpp
guistate.h guistate.cpp
jobregistry.h jobregistry.cpp
model.h
proteindb.h proteindb.cpp
utils.h
viewer.h viewer.cpp
windowstate.h windowstate.cpp
)

2 changes: 1 addition & 1 deletion datahub.cpp → src/core/datahub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "proteindb.h"
#include "dataset.h"
#include "storage/storage.h"
#include "../storage/storage.h"

#include <QThread>
#include <QVector>
Expand Down
File renamed without changes.
10 changes: 8 additions & 2 deletions dataset.cpp → src/core/dataset.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "dataset.h"
#include "compute/features.h"
#include "compute/dimred.h"
#include "../compute/annotations.h"
#include "../compute/features.h"
#include "../compute/dimred.h"

#include <QDataStream>
#include <QTextStream>
Expand All @@ -19,6 +20,11 @@ Dataset::Dataset(ProteinDB &proteins, DatasetConfiguration conf)
qRegisterMetaType<ConstPtr>("ConstDataPtr");
}

Dataset::~Dataset()
{
// needed for unique_ptr of incomplete type in header
}

template<>
View<Dataset::Base> Dataset::peek() const { return View(b); }
template<>
Expand Down
3 changes: 2 additions & 1 deletion dataset.h → src/core/dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "utils.h"
#include "model.h"
#include "proteindb.h"
#include "compute/annotations.h"

#include <QObject>
#include <QFlags>
Expand All @@ -15,6 +14,7 @@
#include <map>
#include <memory>

namespace annotations { class Meanshift; }
class QTextStream;

// a configuration that describes processing resulting in a dataset
Expand Down Expand Up @@ -93,6 +93,7 @@ class Dataset : public QObject
using Touched = QFlags<Touch>;

explicit Dataset(ProteinDB &proteins, DatasetConfiguration conf);
~Dataset();
const DatasetConfiguration& config() const { return conf; }
unsigned id() const { return conf.id; }
void setName(const QString &name) { conf.name = name; }
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion guistate.cpp → src/core/guistate.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "guistate.h"
#include "datahub.h"
#include "widgets/mainwindow.h"
#include "fileio.h"
#include "jobregistry.h"
#include "../widgets/mainwindow.h"

#include <QAbstractProxyModel>
#include <QTimer>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions model.h → src/core/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#include <memory>
#include <variant>

#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
#include "utils.h" // needed with Qt<5.14 for std::map<QString,…>
#endif

using ProteinId = unsigned; // for semantic distinction

Expand Down
4 changes: 2 additions & 2 deletions proteindb.cpp → src/core/proteindb.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "proteindb.h"
#include "compute/annotations.h"
#include <compute/colors.h>
#include "../compute/annotations.h"
#include "../compute/colors.h"

#include <QTextStream>
#include <QRegularExpression>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion windowstate.h → src/core/windowstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define WINDOWSTATE_H

#include "model.h"
#include "compute/colors.h"
#include "../compute/colors.h"

#include <QObject>
#include <QPointer>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion distmat/distmat.cpp → src/distmat/distmat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "distmat.h"
#include "compute/colors.h"
#include "../compute/colors.h"

#include <tbb/parallel_for.h>

Expand Down
2 changes: 1 addition & 1 deletion distmat/distmat.h → src/distmat/distmat.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DISTMAT_H
#define DISTMAT_H

#include "compute/features.h"
#include "../compute/features.h"

#include <QVector>
#include <QPixmap>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion distmat/distmatscene.h → src/distmat/distmatscene.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DISTMATSCENE_H
#define DISTMATSCENE_H

#include "widgets/graphicsscene.h"
#include "../widgets/graphicsscene.h"
#include "dataset.h"
#include "distmat.h"
#include "utils.h"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion distmat/distmattab.ui → src/distmat/distmattab.ui
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<customwidget>
<class>GraphicsView</class>
<extends>QGraphicsView</extends>
<header>widgets/graphicsview.h</header>
<header>src/widgets/graphicsview.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "featweightsscene.h"
#include "compute/colors.h"
#include "compute/features.h"
#include "../compute/colors.h"
#include "../compute/features.h"

#include <QPainter>
#include <QGraphicsPixmapItem>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef FEATWEIGHTSSCENE_H
#define FEATWEIGHTSSCENE_H

#include "widgets/graphicsscene.h"
#include "../widgets/graphicsscene.h"
#include "dataset.h"
#include "utils.h"

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
<customwidget>
<class>GraphicsView</class>
<extends>QGraphicsView</extends>
<header>widgets/graphicsview.h</header>
<header>src/widgets/graphicsview.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions heatmap/heatmapscene.cpp → src/heatmap/heatmapscene.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "heatmapscene.h"
#include "windowstate.h"
#include "compute/colors.h"
#include "compute/features.h"
#include "../compute/colors.h"
#include "../compute/features.h"

#include <QPainter>
#include <QGraphicsItem>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion heatmap/heatmaptab.ui → src/heatmap/heatmaptab.ui
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<customwidget>
<class>HeatmapView</class>
<extends>QGraphicsView</extends>
<header>heatmap/heatmapview.h</header>
<header>src/heatmap/heatmapview.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion profiles/bnmschart.cpp → src/profiles/bnmschart.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "bnmschart.h"
#include "dataset.h"
#include "compute/colors.h"
#include "../compute/colors.h"

#include <QtCharts/QLineSeries>
#include <QtCharts/QValueAxis>
Expand Down
2 changes: 1 addition & 1 deletion profiles/bnmschart.h → src/profiles/bnmschart.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "profilechart.h"
#include "bnmsmodel.h"
#include "compute/components.h"
#include "../compute/components.h"

class BnmsChart : public ProfileChart
{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion profiles/bnmstab.cpp → src/profiles/bnmstab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "jobregistry.h" // for splice

// stuff for loading components. will most-probably be moved elsewhere!
#include "compute/components.h"
#include "../compute/components.h"
#include "fileio.h"
#include <QTextStream>

Expand Down
File renamed without changes.
Loading

0 comments on commit d96d364

Please sign in to comment.