App: Apply clang format (part 1)
This commit is contained in:
@@ -36,24 +36,27 @@
|
||||
|
||||
#include <FCGlobal.h>
|
||||
|
||||
namespace App {
|
||||
namespace App
|
||||
{
|
||||
|
||||
// Add your class methods and member variables here
|
||||
enum class MeasureElementType {
|
||||
enum class MeasureElementType
|
||||
{
|
||||
INVALID,
|
||||
POINT,
|
||||
LINE,
|
||||
LINESEGMENT,
|
||||
CIRCLE,
|
||||
ARC,
|
||||
CURVE, // Has a length but no radius or axis
|
||||
CURVE, // Has a length but no radius or axis
|
||||
PLANE,
|
||||
CYLINDER,
|
||||
Volume,
|
||||
};
|
||||
|
||||
|
||||
struct MeasureSelectionItem {
|
||||
struct MeasureSelectionItem
|
||||
{
|
||||
App::SubObjectT object;
|
||||
Base::Vector3d pickedPoint;
|
||||
};
|
||||
@@ -62,9 +65,10 @@ struct MeasureSelectionItem {
|
||||
using MeasureSelection = std::vector<MeasureSelectionItem>;
|
||||
using MeasureValidateMethod = std::function<bool(const MeasureSelection&)>;
|
||||
using MeasurePrioritizeMethod = std::function<bool(const MeasureSelection&)>;
|
||||
using MeasureTypeMethod = std::function<MeasureElementType (App::DocumentObject*, const char*)>;
|
||||
using MeasureTypeMethod = std::function<MeasureElementType(App::DocumentObject*, const char*)>;
|
||||
|
||||
struct MeasureType {
|
||||
struct MeasureType
|
||||
{
|
||||
std::string identifier;
|
||||
std::string label;
|
||||
std::string measureObject;
|
||||
@@ -72,21 +76,24 @@ struct MeasureType {
|
||||
// Checks if the measurement works with a given selection
|
||||
MeasureValidateMethod validatorCb;
|
||||
|
||||
// Allows to prioritize this over other measurement types when the measurement type is picked implicitly from the selection.
|
||||
// Gets called only when validatorCb returned true for the given selection
|
||||
// Allows to prioritize this over other measurement types when the measurement type is picked
|
||||
// implicitly from the selection. Gets called only when validatorCb returned true for the given
|
||||
// selection
|
||||
MeasurePrioritizeMethod prioritizeCb;
|
||||
|
||||
bool isPython;
|
||||
PyObject* pythonClass;
|
||||
};
|
||||
|
||||
struct MeasureHandler {
|
||||
struct MeasureHandler
|
||||
{
|
||||
std::string module;
|
||||
MeasureTypeMethod typeCb;
|
||||
};
|
||||
|
||||
|
||||
class AppExport MeasureManager {
|
||||
class AppExport MeasureManager
|
||||
{
|
||||
public:
|
||||
MeasureManager();
|
||||
|
||||
@@ -96,11 +103,20 @@ public:
|
||||
static MeasureHandler getMeasureHandler(const App::MeasureSelectionItem& selectionItem);
|
||||
static MeasureElementType getMeasureElementType(const App::MeasureSelectionItem& selectionItem);
|
||||
static void addMeasureType(MeasureType* measureType);
|
||||
static void addMeasureType(std::string id, std::string label, std::string measureObj, MeasureValidateMethod validatorCb, MeasurePrioritizeMethod prioritizeCb);
|
||||
static void addMeasureType(const char* id, const char* label, const char* measureObj, MeasureValidateMethod validatorCb, MeasurePrioritizeMethod prioritizeCb);
|
||||
static void addMeasureType(std::string id,
|
||||
std::string label,
|
||||
std::string measureObj,
|
||||
MeasureValidateMethod validatorCb,
|
||||
MeasurePrioritizeMethod prioritizeCb);
|
||||
static void addMeasureType(const char* id,
|
||||
const char* label,
|
||||
const char* measureObj,
|
||||
MeasureValidateMethod validatorCb,
|
||||
MeasurePrioritizeMethod prioritizeCb);
|
||||
static const std::vector<MeasureType*> getMeasureTypes();
|
||||
static Py::Tuple getSelectionPy(const App::MeasureSelection& selection);
|
||||
static std::vector<MeasureType*> getValidMeasureTypes(App::MeasureSelection selection, std::string mode);
|
||||
static std::vector<MeasureType*> getValidMeasureTypes(App::MeasureSelection selection,
|
||||
std::string mode);
|
||||
|
||||
|
||||
private:
|
||||
@@ -109,6 +125,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
} // namespace App
|
||||
} // namespace App
|
||||
|
||||
#endif // MEASUREMANAGER_H
|
||||
#endif // MEASUREMANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user