Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
prepare tag v0.3
  • Loading branch information
setvisible committed Feb 17, 2018
2 parents f729917 + b0c3b22 commit cb3f874
Show file tree
Hide file tree
Showing 65 changed files with 1,760 additions and 772 deletions.
7 changes: 7 additions & 0 deletions CHECKLIST-RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@

### Pre-Building

- Check local branches with `git branch` and remote branches with `git branch -r`
- Merge (without fast-forward) with `git merge --no-ff feature#33-something` (or rebase with `git rebase feature#33-something`)
- Delete merged branches with `git branch -d feature#46-old-branch`
- Change numbers in `version`
- List the changes with `git log --pretty=oneline` and added them to `CHANGELOG`
- Make sure `CHANGELOG` has a proper date set
- Commit (use **Git GUI**)
- Check unstaged modifications with `git status`
- Check tags with `git tag`
- Checkout master branch `git checkout master`
- Merge (without fast-forward) branch develop with `git merge --no-ff develop`
- Tag the commit with a new version number: `git tag -a vXXX -m "FastenerPattern version XXX"` where XXX is the version
- Push with `git push origin vXXX`
- Verify with `git show vXXX`
Expand Down
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# For conditions of distribution and use, see the disclaimer
# and license in LICENSE

cmake_minimum_required(VERSION 3.0)
#cmake_policy(VERSION 3.0)
cmake_minimum_required(VERSION 2.8)
#cmake_policy(VERSION 2.8)

project(FastenerPattern)

Expand Down Expand Up @@ -100,7 +100,6 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/src/core/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/dialogs/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/editor/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/math/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/utils/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/widgets/CMakeLists.txt)


