Sketcher: python converter : add possibility to add lastGeoId to the constraint process.

This commit is contained in:
Paddle
2024-01-11 18:31:25 +01:00
parent 88883faaf8
commit f0c491ef79
2 changed files with 203 additions and 129 deletions

View File

@@ -24,6 +24,9 @@
#ifndef SKETCHER_PythonConverter_H
#define SKETCHER_PythonConverter_H
#include <string>
#include <vector>
#include <Mod/Sketcher/SketcherGlobal.h>
namespace Part
@@ -57,7 +60,7 @@ public:
OmitInternalGeometry
};
explicit PythonConverter() = delete;
PythonConverter() = delete;
~PythonConverter() = delete;
/// Convert a geometry into the string representing the command creating it
@@ -68,17 +71,20 @@ public:
const std::vector<Part::Geometry*>& geos,
Mode mode = Mode::CreateInternalGeometry);
static std::string convert(const Sketcher::Constraint* constraint);
static std::string convert(const Sketcher::Constraint* constraint,
bool useLastGeoIdVar = false);
static std::string convert(const std::string& doc,
const std::vector<Sketcher::Constraint*>& constraints);
const std::vector<Sketcher::Constraint*>& constraints,
bool useLastGeoIdVar = false);
static std::vector<std::string> multiLine(std::string&& singlestring);
private:
static SingleGeometry process(const Part::Geometry* geo);
static std::string process(const Sketcher::Constraint* constraint);
static std::string process(const Sketcher::Constraint* constraint,
bool useLastGeoIdVar = false);
};
} // namespace Sketcher