[PD] Add handlers for unified measurement facility

This commit is contained in:
hlorus
2024-01-14 21:32:22 +01:00
committed by WandererFan
parent eb59021118
commit 6318586353
4 changed files with 85 additions and 0 deletions

View File

@@ -31,6 +31,7 @@
#include "DatumLine.h"
#include "DatumPlane.h"
#include "DatumPoint.h"
#include "Measure.h"
#include "FeatureBase.h"
#include "FeatureBoolean.h"
#include "FeatureChamfer.h"
@@ -153,5 +154,7 @@ PyMOD_INIT_FUNC(_PartDesign)
PartDesign::SubtractiveWedge ::init();
PartDesign::FeatureBase ::init();
PartDesign::Measure ::initialize();
PyMOD_Return(mod);
}

View File

@@ -117,6 +117,8 @@ SET(Module_SRCS
AppPartDesignPy.cpp
PreCompiled.cpp
PreCompiled.h
Measure.cpp
Measure.h
)
SOURCE_GROUP("Module" FILES ${Module_SRCS})

View File

@@ -0,0 +1,36 @@
/***************************************************************************
* Copyright (c) 2023 David Friedli <david[at]friedli-be.ch> *
* *
* This file is part of FreeCAD. *
* *
* FreeCAD 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. *
* *
* FreeCAD 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 FreeCAD. If not, see *
* <https://www.gnu.org/licenses/>. *
* *
**************************************************************************/
#include "PreCompiled.h"
#include <App/Application.h>
#include <App/MeasureManager.h>
#include "Base/Console.h"
#include "Measure.h"
void PartDesign::Measure::initialize() {
const App::MeasureHandler& handler = App::MeasureManager::getMeasureHandler("Part");
App::MeasureManager::addMeasureHandler("PartDesign", handler.typeCb);
}

View File

@@ -0,0 +1,44 @@
/***************************************************************************
* Copyright (c) 2023 David Friedli <david[at]friedli-be.ch> *
* *
* This file is part of FreeCAD. *
* *
* FreeCAD 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. *
* *
* FreeCAD 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 FreeCAD. If not, see *
* <https://www.gnu.org/licenses/>. *
* *
**************************************************************************/
#ifndef PARTDESIGN_MEASURE_H
#define PARTDESIGN_MEASURE_H
#include <Mod/PartDesign/PartDesignGlobal.h>
namespace PartDesign
{
class PartDesignExport Measure
{
public:
static void initialize();
};
} //namespace PartDesign
#endif