[PD] Add handlers for unified measurement facility
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -117,6 +117,8 @@ SET(Module_SRCS
|
||||
AppPartDesignPy.cpp
|
||||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
Measure.cpp
|
||||
Measure.h
|
||||
)
|
||||
SOURCE_GROUP("Module" FILES ${Module_SRCS})
|
||||
|
||||
|
||||
36
src/Mod/PartDesign/App/Measure.cpp
Normal file
36
src/Mod/PartDesign/App/Measure.cpp
Normal 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);
|
||||
}
|
||||
|
||||
44
src/Mod/PartDesign/App/Measure.h
Normal file
44
src/Mod/PartDesign/App/Measure.h
Normal 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
|
||||
Reference in New Issue
Block a user