| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef TechDraw_DrawGeomHatch_h_ |
| | #define TechDraw_DrawGeomHatch_h_ |
| |
|
| | #include <App/DocumentObject.h> |
| | #include <App/FeaturePython.h> |
| | #include <App/PropertyFile.h> |
| | #include <Mod/TechDraw/TechDrawGlobal.h> |
| |
|
| | #include "HatchLine.h" |
| |
|
| |
|
| | 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; |
| | 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>; |
| |
|
| |
|
| |
|
| | } |
| | #endif |
| |
|