build: merge Coati app and Trial to single executable
* removed trial target * updated deploy scripts to exclude trial * cleanup CMakeLists * removed Eigen dependencies * split parser lib into lib_cxx and lib_java * added ProjectFactory and ProjectFactoryModules * removed old installer projects * updated wix installer * updated readme for wix setup * updated to use obfuscated exe * added qt.conf * added indexing dialog images * added jars * added coatidb files of sample projects * added source code of javaparser sample * removed auto-refresh image * intermediate files of windows installer are created in build folder * preselected desktop shortcut * build bat is executed from deploy_windows script
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
add_files(
|
||||
APP_FILES
|
||||
|
||||
data/parser/cxx/TaskParseCxx.cpp
|
||||
data/parser/cxx/TaskParseWrapper.cpp
|
||||
|
||||
data/parser/java/TaskParseJava.cpp
|
||||
|
||||
utility/commandline/CommandLineParser.cpp
|
||||
utility/commandline/CommandLineParser.h
|
||||
|
||||
utility/CompilationDatabase.cpp
|
||||
|
||||
isTrial.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "utility/Version.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "ProjectFactoryModuleC.h"
|
||||
#include "ProjectFactoryModuleCpp.h"
|
||||
#include "ProjectFactoryModuleJava.h"
|
||||
#include "includes.h" // defines 'void setup(int argc, char *argv[])'
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/network/QtNetworkFactory.h"
|
||||
@@ -48,6 +51,10 @@ int main(int argc, char *argv[])
|
||||
Application::destroyInstance();
|
||||
});
|
||||
|
||||
Application::getInstance()->addProjectFactoryModule(std::make_shared<ProjectFactoryModuleC>());
|
||||
Application::getInstance()->addProjectFactoryModule(std::make_shared<ProjectFactoryModuleCpp>());
|
||||
Application::getInstance()->addProjectFactoryModule(std::make_shared<ProjectFactoryModuleJava>());
|
||||
|
||||
std::shared_ptr<LicenseChecker> checker = LicenseChecker::getInstance();
|
||||
|
||||
if (commandLineParser.startedWithLicense())
|
||||
@@ -83,6 +90,10 @@ int main(int argc, char *argv[])
|
||||
Application::destroyInstance();
|
||||
});
|
||||
|
||||
Application::getInstance()->addProjectFactoryModule(std::make_shared<ProjectFactoryModuleC>());
|
||||
Application::getInstance()->addProjectFactoryModule(std::make_shared<ProjectFactoryModuleCpp>());
|
||||
Application::getInstance()->addProjectFactoryModule(std::make_shared<ProjectFactoryModuleJava>());
|
||||
|
||||
commandLineParser.projectLoad();
|
||||
|
||||
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
|
||||
|
||||
@@ -121,6 +121,11 @@ Application::~Application()
|
||||
}
|
||||
}
|
||||
|
||||
void Application::addProjectFactoryModule(std::shared_ptr<ProjectFactoryModule> module)
|
||||
{
|
||||
m_projectFactory.addModule(module);
|
||||
}
|
||||
|
||||
const std::shared_ptr<Project> Application::getCurrentProject()
|
||||
{
|
||||
return m_project;
|
||||
@@ -155,7 +160,7 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
|
||||
|
||||
m_storageCache->clear();
|
||||
|
||||
m_project = Project::create(projectSettingsFilePath, m_storageCache.get(), getDialogView());
|
||||
m_project = m_projectFactory.createProject(projectSettingsFilePath, m_storageCache.get(), getDialogView());
|
||||
|
||||
if (m_project)
|
||||
{
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
#include <memory>
|
||||
|
||||
#include "component/ComponentManager.h"
|
||||
#include "Project.h"
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/MessageActivateWindow.h"
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
#include "utility/messaging/type/MessageSwitchColorScheme.h"
|
||||
#include "Project.h"
|
||||
#include "ProjectFactory.h"
|
||||
|
||||
class DialogView;
|
||||
class IDECommunicationController;
|
||||
@@ -19,6 +20,7 @@ class NetworkFactory;
|
||||
class StorageCache;
|
||||
class Version;
|
||||
class ViewFactory;
|
||||
class ProjectFactoryModule;
|
||||
|
||||
class Application
|
||||
: public MessageListener<MessageActivateWindow>
|
||||
@@ -35,12 +37,13 @@ public:
|
||||
static void loadSettings();
|
||||
static void loadStyle(const FilePath& colorSchemePath);
|
||||
|
||||
void addProjectFactoryModule(std::shared_ptr<ProjectFactoryModule> module);
|
||||
|
||||
~Application();
|
||||
|
||||
const std::shared_ptr<Project> getCurrentProject();
|
||||
|
||||
void createAndLoadProject(const FilePath& projectSettingsFilePath);
|
||||
void loadProject(const FilePath& projectSettingsFilePath);
|
||||
void refreshProject(bool force);
|
||||
bool hasGUI();
|
||||
|
||||
@@ -67,6 +70,7 @@ private:
|
||||
DialogView* getDialogView() const;
|
||||
|
||||
const bool m_hasGUI;
|
||||
ProjectFactory m_projectFactory;
|
||||
std::shared_ptr<Project> m_project;
|
||||
std::shared_ptr<StorageCache> m_storageCache;
|
||||
|
||||
|
||||
+10
-16
@@ -6,8 +6,6 @@ add_files(
|
||||
component/controller/helper/BucketGrid.h
|
||||
component/controller/helper/DummyEdge.h
|
||||
component/controller/helper/DummyNode.h
|
||||
component/controller/helper/GraphLayouter.cpp
|
||||
component/controller/helper/GraphLayouter.h
|
||||
component/controller/helper/GraphPostprocessor.cpp
|
||||
component/controller/helper/GraphPostprocessor.h
|
||||
component/controller/helper/NetworkProtocolHelper.cpp
|
||||
@@ -128,14 +126,8 @@ add_files(
|
||||
data/name/NameHierarchy.cpp
|
||||
data/name/NameHierarchy.h
|
||||
|
||||
data/parser/cxx/TaskParseCxx.h
|
||||
data/parser/cxx/TaskParseWrapper.h
|
||||
|
||||
data/parser/java/JavaEnvironment.cpp
|
||||
data/parser/java/JavaEnvironment.h
|
||||
data/parser/java/JavaEnvironmentFactory.cpp
|
||||
data/parser/java/JavaEnvironmentFactory.h
|
||||
data/parser/java/TaskParseJava.h
|
||||
data/parser/TaskParseWrapper.cpp
|
||||
data/parser/TaskParseWrapper.h
|
||||
|
||||
data/parser/AccessKind.cpp
|
||||
data/parser/AccessKind.h
|
||||
@@ -213,7 +205,10 @@ add_files(
|
||||
settings/Settings.h
|
||||
settings/SettingsMigrator.cpp
|
||||
settings/SettingsMigrator.h
|
||||
|
||||
|
||||
utility/commandline/CommandLineParser.cpp
|
||||
utility/commandline/CommandLineParser.h
|
||||
|
||||
utility/file/FileInfo.cpp
|
||||
utility/file/FileInfo.h
|
||||
utility/file/FileManager.cpp
|
||||
@@ -344,7 +339,6 @@ add_files(
|
||||
utility/AppPath.cpp
|
||||
utility/AppPath.h
|
||||
utility/Cache.h
|
||||
utility/CompilationDatabase.h
|
||||
utility/ConfigManager.cpp
|
||||
utility/ConfigManager.h
|
||||
utility/Property.h
|
||||
@@ -370,13 +364,13 @@ add_files(
|
||||
|
||||
Application.cpp
|
||||
Application.h
|
||||
CxxProject.cpp
|
||||
CxxProject.h
|
||||
isTrial.h
|
||||
JavaProject.cpp
|
||||
JavaProject.h
|
||||
LicenseChecker.cpp
|
||||
LicenseChecker.h
|
||||
Project.cpp
|
||||
Project.h
|
||||
ProjectFactory.cpp
|
||||
ProjectFactory.h
|
||||
ProjectFactoryModule.cpp
|
||||
ProjectFactoryModule.h
|
||||
)
|
||||
|
||||
+1
-34
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "component/view/DialogView.h"
|
||||
#include "data/access/StorageAccessProxy.h"
|
||||
#include "data/parser/cxx/TaskParseWrapper.h"
|
||||
#include "data/parser/TaskParseWrapper.h"
|
||||
#include "data/parser/java/TaskParseJava.h"
|
||||
#include "data/StorageProvider.h"
|
||||
#include "data/PersistentStorage.h"
|
||||
@@ -28,39 +28,6 @@
|
||||
#include "JavaProject.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
std::shared_ptr<Project> Project::create(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView)
|
||||
{
|
||||
std::shared_ptr<Project> project;
|
||||
|
||||
switch (ProjectSettings::getLanguageOfProject(projectSettingsFile))
|
||||
{
|
||||
case LANGUAGE_C:
|
||||
case LANGUAGE_CPP:
|
||||
{
|
||||
project = std::shared_ptr<CxxProject>(new CxxProject(
|
||||
std::make_shared<CxxProjectSettings>(projectSettingsFile), storageAccessProxy, dialogView
|
||||
));
|
||||
}
|
||||
break;
|
||||
case LANGUAGE_JAVA:
|
||||
{
|
||||
project = std::shared_ptr<JavaProject>(new JavaProject(
|
||||
std::make_shared<JavaProjectSettings>(projectSettingsFile), storageAccessProxy, dialogView
|
||||
));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (project)
|
||||
{
|
||||
project->load();
|
||||
}
|
||||
return project;
|
||||
}
|
||||
|
||||
Project::~Project()
|
||||
{
|
||||
}
|
||||
|
||||
+3
-3
@@ -20,9 +20,6 @@ class Task;
|
||||
class Project
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<Project> create(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView);
|
||||
|
||||
virtual ~Project();
|
||||
|
||||
bool refresh(bool forceRefresh);
|
||||
@@ -58,7 +55,10 @@ private:
|
||||
|
||||
Project(const Project&);
|
||||
|
||||
public: // todo: make private again
|
||||
void load();
|
||||
|
||||
private:
|
||||
bool buildIndex(bool forceRefresh);
|
||||
|
||||
virtual bool prepareIndexing();
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "ProjectFactory.h"
|
||||
|
||||
#include "component/view/DialogView.h"
|
||||
#include "data/access/StorageAccessProxy.h"
|
||||
#include "settings/ProjectSettings.h"
|
||||
#include "utility/file/FilePath.h"
|
||||
|
||||
#include "Project.h"
|
||||
#include "ProjectFactoryModule.h"
|
||||
|
||||
void ProjectFactory::addModule(std::shared_ptr<ProjectFactoryModule> module)
|
||||
{
|
||||
m_modules[module->getLanguage()] = module;
|
||||
}
|
||||
|
||||
std::shared_ptr<Project> ProjectFactory::createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView)
|
||||
{
|
||||
std::shared_ptr<Project> project;
|
||||
|
||||
std::map<LanguageType, std::shared_ptr<ProjectFactoryModule>>::const_iterator it = m_modules.find(
|
||||
ProjectSettings::getLanguageOfProject(projectSettingsFile)
|
||||
);
|
||||
|
||||
if (it != m_modules.end())
|
||||
{
|
||||
project = it->second->createProject(projectSettingsFile, storageAccessProxy, dialogView);
|
||||
}
|
||||
|
||||
if (project)
|
||||
{
|
||||
project->load();
|
||||
}
|
||||
return project;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef PROJECT_FACTORY_H
|
||||
#define PROJECT_FACTORY_H
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#include "settings/LanguageType.h"
|
||||
|
||||
class Project;
|
||||
class FilePath;
|
||||
class StorageAccessProxy;
|
||||
class DialogView;
|
||||
class ProjectFactoryModule;
|
||||
|
||||
class ProjectFactory
|
||||
{
|
||||
public:
|
||||
void addModule(std::shared_ptr<ProjectFactoryModule> module);
|
||||
|
||||
std::shared_ptr<Project> createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView);
|
||||
|
||||
private:
|
||||
std::map<LanguageType, std::shared_ptr<ProjectFactoryModule>> m_modules;
|
||||
};
|
||||
|
||||
#endif // PROJECT_FACTORY_H
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "ProjectFactoryModule.h"
|
||||
|
||||
ProjectFactoryModule::~ProjectFactoryModule()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef PROJECT_FACTORY_MODULE_H
|
||||
#define PROJECT_FACTORY_MODULE_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "settings/LanguageType.h"
|
||||
|
||||
class Project;
|
||||
class FilePath;
|
||||
class StorageAccessProxy;
|
||||
class DialogView;
|
||||
|
||||
class ProjectFactoryModule
|
||||
{
|
||||
public:
|
||||
virtual ~ProjectFactoryModule();
|
||||
virtual LanguageType getLanguage() const = 0;
|
||||
|
||||
virtual std::shared_ptr<Project> createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
) = 0;
|
||||
};
|
||||
|
||||
#endif // PROJECT_FACTORY_MODULE_H
|
||||
@@ -1,255 +0,0 @@
|
||||
#include "component/controller/helper/GraphLayouter.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
#include "component/controller/helper/DummyEdge.h"
|
||||
#include "component/controller/helper/DummyNode.h"
|
||||
#include "data/graph/Node.h"
|
||||
|
||||
// for prototyping, remove when done
|
||||
#include "Eigen/Dense"
|
||||
#include "Eigen/Eigenvalues"
|
||||
#include "unsupported/Eigen/MatrixFunctions"
|
||||
|
||||
bool compareEigenvaluePairs(const std::pair<int, double>& p0, const std::pair<int, double>& p1)
|
||||
{
|
||||
return p0.second > p1.second;
|
||||
}
|
||||
|
||||
void GraphLayouter::layoutSimpleRaster(std::vector<DummyNode>& nodes)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int offset = 150;
|
||||
|
||||
int w = ceil(sqrt(nodes.size()));
|
||||
|
||||
for (unsigned int i = 0; i < nodes.size(); i++)
|
||||
{
|
||||
if (i > 0 && i % w == 0)
|
||||
{
|
||||
y += offset;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
nodes[i].position = Vec2i(x, y);
|
||||
|
||||
x += offset;
|
||||
}
|
||||
}
|
||||
|
||||
void GraphLayouter::layoutSimpleRing(std::vector<DummyNode>& nodes)
|
||||
{
|
||||
if (nodes.size() >= 1)
|
||||
{
|
||||
nodes[0].position = Vec2i(0, 0);
|
||||
|
||||
if (nodes.size() > 1)
|
||||
{
|
||||
float offset = 200.0f;
|
||||
|
||||
for (unsigned int i = 1; i < nodes.size(); i++)
|
||||
{
|
||||
float rad = 2.0f * 3.14159265359f / float(nodes.size() - 1) * i - 1;
|
||||
|
||||
int x = offset * std::cos(rad);
|
||||
int y = offset * std::sin(rad);
|
||||
|
||||
nodes[i].position = Vec2i(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GraphLayouter::layoutSpectralPrototype(std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges)
|
||||
{
|
||||
if (nodes.size() < 2)
|
||||
{
|
||||
LOG_INFO("Not enough nodes for layouting");
|
||||
return;
|
||||
}
|
||||
|
||||
MatrixDynamicBase<int> laplacian = buildLaplacianMatrix(nodes, edges);
|
||||
|
||||
// If the laplacian matrix has a zero value in it's diagonal, that means there are unconnected nodes and the spectral
|
||||
// layouting fails for some reason. In this case we switch to raster layout.
|
||||
for (unsigned int i = 0; i < laplacian.getColumnsCount(); i++)
|
||||
{
|
||||
if (laplacian.getValue(i, i) == 0)
|
||||
{
|
||||
layoutSimpleRaster(nodes);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Eigen::MatrixXd degreeMatrix = Eigen::MatrixXd::Zero(laplacian.getColumnsCount(), laplacian.getRowsCount());
|
||||
Eigen::MatrixXd eigenMatrix = Eigen::MatrixXd::Zero(laplacian.getColumnsCount(), laplacian.getRowsCount());
|
||||
|
||||
for(unsigned int x = 0; x < laplacian.getColumnsCount(); x++)
|
||||
{
|
||||
for(unsigned int y = 0; y < laplacian.getRowsCount(); y++)
|
||||
{
|
||||
eigenMatrix(x, y) = laplacian.getValue(x, y);
|
||||
|
||||
if(x == y)
|
||||
{
|
||||
degreeMatrix(x, y) = laplacian.getValue(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
degreeMatrix = degreeMatrix.inverse();
|
||||
Eigen::MatrixPower<Eigen::MatrixXd> dPow(degreeMatrix);
|
||||
degreeMatrix = dPow(0.5);
|
||||
|
||||
eigenMatrix = degreeMatrix * eigenMatrix * degreeMatrix;
|
||||
|
||||
eigenMatrix.normalize();
|
||||
Eigen::EigenSolver<Eigen::MatrixXd> solver(eigenMatrix);
|
||||
|
||||
std::vector<std::vector<double>> eigenVectors;
|
||||
for(unsigned int i = 0; i < solver.eigenvectors().cols(); i++)
|
||||
{
|
||||
eigenVectors.push_back(std::vector<double>());
|
||||
|
||||
for(unsigned int j = 0; j < solver.eigenvectors().rows(); j++)
|
||||
{
|
||||
eigenVectors[i].push_back(solver.eigenvectors()(i*solver.eigenvectors().rows() + j).real());
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::pair<int, double>> eigenValues;
|
||||
for(unsigned int i = 0; i < solver.eigenvalues().size(); i++)
|
||||
{
|
||||
eigenValues.push_back(std::pair<int, double>(i, solver.eigenvalues()(i).real()));
|
||||
}
|
||||
|
||||
std::sort(eigenValues.begin(), eigenValues.end(), compareEigenvaluePairs);
|
||||
|
||||
if(eigenVectors.size() > 0 && eigenVectors[0].size() >= 3)
|
||||
{
|
||||
unsigned int xIdx = eigenValues[eigenValues.size()-2].first;
|
||||
unsigned int yIdx = eigenValues[eigenValues.size()-3].first;
|
||||
|
||||
/*double xEigenValue = std::sqrt(solver.eigenvalues()(xIdx).real());
|
||||
double yEigenValue = std::sqrt(solver.eigenvalues()(yIdx).real());*/
|
||||
|
||||
for(unsigned int i = 0; i < nodes.size(); i++)
|
||||
{
|
||||
float xPos = eigenVectors[xIdx][i];
|
||||
float yPos = eigenVectors[yIdx][i];
|
||||
|
||||
Vec2f newPos(xPos, yPos);
|
||||
|
||||
newPos.normalize();
|
||||
newPos *= 600.0f;
|
||||
|
||||
nodes[i].position.x = newPos.x;
|
||||
nodes[i].position.y = newPos.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MatrixDynamicBase<int> GraphLayouter::buildLaplacianMatrix(
|
||||
const std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges)
|
||||
{
|
||||
MatrixDynamicBase<int> matrix(nodes.size(), nodes.size());
|
||||
|
||||
std::map<Id, DummyNode> nodesMap;
|
||||
std::queue<DummyNode> remainingNodes;
|
||||
for(unsigned int i = 0; i < nodes.size(); i++)
|
||||
{
|
||||
remainingNodes.push(nodes[i]);
|
||||
}
|
||||
|
||||
while(remainingNodes.size() > 0)
|
||||
{
|
||||
if(remainingNodes.front().subNodes.size() > 0)
|
||||
{
|
||||
for(unsigned int i = 0; i < remainingNodes.front().subNodes.size(); i++)
|
||||
{
|
||||
remainingNodes.push(*remainingNodes.front().subNodes[i].get());
|
||||
}
|
||||
}
|
||||
|
||||
nodesMap[remainingNodes.front().tokenId] = remainingNodes.front();
|
||||
remainingNodes.pop();
|
||||
}
|
||||
|
||||
std::map<std::pair<Id, Id>, int> weightsMap;
|
||||
for(unsigned int i = 0; i < edges.size(); i++)
|
||||
{
|
||||
const DummyEdge& edge = edges[i];
|
||||
DummyNode ownerNode = nodesMap[edge.ownerId];
|
||||
DummyNode targetNode = nodesMap[edge.targetId];
|
||||
|
||||
if(ownerNode.topLevelAncestorId != targetNode.topLevelAncestorId)
|
||||
{
|
||||
int weightIncrement = edge.getWeight();
|
||||
|
||||
Id ownerId = ownerNode.topLevelAncestorId;
|
||||
Id targetId = targetNode.topLevelAncestorId;
|
||||
std::pair<Id, Id> key(ownerId, targetId);
|
||||
std::pair<Id, Id> inverseKey(targetId, ownerId);
|
||||
std::pair<Id, Id> keyOwner(ownerId, ownerId);
|
||||
std::pair<Id, Id> keyTarget(targetId, targetId);
|
||||
|
||||
std::map<std::pair<Id, Id>, int>::iterator it = weightsMap.find(key);
|
||||
if(it == weightsMap.end())
|
||||
{
|
||||
weightsMap[key] = 0;
|
||||
}
|
||||
|
||||
weightsMap[key] += weightIncrement;
|
||||
|
||||
it = weightsMap.find(inverseKey);
|
||||
if(it == weightsMap.end())
|
||||
{
|
||||
weightsMap[inverseKey] = 0;
|
||||
}
|
||||
|
||||
weightsMap[inverseKey] += weightIncrement;
|
||||
|
||||
it = weightsMap.find(keyOwner);
|
||||
if(it == weightsMap.end())
|
||||
{
|
||||
weightsMap[keyOwner] = 0;
|
||||
}
|
||||
|
||||
weightsMap[keyOwner] += weightIncrement;
|
||||
|
||||
it = weightsMap.find(keyTarget);
|
||||
if(it == weightsMap.end())
|
||||
{
|
||||
weightsMap[keyTarget] = 0;
|
||||
}
|
||||
|
||||
weightsMap[keyTarget] += weightIncrement;
|
||||
}
|
||||
}
|
||||
|
||||
for(unsigned int x = 0; x < nodes.size(); x++)
|
||||
{
|
||||
for(unsigned int y = x; y < nodes.size(); y++)
|
||||
{
|
||||
unsigned int xNodeId = nodes[x].tokenId;
|
||||
unsigned int yNodeId = nodes[y].tokenId;
|
||||
|
||||
std::pair<Id, Id> key(xNodeId, yNodeId);
|
||||
|
||||
if(x == y)
|
||||
{
|
||||
matrix.setValue(x, y, weightsMap[key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
matrix.setValue(x, y, -weightsMap[key]);
|
||||
matrix.setValue(y, x, -weightsMap[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return matrix;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef GRAPH_LAYOUTER_H
|
||||
#define GRAPH_LAYOUTER_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "utility/math/MatrixDynamicBase.h"
|
||||
#include "utility/math/Vector2.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
struct DummyEdge;
|
||||
struct DummyNode;
|
||||
|
||||
class GraphLayouter
|
||||
{
|
||||
public:
|
||||
static void layoutSimpleRaster(std::vector<DummyNode>& nodes);
|
||||
static void layoutSimpleRing(std::vector<DummyNode>& nodes);
|
||||
|
||||
static void layoutSpectralPrototype(std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges);
|
||||
|
||||
private:
|
||||
static MatrixDynamicBase<int> buildLaplacianMatrix(
|
||||
const std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges);
|
||||
};
|
||||
|
||||
#endif // GRAPH_LAYOUTER_H
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "data/graph/token_component/TokenComponentAccess.h"
|
||||
|
||||
#include "data/DefinitionType.h"
|
||||
#include "data/SqliteStorage.h"
|
||||
|
||||
class ParserClientImpl: public ParserClient
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "data/parser/cxx/TaskParseWrapper.h"
|
||||
#include "data/parser/TaskParseWrapper.h"
|
||||
|
||||
#include "component/view/DialogView.h"
|
||||
#include "data/PersistentStorage.h"
|
||||
@@ -32,6 +32,22 @@ add_files(
|
||||
data/parser/cxx/utilityCxx.cpp
|
||||
data/parser/cxx/utilityCxx.h
|
||||
|
||||
data/parser/java/JavaParser.cpp
|
||||
data/parser/java/JavaParser.h
|
||||
utility/CompilationDatabase.cpp
|
||||
utility/CompilationDatabase.h
|
||||
|
||||
)
|
||||
|
||||
add_files(
|
||||
LIB_CXX_FILES
|
||||
|
||||
data/parser/cxx/TaskParseCxx.cpp
|
||||
data/parser/cxx/TaskParseCxx.h
|
||||
|
||||
CxxProject.cpp
|
||||
CxxProject.h
|
||||
|
||||
ProjectFactoryModuleCpp.cpp
|
||||
ProjectFactoryModuleCpp.h
|
||||
ProjectFactoryModuleC.cpp
|
||||
ProjectFactoryModuleC.h
|
||||
)
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
CxxProject::CxxProject(
|
||||
std::shared_ptr<CxxProjectSettings> projectSettings, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
: Project(storageAccessProxy, dialogView)
|
||||
, m_projectSettings(projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
CxxProject::~CxxProject()
|
||||
{
|
||||
}
|
||||
@@ -24,14 +32,6 @@ const std::shared_ptr<ProjectSettings> CxxProject::getProjectSettings() const
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
CxxProject::CxxProject(
|
||||
std::shared_ptr<CxxProjectSettings> projectSettings, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
: Project(storageAccessProxy, dialogView)
|
||||
, m_projectSettings(projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
bool CxxProject::prepareRefresh()
|
||||
{
|
||||
FilePath cdbPath = m_projectSettings->getCompilationDatabasePath();
|
||||
@@ -9,6 +9,11 @@
|
||||
class CxxProject: public Project
|
||||
{
|
||||
public:
|
||||
CxxProject(
|
||||
std::shared_ptr<CxxProjectSettings> projectSettings,
|
||||
StorageAccessProxy* storageAccessProxy,
|
||||
DialogView* dialogView
|
||||
);
|
||||
virtual ~CxxProject();
|
||||
|
||||
protected:
|
||||
@@ -16,11 +21,6 @@ protected:
|
||||
virtual const std::shared_ptr<ProjectSettings> getProjectSettings() const;
|
||||
|
||||
private:
|
||||
CxxProject(
|
||||
std::shared_ptr<CxxProjectSettings> projectSettings,
|
||||
StorageAccessProxy* storageAccessProxy,
|
||||
DialogView* dialogView
|
||||
);
|
||||
CxxProject(const CxxProject&);
|
||||
|
||||
virtual bool prepareRefresh();
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "ProjectFactoryModuleC.h"
|
||||
|
||||
#include "settings/LanguageType.h"
|
||||
#include "CxxProject.h"
|
||||
|
||||
ProjectFactoryModuleC::~ProjectFactoryModuleC()
|
||||
{
|
||||
}
|
||||
|
||||
LanguageType ProjectFactoryModuleC::getLanguage() const
|
||||
{
|
||||
return LANGUAGE_C;
|
||||
}
|
||||
|
||||
std::shared_ptr<Project> ProjectFactoryModuleC::createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
{
|
||||
return std::shared_ptr<CxxProject>(new CxxProject(
|
||||
std::make_shared<CxxProjectSettings>(projectSettingsFile), storageAccessProxy, dialogView));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef PROJECT_FACTORY_MODULE_C_H
|
||||
#define PROJECT_FACTORY_MODULE_C_H
|
||||
|
||||
#include "ProjectFactoryModule.h"
|
||||
|
||||
class ProjectFactoryModuleC: public ProjectFactoryModule
|
||||
{
|
||||
public:
|
||||
virtual ~ProjectFactoryModuleC();
|
||||
virtual LanguageType getLanguage() const;
|
||||
|
||||
virtual std::shared_ptr<Project> createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
);
|
||||
};
|
||||
|
||||
#endif // PROJECT_FACTORY_MODULE_C_H
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "ProjectFactoryModuleCpp.h"
|
||||
|
||||
#include "settings/LanguageType.h"
|
||||
#include "CxxProject.h"
|
||||
|
||||
ProjectFactoryModuleCpp::~ProjectFactoryModuleCpp()
|
||||
{
|
||||
}
|
||||
|
||||
LanguageType ProjectFactoryModuleCpp::getLanguage() const
|
||||
{
|
||||
return LANGUAGE_CPP;
|
||||
}
|
||||
|
||||
std::shared_ptr<Project> ProjectFactoryModuleCpp::createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
{
|
||||
return std::shared_ptr<CxxProject>(new CxxProject(
|
||||
std::make_shared<CxxProjectSettings>(projectSettingsFile), storageAccessProxy, dialogView));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef PROJECT_FACTORY_MODULE_CPP_H
|
||||
#define PROJECT_FACTORY_MODULE_CPP_H
|
||||
|
||||
#include "ProjectFactoryModule.h"
|
||||
|
||||
class ProjectFactoryModuleCpp: public ProjectFactoryModule
|
||||
{
|
||||
public:
|
||||
virtual ~ProjectFactoryModuleCpp();
|
||||
virtual LanguageType getLanguage() const;
|
||||
|
||||
virtual std::shared_ptr<Project> createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
);
|
||||
};
|
||||
|
||||
#endif // PROJECT_FACTORY_MODULE_CPP_H
|
||||
@@ -30,7 +30,8 @@ void setupApp(int argc, char *argv[])
|
||||
{
|
||||
userdir.append("/.config/coati/");
|
||||
}
|
||||
UserPaths::setUserDataPath(userdir);
|
||||
|
||||
UserPaths::setUserDataPath(userdir);
|
||||
|
||||
QString userDataPath(userdir.c_str());
|
||||
QDir dataDir(userdir.c_str());
|
||||
@@ -39,7 +40,9 @@ void setupApp(int argc, char *argv[])
|
||||
dataDir.mkpath(userDataPath);
|
||||
}
|
||||
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdString(UserPaths::getUserDataPath()), userDataPath);
|
||||
std::cout << "apppath: " << AppPath::getAppPath() << std::endl;
|
||||
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdString(AppPath::getAppPath() + "/usr/" ), userDataPath);
|
||||
}
|
||||
|
||||
#endif // INCLUDES_DEFAULT_H
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
add_files(
|
||||
LIB_JAVA_FILES
|
||||
|
||||
data/parser/java/JavaParser.cpp
|
||||
data/parser/java/JavaParser.h
|
||||
data/parser/java/JavaEnvironment.cpp
|
||||
data/parser/java/JavaEnvironment.h
|
||||
data/parser/java/JavaEnvironmentFactory.cpp
|
||||
data/parser/java/JavaEnvironmentFactory.h
|
||||
data/parser/java/TaskParseJava.cpp
|
||||
data/parser/java/TaskParseJava.h
|
||||
|
||||
JavaProject.cpp
|
||||
JavaProject.h
|
||||
ProjectFactoryModuleJava.cpp
|
||||
ProjectFactoryModuleJava.h
|
||||
)
|
||||
@@ -7,6 +7,14 @@
|
||||
#include "Application.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
JavaProject::JavaProject(
|
||||
std::shared_ptr<JavaProjectSettings> projectSettings, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
: Project(storageAccessProxy, dialogView)
|
||||
, m_projectSettings(projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
JavaProject::~JavaProject()
|
||||
{
|
||||
}
|
||||
@@ -21,14 +29,6 @@ const std::shared_ptr<ProjectSettings> JavaProject::getProjectSettings() const
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
JavaProject::JavaProject(
|
||||
std::shared_ptr<JavaProjectSettings> projectSettings, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
: Project(storageAccessProxy, dialogView)
|
||||
, m_projectSettings(projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
bool JavaProject::prepareIndexing()
|
||||
{
|
||||
std::string errorString;
|
||||
@@ -9,6 +9,11 @@
|
||||
class JavaProject: public Project
|
||||
{
|
||||
public:
|
||||
JavaProject(
|
||||
std::shared_ptr<JavaProjectSettings> projectSettings,
|
||||
StorageAccessProxy* storageAccessProxy,
|
||||
DialogView* dialogView
|
||||
);
|
||||
virtual ~JavaProject();
|
||||
|
||||
protected:
|
||||
@@ -16,11 +21,6 @@ protected:
|
||||
virtual const std::shared_ptr<ProjectSettings> getProjectSettings() const;
|
||||
|
||||
private:
|
||||
JavaProject(
|
||||
std::shared_ptr<JavaProjectSettings> projectSettings,
|
||||
StorageAccessProxy* storageAccessProxy,
|
||||
DialogView* dialogView
|
||||
);
|
||||
JavaProject(const JavaProject&);
|
||||
|
||||
virtual bool prepareIndexing();
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "ProjectFactoryModuleJava.h"
|
||||
|
||||
#include "settings/LanguageType.h"
|
||||
#include "JavaProject.h"
|
||||
|
||||
ProjectFactoryModuleJava::~ProjectFactoryModuleJava()
|
||||
{
|
||||
}
|
||||
|
||||
LanguageType ProjectFactoryModuleJava::getLanguage() const
|
||||
{
|
||||
return LANGUAGE_JAVA;
|
||||
}
|
||||
|
||||
std::shared_ptr<Project> ProjectFactoryModuleJava::createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
)
|
||||
{
|
||||
return std::shared_ptr<JavaProject>(new JavaProject(
|
||||
std::make_shared<JavaProjectSettings>(projectSettingsFile), storageAccessProxy, dialogView));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef PROJECT_FACTORY_MODULE_JAVA_H
|
||||
#define PROJECT_FACTORY_MODULE_JAVA_H
|
||||
|
||||
#include "ProjectFactoryModule.h"
|
||||
|
||||
class ProjectFactoryModuleJava: public ProjectFactoryModule
|
||||
{
|
||||
public:
|
||||
virtual ~ProjectFactoryModuleJava();
|
||||
virtual LanguageType getLanguage() const;
|
||||
|
||||
virtual std::shared_ptr<Project> createProject(
|
||||
const FilePath& projectSettingsFile, StorageAccessProxy* storageAccessProxy, DialogView* dialogView
|
||||
);
|
||||
};
|
||||
|
||||
#endif // PROJECT_FACTORY_MODULE_JAVA_H
|
||||
@@ -1,13 +0,0 @@
|
||||
add_files(
|
||||
TRIAL_FILES
|
||||
|
||||
data/parser/cxx/TaskParseCxx.cpp
|
||||
data/parser/cxx/TaskParseWrapper.cpp
|
||||
|
||||
data/parser/java/TaskParseJava.cpp
|
||||
|
||||
utility/CompilationDatabase.cpp
|
||||
|
||||
isTrial.cpp
|
||||
main.cpp
|
||||
)
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "data/parser/cxx/TaskParseCxx.h"
|
||||
|
||||
TaskParseCxx::TaskParseCxx(
|
||||
std::shared_ptr<StorageProvider> storageProvider,
|
||||
std::shared_ptr<FileRegister> fileRegister,
|
||||
const Parser::Arguments& arguments,
|
||||
DialogView* dialogView
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<FilePath> TaskParseCxx::getSourceFilesFromCDB(const FilePath& compilationDatabasePath)
|
||||
{
|
||||
return std::vector<FilePath>();
|
||||
}
|
||||
|
||||
void TaskParseCxx::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
Task::TaskState TaskParseCxx::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
return STATE_SUCCESS;
|
||||
}
|
||||
|
||||
void TaskParseCxx::doExit(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseCxx::doReset(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseCxx::handleMessage(MessageInterruptTasks* message)
|
||||
{
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#include "data/parser/cxx/TaskParseWrapper.h"
|
||||
|
||||
#include "data/PersistentStorage.h"
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
|
||||
TaskParseWrapper::TaskParseWrapper(
|
||||
PersistentStorage* storage,
|
||||
std::shared_ptr<FileRegister> fileRegister,
|
||||
DialogView* dialogView
|
||||
)
|
||||
: m_storage(storage)
|
||||
{
|
||||
}
|
||||
|
||||
TaskParseWrapper::~TaskParseWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseWrapper::setTask(std::shared_ptr<Task> task)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
Task::TaskState TaskParseWrapper::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
return STATE_SUCCESS;
|
||||
}
|
||||
|
||||
void TaskParseWrapper::doExit(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseWrapper::doReset(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "data/parser/java/TaskParseJava.h"
|
||||
|
||||
TaskParseJava::TaskParseJava(
|
||||
std::shared_ptr<StorageProvider> storageProvider,
|
||||
std::shared_ptr<FileRegister> fileRegister,
|
||||
const Parser::Arguments& arguments,
|
||||
DialogView* dialogView
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseJava::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
Task::TaskState TaskParseJava::doUpdate(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
return STATE_SUCCESS;
|
||||
}
|
||||
|
||||
void TaskParseJava::doExit(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseJava::doReset(std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskParseJava::handleMessage(MessageInterruptTasks* message)
|
||||
{
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "isTrial.h"
|
||||
|
||||
bool isTrial()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#include "utility/AppPath.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "utility/ScopedFunctor.h"
|
||||
#include "utility/UserPaths.h"
|
||||
#include "utility/Version.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "includes.h" // defines 'void setup(int argc, char *argv[])'
|
||||
#include "qt/network/QtNetworkFactory.h"
|
||||
#include "qt/QtApplication.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/QtViewFactory.h"
|
||||
#include "qt/window/QtMainWindow.h"
|
||||
#include "version.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication::setApplicationName("Coati Trial");
|
||||
|
||||
if (QSysInfo::windowsVersion() != QSysInfo::WV_None)
|
||||
{
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
}
|
||||
|
||||
Version version = Version::fromString(GIT_VERSION_NUMBER);
|
||||
QApplication::setApplicationVersion(version.toDisplayString().c_str());
|
||||
|
||||
setupPlatform(argc, argv);
|
||||
|
||||
QtApplication qtApp(argc, argv);
|
||||
|
||||
setupApp(argc, argv);
|
||||
|
||||
qtApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
QtViewFactory viewFactory;
|
||||
QtNetworkFactory networkFactory;
|
||||
|
||||
Application::createInstance(version, &viewFactory, &networkFactory);
|
||||
ScopedFunctor f([](){
|
||||
Application::destroyInstance();
|
||||
});
|
||||
|
||||
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
|
||||
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".ttf");
|
||||
|
||||
return qtApp.exec();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#include "utility/CompilationDatabase.h"
|
||||
|
||||
#include <set>
|
||||
#include "utility/utility.h"
|
||||
|
||||
|
||||
utility::CompilationDatabase::CompilationDatabase(std::string filename)
|
||||
: m_filename(filename)
|
||||
{
|
||||
getHeaders();
|
||||
}
|
||||
|
||||
std::vector<FilePath> utility::CompilationDatabase::getAllHeaderPaths()
|
||||
{
|
||||
std::vector<FilePath> paths = utility::concat(m_headers, m_systemHeaders);
|
||||
paths = utility::concat(paths, m_frameworkHeaders);
|
||||
paths = utility::unique(paths);
|
||||
return paths;
|
||||
}
|
||||
|
||||
std::vector<FilePath> utility::CompilationDatabase::getHeaderPaths()
|
||||
{
|
||||
return m_headers;
|
||||
}
|
||||
|
||||
std::vector<FilePath> utility::CompilationDatabase::getSystemHeaderPaths()
|
||||
{
|
||||
return m_systemHeaders;
|
||||
}
|
||||
|
||||
std::vector<FilePath> utility::CompilationDatabase::getFrameworkHeaderPaths()
|
||||
{
|
||||
return m_frameworkHeaders;
|
||||
}
|
||||
|
||||
void utility::CompilationDatabase::getHeaders()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user