// SPDX-License-Identifier: LGPL-2.1-or-later #include #include #include #include #include "Base/Interpreter.h" #include #include "Mod/Part/App/FeaturePartBox.h" #include "Mod/Part/App/FeaturePartFuse.h" #include "Mod/Part/App/FeatureFillet.h" #include #include #include #include #include #include #include #include #include namespace PartTestHelpers { using namespace Data; using namespace Part; double getVolume(const TopoDS_Shape& shape); double getArea(const TopoDS_Shape& shape); double getLength(const TopoDS_Shape& shape); std::vector _getFilletEdges( const std::vector& edges, double startRadius, double endRadius ); class PartTestHelperClass { public: App::Document* _doc; std::string _docName; std::array _boxes; // NOLINT magic number void createTestDoc(); }; const double minimalDistance = Base::Precision::Confusion() * 1000; void executePython(const std::vector& python); void rectangle(double height, double width, const char* name); std::tuple CreateRectFace( float len = 2.0, float wid = 3.0 ); std::tuple CreateFaceWithRoundHole( float len = 2.0, float wid = 3.0, float radius = 1.0 ); testing::AssertionResult boxesMatch( const Base::BoundBox3d& b1, const Base::BoundBox3d& b2, double prec = 1e-05 ); // NOLINT std::map elementMap(const TopoShape& shape); /** * Checks that all the names occur in the shape's element map. Map can contain additional names * @param shape The Shape * @param names The Names * @return A test result, suitable for display by the gtest framework */ testing::AssertionResult elementsMatch(const TopoShape& shape, const std::vector& names); /** * Checks that all the names occur in the shape's element map and that there are no additional names * @param shape The Shape * @param names The Names * @return A test result, suitable for display by the gtest framework */ testing::AssertionResult allElementsMatch(const TopoShape& shape, const std::vector& names); /** * * @return Two raw shape cubes without element maps */ std::pair CreateTwoCubes(); /** * * @return Two TopoShape cubes with elementMaps */ std::pair CreateTwoTopoShapeCubes(); } // namespace PartTestHelpers