Sketcher: modernize C++: replace 'typedef' with 'using'

This commit is contained in:
wmayer
2022-08-29 23:13:16 +02:00
parent 80d7af9f05
commit 138629633f
14 changed files with 26 additions and 26 deletions

View File

@@ -41,8 +41,8 @@ struct ConstraintIds {
struct Constraint_Equal
{
typedef ConstraintIds argument_type;
typedef bool result_type;
using argument_type = ConstraintIds;
using result_type = bool;
struct Sketcher::ConstraintIds c;
explicit Constraint_Equal(const ConstraintIds& c) : c(c)
{

View File

@@ -138,7 +138,7 @@ public:
bool getPyPathValue(const App::ObjectIdentifier &path, Py::Object &res) const override;
typedef std::pair<int, const Constraint*> ConstraintInfo ;
using ConstraintInfo = std::pair<int, const Constraint*> ;
boost::signals2::signal<void (const std::map<App::ObjectIdentifier, App::ObjectIdentifier> &)> signalConstraintsRenamed;
boost::signals2::signal<void (const std::set<App::ObjectIdentifier> &)> signalConstraintsRemoved;

View File

@@ -725,7 +725,7 @@ const GeometryT * SketchObject::getGeometry(int GeoId) const
return nullptr;
}
typedef App::FeaturePythonT<SketchObject> SketchObjectPython;
using SketchObjectPython = App::FeaturePythonT<SketchObject>;
} //namespace Sketcher

View File

@@ -101,12 +101,12 @@
#include <boost_graph_adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
typedef Eigen::FullPivHouseholderQR<Eigen::MatrixXd>::IntDiagSizeVectorType MatrixIndexType;
using MatrixIndexType = Eigen::FullPivHouseholderQR<Eigen::MatrixXd>::IntDiagSizeVectorType;
#ifndef EIGEN_STOCK_FULLPIVLU_COMPUTE
namespace Eigen {
typedef Matrix<double,-1,-1,0,-1,-1> MatrixdType;
using MatrixdType = Matrix<double,-1,-1,0,-1,-1>;
template<>
FullPivLU<MatrixdType>& FullPivLU<MatrixdType>::compute(const MatrixdType& matrix)
@@ -429,7 +429,7 @@ void SolverReportingManager::LogMatrix(const std::string str, MatrixIndexType ma
#endif
typedef boost::adjacency_list <boost::vecS, boost::vecS, boost::undirectedS> Graph;
using Graph = boost::adjacency_list <boost::vecS, boost::vecS, boost::undirectedS>;
///////////////////////////////////////
// Solver

View File

@@ -37,7 +37,7 @@ namespace GCS
double *y;
};
typedef std::vector<Point> VEC_P;
using VEC_P = std::vector<Point>;
///Class DeriVector2 holds a vector value and its derivative on the
///parameter that the derivatives are being calculated for now. x,y is the

View File

@@ -29,14 +29,14 @@
namespace GCS
{
typedef std::vector<double *> VEC_pD;
typedef std::vector<double> VEC_D;
typedef std::vector<int> VEC_I;
typedef std::map<double *, double *> MAP_pD_pD;
typedef std::map<double *, double> MAP_pD_D;
typedef std::map<double *, int> MAP_pD_I;
typedef std::set<double *> SET_pD;
typedef std::set<int> SET_I;
using VEC_pD = std::vector<double *>;
using VEC_D = std::vector<double>;
using VEC_I = std::vector<int>;
using MAP_pD_pD = std::map<double *, double *>;
using MAP_pD_D = std::map<double *, double>;
using MAP_pD_I = std::map<double *, int>;
using SET_pD = std::set<double *>;
using SET_I = std::set<int>;
#ifndef M_PI
#define M_PI 3.14159265358979323846

View File

@@ -872,7 +872,7 @@ void CmdSketcherSymmetry::activated(int iMsg)
int LastGeoId = 0;
Sketcher::PointPos LastPointPos = Sketcher::PointPos::none;
const Part::Geometry *LastGeo;
typedef enum { invalid = -1, line = 0, point = 1 } GeoType;
using GeoType = enum { invalid = -1, line = 0, point = 1 };
GeoType lastgeotype = invalid;

View File

@@ -42,7 +42,7 @@
namespace SketcherGui {
class SketcherGuiExport SoDatumLabel : public SoShape {
typedef SoShape inherited;
using inherited = SoShape;
SO_NODE_HEADER(SoDatumLabel);

View File

@@ -31,7 +31,7 @@
namespace SketcherGui {
class SketcherGuiExport SoZoomTranslation : public SoTranslation {
typedef SoTranslation inherited;
using inherited = SoTranslation;
SO_NODE_HEADER(SoZoomTranslation);
@@ -41,7 +41,7 @@ public:
SoSFVec3f abPos;
protected:
~SoZoomTranslation() override {};
~SoZoomTranslation() override {}
void doAction(SoAction * action) override;
void getPrimitiveCount(SoGetPrimitiveCountAction * action) override;
void getMatrix(SoGetMatrixAction * action) override;

View File

@@ -34,7 +34,7 @@
#include "TaskSketcherSolverAdvanced.h"
#include <boost_signals2.hpp>
typedef boost::signals2::connection Connection;
using Connection = boost::signals2::connection;
namespace SketcherGui {

View File

@@ -127,7 +127,7 @@ public Q_SLOTS:
protected:
void changeEvent(QEvent *e) override;
ViewProviderSketch *sketchView;
typedef boost::signals2::connection Connection;
using Connection = boost::signals2::connection;
Connection connectionConstraintsChanged;
private:

View File

@@ -132,7 +132,7 @@ protected:
void changeEvent(QEvent *e) override;
void leaveEvent ( QEvent * event ) override;
ViewProviderSketch *sketchView;
typedef boost::signals2::connection Connection;
using Connection = boost::signals2::connection;
Connection connectionElementsChanged;
private:

View File

@@ -29,7 +29,7 @@
#include <boost_signals2.hpp>
class Ui_TaskSketcherMessages;
typedef boost::signals2::connection Connection;
using Connection = boost::signals2::connection;
namespace App {
class Property;

View File

@@ -45,8 +45,8 @@ protected:
std::map<const App::Property*, Gui::ViewProvider*> propView;
};
typedef Gui::ViewProviderPythonFeatureT<ViewProviderSketch> ViewProviderPython;
typedef Gui::ViewProviderPythonFeatureT<ViewProviderCustom> ViewProviderCustomPython;
using ViewProviderPython = Gui::ViewProviderPythonFeatureT<ViewProviderSketch>;
using ViewProviderCustomPython = Gui::ViewProviderPythonFeatureT<ViewProviderCustom>;
} // namespace SketcherGui