Surface: Provide geometry to Measure module (#26479)
* [Surf]provide geometry to Measure * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
#include "FeatureSections.h"
|
||||
#include "FeatureSewing.h"
|
||||
|
||||
#include "Measure.h"
|
||||
|
||||
|
||||
namespace Surface
|
||||
{
|
||||
@@ -87,5 +89,8 @@ PyMOD_INIT_FUNC(Surface)
|
||||
Surface::Sections ::init();
|
||||
// clang-format on
|
||||
|
||||
// connect to unified measurement facility
|
||||
Surface::Measure ::initialize();
|
||||
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ SET(Surface_SRCS
|
||||
FeatureSewing.h
|
||||
FeatureCut.cpp
|
||||
FeatureCut.h
|
||||
Measure.cpp
|
||||
Measure.h
|
||||
)
|
||||
|
||||
add_library(Surface SHARED ${Surface_SRCS})
|
||||
|
||||
37
src/Mod/Surface/App/Measure.cpp
Normal file
37
src/Mod/Surface/App/Measure.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2025 Wandererfan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* 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/>. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
//! a class for establishing our connection with the unified measurement facility
|
||||
//! we are treating surfaces like Part objects for now
|
||||
|
||||
|
||||
#include <App/Application.h>
|
||||
#include <App/MeasureManager.h>
|
||||
#include "Base/Console.h"
|
||||
#include "Measure.h"
|
||||
|
||||
|
||||
void Surface::Measure::initialize()
|
||||
{
|
||||
const App::MeasureHandler& handler = App::MeasureManager::getMeasureHandler("Part");
|
||||
|
||||
App::MeasureManager::addMeasureHandler("Surface", handler.typeCb);
|
||||
}
|
||||
43
src/Mod/Surface/App/Measure.h
Normal file
43
src/Mod/Surface/App/Measure.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2025 Wandererfan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* 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/>. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
//! a class for establishing our connection with the unified measurement facility
|
||||
|
||||
#ifndef SURFACE_MEASURE_H
|
||||
#define SURFACE_MEASURE_H
|
||||
|
||||
#include <Mod/Surface/SurfaceGlobal.h>
|
||||
|
||||
|
||||
namespace Surface
|
||||
{
|
||||
|
||||
|
||||
class SurfaceExport Measure
|
||||
{
|
||||
public:
|
||||
static void initialize();
|
||||
};
|
||||
|
||||
|
||||
} // namespace Surface
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user