Download src/Mod/TechDraw/App/DrawGeomHatch.h from AbdulElahGwaith/FreeCAD: direct link, hf CLI and curl.
- Browser
- Download file 5.54 kB
-
https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/src/Mod/TechDraw/App/DrawGeomHatch.h
- Command line
-
hf download hf://AbdulElahGwaith/FreeCAD/src/Mod/TechDraw/App/DrawGeomHatch.h
-
curl -L -o DrawGeomHatch.h https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/src/Mod/TechDraw/App/DrawGeomHatch.h
5.54 kB
| /*************************************************************************** | |
| * Copyright (c) 2017 WandererFan <wandererfan@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 * | |
| * * | |
| ***************************************************************************/ | |
| class TopoDS_Edge; | |
| class TopoDS_Face; | |
| class Bnd_Box; | |
| namespace TechDraw | |
| { | |
| class BaseGeom; | |
| } | |
| namespace TechDraw | |
| { | |
| class DrawViewPart; | |
| class DrawViewSection; | |
| class PATLineSpec; | |
| class LineSet; | |
| class DashSet; | |
| class TechDrawExport DrawGeomHatch : public App::DocumentObject | |
| { | |
| PROPERTY_HEADER_WITH_OVERRIDE(TechDraw::DrawGeomHatch); | |
| public: | |
| DrawGeomHatch(); | |
| ~DrawGeomHatch() override = default; | |
| App::PropertyLinkSub Source; //the dvX & face(s) this crosshatch belongs to | |
| App::PropertyFile FilePattern; | |
| App::PropertyFileIncluded PatIncluded; | |
| App::PropertyString NamePattern; | |
| App::PropertyFloatConstraint ScalePattern; | |
| App::PropertyFloat PatternRotation; | |
| App::PropertyVector PatternOffset; | |
| App::DocumentObjectExecReturn *execute() override; | |
| void onChanged(const App::Property* prop) override; | |
| const char* getViewProviderName() const override { | |
| return "TechDrawGui::ViewProviderGeomHatch"; | |
| } | |
| PyObject *getPyObject() override; | |
| void setupObject() override; | |
| void unsetupObject() override; | |
| void onDocumentRestored() override; | |
| DrawViewPart* getSourceView() const; | |
| std::vector<LineSet> getFaceOverlay(int iFace = 0); | |
| std::vector<LineSet> getTrimmedLines(int iFace = 0); | |
| static std::vector<LineSet> getTrimmedLines(DrawViewPart* dvp, std::vector<LineSet> lineSets, int iface, | |
| double scale, double hatchRotation = 0.0, | |
| Base::Vector3d hatchOffset = Base::Vector3d(0.0, 0.0, 0.0)); | |
| static std::vector<LineSet> getTrimmedLines(DrawViewPart* source, | |
| std::vector<LineSet> lineSets, | |
| TopoDS_Face face, | |
| double scale , double hatchRotation = 0.0, | |
| Base::Vector3d hatchOffset = Base::Vector3d(0.0, 0.0, 0.0)); | |
| static std::vector<LineSet> getTrimmedLinesSection(DrawViewSection* source, | |
| std::vector<LineSet> lineSets, | |
| TopoDS_Face face, | |
| double scale , double hatchRotation = 0.0, | |
| Base::Vector3d hatchOffset = Base::Vector3d(0.0, 0.0, 0.0)); | |
| static std::vector<TopoDS_Edge> makeEdgeOverlay(PATLineSpec hatchLine, Bnd_Box bBox, | |
| double scale, double rotation); | |
| static TopoDS_Edge makeLine(const Base::Vector3d& start, const Base::Vector3d& end); | |
| static std::vector<PATLineSpec> getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern); | |
| static TopoDS_Face extractFace(DrawViewPart* source, int iface ); | |
| static std::string prefGeomHatchFile(); | |
| static std::string prefGeomHatchName(); | |
| static Base::Color prefGeomHatchColor(); | |
| static std::vector<LineSet> makeLineSets(std::string fileSpec, std::string myPattern); | |
| void translateLabel(std::string context, std::string baseName, std::string uniqueName); | |
| protected: | |
| void replacePatIncluded(std::string newHatchFileName); | |
| void makeLineSets(); | |
| std::vector<PATLineSpec> getDecodedSpecsFromFile(); | |
| private: | |
| std::vector<LineSet> m_lineSets; | |
| std::string m_saveFile; | |
| std::string m_saveName; | |
| static App::PropertyFloatConstraint::Constraints scaleRange; | |
| }; | |
| using DrawGeomHatchPython = App::FeaturePythonT<DrawGeomHatch>; | |
| } //namespace TechDraw | |