Merge pull request #12535 from CalligaroV/toponaming-WireJoiner
Part/Toponaming: Transfer WireJoiner
This commit is contained in:
@@ -756,7 +756,12 @@ static inline void getEndPoints(const TopoDS_Wire& wire, gp_Pnt& p1, gp_Pnt& p2)
|
||||
p2 = BRep_Tool::Pnt(TopoDS::Vertex(xp.CurrentVertex()));
|
||||
}
|
||||
|
||||
|
||||
// Toponaming integration note: there's a new class called WireJoiner in Mod/Part/App/ that has been
|
||||
// imported from RT's fork. Is's an improved version of the following struct, therefor
|
||||
// probably at some point this struct should be replaced with the new imported class.
|
||||
// See https://github.com/realthunder/FreeCAD/blob/LinkStable/src/Mod/Part/App/WireJoiner.h for the
|
||||
// original implementation of the class and https://github.com/FreeCAD/FreeCAD/pull/12535 for the
|
||||
// import conversation.
|
||||
struct WireJoiner {
|
||||
|
||||
using Box = bg::model::box<gp_Pnt>;
|
||||
|
||||
@@ -556,6 +556,8 @@ SET(Part_SRCS
|
||||
FaceMakerCheese.h
|
||||
FaceMakerBullseye.cpp
|
||||
FaceMakerBullseye.h
|
||||
WireJoiner.cpp
|
||||
WireJoiner.h
|
||||
)
|
||||
|
||||
if(FREECAD_USE_PCH)
|
||||
|
||||
3166
src/Mod/Part/App/WireJoiner.cpp
Normal file
3166
src/Mod/Part/App/WireJoiner.cpp
Normal file
File diff suppressed because it is too large
Load Diff
67
src/Mod/Part/App/WireJoiner.h
Normal file
67
src/Mod/Part/App/WireJoiner.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2022 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PART_WIRE_JOINER_H
|
||||
#define PART_WIRE_JOINER_H
|
||||
|
||||
#include <memory>
|
||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||
#include <Standard_Version.hxx>
|
||||
#include "TopoShape.h"
|
||||
|
||||
namespace Part{
|
||||
|
||||
class PartExport WireJoiner: public BRepBuilderAPI_MakeShape {
|
||||
public:
|
||||
WireJoiner();
|
||||
~WireJoiner() override;
|
||||
|
||||
void addShape(const TopoShape &shape);
|
||||
void addShape(const std::vector<TopoShape> &shapes);
|
||||
void addShape(const std::vector<TopoDS_Shape> &shapes);
|
||||
|
||||
void setOutline(bool enable=true);
|
||||
void setTightBound(bool enable=true);
|
||||
void setSplitEdges(bool enable=true);
|
||||
void setMergeEdges(bool enable=true);
|
||||
void setTolerance(double tolerance, double atol=0.0);
|
||||
|
||||
bool getOpenWires(TopoShape &shape, const char *op="", bool noOriginal=true);
|
||||
bool getResultWires(TopoShape &shape, const char *op="");
|
||||
|
||||
#if OCC_VERSION_HEX < 0x070600
|
||||
void Build() override;
|
||||
#else
|
||||
void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) override;
|
||||
#endif
|
||||
const TopTools_ListOfShape& Modified (const TopoDS_Shape& SThatModifies) override;
|
||||
const TopTools_ListOfShape& Generated (const TopoDS_Shape& SThatGenerates) override;
|
||||
Standard_Boolean IsDeleted (const TopoDS_Shape& SDeleted) override;
|
||||
|
||||
private:
|
||||
class WireJoinerP;
|
||||
std::unique_ptr<WireJoinerP> pimpl;
|
||||
};
|
||||
|
||||
} // namespace Part
|
||||
|
||||
#endif // PART_WIRE_JOINER_H
|
||||
Reference in New Issue
Block a user