Expand Down Expand Up @@ -215,6 +214,9 @@ endif(MSVC OR MSYS OR MINGW)
##############################################################################
# Deploying executable
##############################################################################
install(TARGETS ${FastenerPattern_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
install(TARGETS ${FastenerPattern_NAME}
RUNTIME
DESTINATION ${CMAKE_INSTALL_PREFIX}
)


1 change: 1 addition & 0 deletions include/Core/Calculator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../src/core/calculator.h"
1 change: 1 addition & 0 deletions include/Core/SpliceCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../src/core/splicecommand.h"
1 change: 1 addition & 0 deletions include/Widgets/FastenerTableWidget
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../src/widgets/fastenertablewidget.h"
1 change: 0 additions & 1 deletion include/Widgets/TableWidget

This file was deleted.

2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ set(MY_SOURCES ${MY_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/src/core/solvers/rigidbodysolver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/solvers/parameters.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/abstractsplicemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/calculator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/designspace.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/fastener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/splice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/splicecalculator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/splicecommand.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/core/tensor.cpp
)

Expand Down
9 changes: 5 additions & 4 deletions src/core/abstractsplicemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@
* because the MainWindow is no more in charge of connecting the
* GUI's signals & slots.
*
* Moreover, this architecture simplifies the calls to the commands
* that derive from QUndoCommand.
*
* \sa AbstractSpliceView.
*/

/* Public Setters */
bool AbstractSpliceModel::setFastenerSelection(const QSet<int> indexes)
void AbstractSpliceModel::setFastenerSelection(const QSet<int> indexes)
{
Q_UNUSED(indexes);
return false;
}

bool AbstractSpliceModel::setDesignSpaceSelection(const QSet<int> indexes)
void AbstractSpliceModel::setDesignSpaceSelection(const QSet<int> indexes)
{
Q_UNUSED(indexes);
return false;
}
39 changes: 18 additions & 21 deletions src/core/abstractsplicemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
class DesignSpace;
class Fastener;
class Tensor;
class ISolver;
enum class SolverParameters;

class AbstractSpliceModel : public QObject
Expand All @@ -49,9 +50,11 @@ class AbstractSpliceModel : public QObject
Q_INVOKABLE virtual QSet<int> selectedDesignSpaceIndexes() const = 0;

Q_INVOKABLE virtual Tensor appliedLoad() const = 0;
Q_INVOKABLE virtual Tensor resultAt(const int index) const = 0;
Q_INVOKABLE virtual SolverParameters solverParameters() const = 0;

Q_INVOKABLE virtual Tensor resultAt(const int index) const = 0;

virtual ISolver* solver() const = 0;

Q_SIGNALS:

Expand All @@ -68,58 +71,52 @@ class AbstractSpliceModel : public QObject
void selectionDesignSpaceChanged();

void appliedLoadChanged();
void solverParamsChanged();

void resultsChanged();


public Q_SLOTS:

/* Public Setters */
Q_INVOKABLE virtual bool insertFastener(const int index, const Fastener &fastener) {
Q_INVOKABLE virtual void insertFastener(const int index, const Fastener &fastener) {
Q_UNUSED(index);
Q_UNUSED(fastener);
return false;
}

Q_INVOKABLE virtual bool setFastener(const int index, const Fastener &fastener) {
Q_INVOKABLE virtual void setFastener(const int index, const Fastener &fastener) {
Q_UNUSED(index);
Q_UNUSED(fastener);
return false;
}

Q_INVOKABLE virtual bool removeFastener(const int index) {
Q_INVOKABLE virtual void removeFastener(const int index) {
Q_UNUSED(index);
return false;
}

Q_INVOKABLE virtual bool insertDesignSpace(const int index, const DesignSpace &designSpace) {
Q_INVOKABLE virtual void insertDesignSpace(const int index, const DesignSpace &designSpace) {
Q_UNUSED(index);
Q_UNUSED(designSpace);
return false;
}

Q_INVOKABLE virtual bool setDesignSpace(const int index, const DesignSpace &designSpace) {
Q_INVOKABLE virtual void setDesignSpace(const int index, const DesignSpace &designSpace) {
Q_UNUSED(index);
Q_UNUSED(designSpace);
return false;
}

Q_INVOKABLE virtual bool removeDesignSpace(const int index) {
Q_INVOKABLE virtual void removeDesignSpace(const int index) {
Q_UNUSED(index);
return false;
}

Q_INVOKABLE virtual bool setAppliedLoad(const Tensor &loadcase) {
Q_UNUSED(loadcase);
return false;
}
Q_INVOKABLE virtual void setFastenerSelection(const QSet<int> indexes);

Q_INVOKABLE virtual bool setFastenerSelection(const QSet<int> indexes);
Q_INVOKABLE virtual void setDesignSpaceSelection(const QSet<int> indexes);

Q_INVOKABLE virtual bool setDesignSpaceSelection(const QSet<int> indexes);
Q_INVOKABLE virtual void setAppliedLoad(const Tensor &loadcase) {
Q_UNUSED(loadcase);
}

Q_INVOKABLE virtual bool setSolverParameters(SolverParameters params) {
Q_INVOKABLE virtual void setSolverParameters(SolverParameters params) {
Q_UNUSED(params);
return false;
}

};
Expand Down
179 changes: 179 additions & 0 deletions src/core/calculator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
/* - FastenerPattern - Copyright (C) 2016-2017 Sebastien Vavassori
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not, see <http://www.gnu.org/licenses/>.
*/

#include "calculator.h"

#include <Core/SpliceCommand>

#include <QtWidgets/QUndoStack>


/*! \class Calculator
* \brief The class Calculator is an adapter class for SpliceCalculator.
*
* It manages the Undo/Redo Mechanism for the SpliceCalculator.
*/

Calculator::Calculator(QObject *parent) : SpliceCalculator(parent)
, m_undoStack(new QUndoStack(this))
{
this->clear();
}

QUndoStack* Calculator::undoStack() const
{
return m_undoStack;
}

/******************************************************************************
******************************************************************************/
void Calculator::clear()
{
SpliceCalculator::clear();
m_undoStack->clear();
}

/******************************************************************************
******************************************************************************/
void Calculator::setTitle(const QString &title)
{
m_undoStack->push(new SpliceCommand::SetTitle(this, title));
}

void Calculator::setAuthor(const QString &author)
{
m_undoStack->push(new SpliceCommand::SetAuthor(this, author));
}

void Calculator::setDate(const QString &date)
{
m_undoStack->push(new SpliceCommand::SetDate(this, date));
}

void Calculator::setDescription(const QString &description)
{
m_undoStack->push(new SpliceCommand::SetDescription(this, description));
}

// -----------------------------------------------------------------------------
void Calculator::insertFastener(const int index, const Fastener &fastener)
{
m_undoStack->push(new SpliceCommand::InsertFastener(this, index, fastener));
}

void Calculator::setFastener(const int index, const Fastener &fastener)
{
m_undoStack->push(new SpliceCommand::SetFastener(this, index, fastener));
}

void Calculator::removeFastener(const int index)
{
m_undoStack->push(new SpliceCommand::RemoveFastener(this, index));
}

// -----------------------------------------------------------------------------
void Calculator::insertDesignSpace(const int index, const DesignSpace &designSpace)
{
m_undoStack->push(new SpliceCommand::InsertDesignSpace(this, index, designSpace));
}

void Calculator::setDesignSpace(const int index, const DesignSpace &designSpace)
{
m_undoStack->push(new SpliceCommand::SetDesignSpace(this, index, designSpace));
}

void Calculator::removeDesignSpace(const int index)
{
m_undoStack->push(new SpliceCommand::RemoveDesignSpace(this, index));
}

// -----------------------------------------------------------------------------
void Calculator::setAppliedLoad(const Tensor &appliedLoad)
{
m_undoStack->push(new SpliceCommand::SetAppliedLoad(this, appliedLoad));
}

void Calculator::setSolverParameters(SolverParameters params)
{
m_undoStack->push(new SpliceCommand::SetSolverParameters(this, params));
}

/******************************************************************************
******************************************************************************/
/* Callback Methods */
void Calculator::_q_setTitle(const QString &title)
{
SpliceCalculator::setTitle(title);
}

void Calculator::_q_setAuthor(const QString &author)
{
SpliceCalculator::setAuthor(author);
}

void Calculator::_q_setDate(const QString &date)
{
SpliceCalculator::setDate(date);
}

void Calculator::_q_setDescription(const QString &description)
{
SpliceCalculator::setDescription(description);
}

// -----------------------------------------------------------------------------
void Calculator::_q_insertFastener(const int index, const Fastener &fastener)
{
SpliceCalculator::insertFastener(index, fastener);
}

void Calculator::_q_setFastener(const int index, const Fastener &fastener)
{
SpliceCalculator::setFastener(index, fastener);
}

void Calculator::_q_removeFastener(const int index)
{
SpliceCalculator::removeFastener(index);
}

// -----------------------------------------------------------------------------
void Calculator::_q_insertDesignSpace(const int index, const DesignSpace &designSpace)
{
SpliceCalculator::insertDesignSpace(index, designSpace);
}

void Calculator::_q_setDesignSpace(const int index, const DesignSpace &designSpace)
{
SpliceCalculator::setDesignSpace(index, designSpace);
}

void Calculator::_q_removeDesignSpace(const int index)
{
SpliceCalculator::removeDesignSpace(index);
}

// -----------------------------------------------------------------------------
void Calculator::_q_setAppliedLoad(const Tensor &appliedLoad)
{
SpliceCalculator::setAppliedLoad(appliedLoad);
}

void Calculator::_q_setSolverParameters(SolverParameters params)
{
SpliceCalculator::setSolverParameters(params);
}

Loading

0 comments on commit cb3f874

Please sign in to comment.