diff --git a/Src/CMakeLists.txt b/Src/CMakeLists.txt index 541b25b7dcb5912511a76a3cff962237bdd5968d..e167e92ccb3b72d211ca48d360687c4e9759c161 100644 --- a/Src/CMakeLists.txt +++ b/Src/CMakeLists.txt @@ -12,17 +12,13 @@ add_behavior_plugin(${target} "BioTrackerPlugin.cpp" "View/TrackedElementView.cpp" "View/TrackerParameterView.cpp" - "Model/null_Model.cpp" "Model/BioTrackerTrackingAlgorithm.cpp" "Model/TrackerParameter.cpp" - "Model/TrackedComponents/TrackedComponentFactory.cpp" "Model/TrackedComponents/TrackedElement.cpp" "Model/TrackedComponents/TrackedTrajectory.cpp" "Model/TrackedComponents/pose/FishPose.cpp" - "helper/StringHelper.cpp" "Controller/ControllerTrackedComponent.cpp" "Controller/ControllerTrackingAlgorithm.cpp" - "Controller/null_Controller.cpp" ) install(TARGETS ${target} OPTIONAL DESTINATION .) diff --git a/Src/Controller/null_Controller.cpp b/Src/Controller/null_Controller.cpp deleted file mode 100644 index 612c02f3a220bdb5dac5ee38c26e2a7f9d7e4d61..0000000000000000000000000000000000000000 --- a/Src/Controller/null_Controller.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "null_Controller.h" - -null_Controller::null_Controller() -{ - -} - -void null_Controller::createModel() -{ - -} - -void null_Controller::createView() -{ - -} - -void null_Controller::connectModelToController() -{ - -} - -void null_Controller::connectControllerToController() -{ - -} diff --git a/Src/Controller/null_Controller.h b/Src/Controller/null_Controller.h deleted file mode 100644 index a0fcc211f6da112ab9ff01c8c535c9c29ebf1762..0000000000000000000000000000000000000000 --- a/Src/Controller/null_Controller.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NULL_CONTROLLER_H -#define NULL_CONTROLLER_H - -#include "Interfaces/IController/IController.h" -class null_Controller : public IController -{ -public: - null_Controller(); - - // IController interface -protected: - void createModel() override; - void createView() override; - void connectModelToController() override; - void connectControllerToController() override; -}; - -#endif // NULL_CONTROLLER_H diff --git a/Src/Model/BioTrackerTrackingAlgorithm.cpp b/Src/Model/BioTrackerTrackingAlgorithm.cpp index 0cf053f5ded7bec266907f05c89ddb592addeee8..419c1a614a14a106da5fdca59b72e71cae018623 100644 --- a/Src/Model/BioTrackerTrackingAlgorithm.cpp +++ b/Src/Model/BioTrackerTrackingAlgorithm.cpp @@ -10,7 +10,6 @@ #include "BioTrackerTrackingAlgorithm.h" #include <future> -#include "TrackedComponents/TrackedComponentFactory.h" #include "TrackedComponents/pose/FishPose.h" #include <chrono> #include <zmq.hpp> diff --git a/Src/Model/TrackedComponents/TrackedComponentFactory.cpp b/Src/Model/TrackedComponents/TrackedComponentFactory.cpp deleted file mode 100644 index d2e92cd9d8e695ce94eeab2fadd579055b65e379..0000000000000000000000000000000000000000 --- a/Src/Model/TrackedComponents/TrackedComponentFactory.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "TrackedComponentFactory.h" - -#include "TrackedTrajectory.h" -#include "TrackedElement.h" - -namespace BST{ - - TrackedComponentFactory::TrackedComponentFactory() - { - - } - - TrackedComponentFactory::~TrackedComponentFactory() - { - - } - - QList<QString> TrackedComponentFactory::getElementTypes() { - return QList<QString>{ "TrackedElement" }; - } - - IModelTrackedComponent *TrackedComponentFactory::createTrackedElement(QString name) - { - return new BST::TrackedElement(this, "n.a."); - } - - IModelTrackedComponent *TrackedComponentFactory::createTrackedObject(QString name) - { - BST::TrackedTrajectory *t = new BST::TrackedTrajectory(); - BST::TrackedElement *e = new BST::TrackedElement(this, "n.a.", 0); - t->add(e, 0); - return t; - } - - IModelTrackedComponent *TrackedComponentFactory::createTrackedTrajectory(QString name) - { - return new BST::TrackedTrajectory(); - } -} diff --git a/Src/Model/TrackedComponents/TrackedComponentFactory.h b/Src/Model/TrackedComponents/TrackedComponentFactory.h deleted file mode 100644 index 26455a20f40a6ce802344d966ff538caf136a149..0000000000000000000000000000000000000000 --- a/Src/Model/TrackedComponents/TrackedComponentFactory.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "Interfaces/IModel/IModelTrackedComponentFactory.h" - -namespace BST{ - -class TrackedComponentFactory : public IModelTrackedComponentFactory -{ - Q_OBJECT -public: - TrackedComponentFactory(); - ~TrackedComponentFactory(); - - QList<QString> getElementTypes() override; - - // ITrackedComponentFactory interface -protected: - IModelTrackedComponent *createTrackedElement(QString name) override; - IModelTrackedComponent *createTrackedObject(QString name) override; - IModelTrackedComponent *createTrackedTrajectory(QString name) override; -}; -} - diff --git a/Src/Model/null_Model.cpp b/Src/Model/null_Model.cpp deleted file mode 100644 index db2793d0195a5d1ce8905db2a5496bf564288d16..0000000000000000000000000000000000000000 --- a/Src/Model/null_Model.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "null_Model.h" - -null_Model::null_Model() -{ - -} diff --git a/Src/Model/null_Model.h b/Src/Model/null_Model.h deleted file mode 100644 index 8dabf466f4c10b71b0238727e7871da44dfda0f2..0000000000000000000000000000000000000000 --- a/Src/Model/null_Model.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef NULL_MODEL_H -#define NULL_MODEL_H - -#include "Interfaces/IModel/IModel.h" - -class null_Model : public IModel -{ - Q_OBJECT -public: - null_Model(); -}; - -#endif // NULL_MODEL_H diff --git a/Src/helper/StringHelper.cpp b/Src/helper/StringHelper.cpp deleted file mode 100644 index 4f4b3f8dd8b0fe75af1c2381324388651d8be0a3..0000000000000000000000000000000000000000 --- a/Src/helper/StringHelper.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "StringHelper.h" - -#include <algorithm> -#include <string> - - -bool StringHelper::hasEnding(std::string const &fullString, std::string const &ending) -{ - if (fullString.length() >= ending.length()) - return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending)); - else - return false; -} - - -bool StringHelper::startsWithDigit(std::string const &fullString) -{ - if(fullString.empty()) - return false; - - - if(isdigit(fullString.at(0))) - { - return true; - } - - return false; - -} - -bool StringHelper::startsWithDigitQ(QString fullString) -{ - return StringHelper::startsWithDigit(fullString.toLocal8Bit().data()); -} - -bool StringHelper::isNumber(QString fullStringQ) -{ - std::string fullString = fullStringQ.toLocal8Bit().data(); - - for(int i = 0; i < fullString.length(); i++) - { - if(isdigit(fullString.at(i))) - { - return true; - } - - } - - return false; -} - -std::string StringHelper::iToSS(int int_num) -{ - return QString::number(int_num).toUtf8().constData(); -} - -std::string StringHelper::boolToSS(bool bool_value) -{ - if(bool_value) - return std::string("true"); - return std::string("false"); -} - -std::string StringHelper::fToSS(float float_num) -{ - return QString::number(float_num).toUtf8().constData(); -} - - -std::string StringHelper::toStdString(QString qString) -{ - return qString.toUtf8().constData(); -} - -QString StringHelper::toQString(std::string stdString) -{ - return QString::fromUtf8(stdString.c_str()); -} - -std::string StringHelper::toLowerCase(std::string stringValue) -{ - std::string lowCaseString(stringValue); - std::transform(lowCaseString.begin(), lowCaseString.end(), lowCaseString.begin(), tolower); - return lowCaseString; -} - -int StringHelper::split(std::string &txt, std::vector<std::string> &strs, char ch) -{ - std::string::size_type pos = txt.find( ch ); - std::string::size_type initialPos = 0; - strs.clear(); - - // Decompose statement - while( pos != std::string::npos ) { - strs.push_back( txt.substr( initialPos, pos - initialPos ) ); - initialPos = pos + 1; - - pos = txt.find( ch, initialPos ); - } - - // Add the last one - strs.push_back(txt.substr(initialPos, std::min(pos, txt.size()) - initialPos + 1)); - - return strs.size(); -} \ No newline at end of file diff --git a/Src/helper/StringHelper.h b/Src/helper/StringHelper.h deleted file mode 100644 index 10f05d6a03410f3debe4eb02aa08f8f160ec71e2..0000000000000000000000000000000000000000 --- a/Src/helper/StringHelper.h +++ /dev/null @@ -1,80 +0,0 @@ -#pragma once - -#include <iostream> -#include <vector> -#include <QString> - -/** - * String handling helper class - */ -class StringHelper -{ -public: - StringHelper(void) {} - ~StringHelper(void) {} - - /** - * This method is used to check whether the full string contains the provided ending. - * @param: fullString, the specifies the string which needs to be checked. - * @param: ending, string specifes the ending string. - * @return: true if ending string is at the end of fullString, otherwise false - */ - static bool hasEnding(std::string const &fullString, std::string const &ending); - - - static bool startsWithDigitQ(QString fullString); - static bool startsWithDigit(std::string const &fullString); - - static bool isNumber(QString fullString); - - /** - * Convert QString to standard string. - * @param: qString, the string to convert, - * @return: a standard string. - */ - static std::string toStdString(QString qString); - - /** - * Convert standard string to QString - * @param: stdString, the string to convert, - * @return: a qt string. - */ - static QString toQString(std::string stdString); - - /** - * Convert integer to standard string. - * @param: int_num, integer number to convert, - * @return: a standard string. - */ - static std::string iToSS(int int_num); - - /** - * Convert a bool to standard string. - * @param: bool_value, bool valueto convert, - * @return: a standard string. - */ - static std::string boolToSS(bool bool_value); - - /** - * Convert float to standard string. - * @param: float_num, float number to convert, - * @return: a standard string. - */ - static std::string fToSS(float float_num); - - /** - * Convert a given string to lower case string. - * @param: stringValue, string to convert, - * @return: a standard string. - */ - static std::string toLowerCase(std::string stringValue); - - /** - * Use from here: http://stackoverflow.com/questions/5888022/split-string-by-single-spaces - * Method to split a string by a given character. - * @param: txt, a reference to the string, which will be split, - * @param: strs, a reference to a vector containing the splitted result, - * @param: ch, the split character. - **/ - static int split(std::string &txt, std::vector<std::string> &strs, char ch); -};