| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #ifndef PARTDESIGN_FeatureLinearPattern_H
|
| | #define PARTDESIGN_FeatureLinearPattern_H
|
| |
|
| | #include <App/PropertyUnits.h>
|
| | #include "FeatureTransformed.h"
|
| |
|
| | class gp_Vec;
|
| |
|
| | namespace PartDesign
|
| | {
|
| | enum class LinearPatternMode
|
| | {
|
| | Extent,
|
| | Spacing
|
| | };
|
| |
|
| | enum class LinearPatternDirection : std::uint8_t
|
| | {
|
| | First,
|
| | Second
|
| | };
|
| |
|
| | class PartDesignExport LinearPattern: public PartDesign::Transformed
|
| | {
|
| | PROPERTY_HEADER_WITH_OVERRIDE(PartDesign::LinearPattern);
|
| |
|
| | public:
|
| | LinearPattern();
|
| |
|
| | App::PropertyLinkSub Direction;
|
| | App::PropertyBool Reversed;
|
| | App::PropertyEnumeration Mode;
|
| | App::PropertyLength Length;
|
| | App::PropertyLength Offset;
|
| | App::PropertyIntegerConstraint Occurrences;
|
| | App::PropertyFloatList Spacings;
|
| | App::PropertyFloatList SpacingPattern;
|
| |
|
| | App::PropertyLinkSub Direction2;
|
| | App::PropertyBool Reversed2;
|
| | App::PropertyEnumeration Mode2;
|
| | App::PropertyLength Length2;
|
| | App::PropertyLength Offset2;
|
| | App::PropertyIntegerConstraint Occurrences2;
|
| | App::PropertyFloatList Spacings2;
|
| | App::PropertyFloatList SpacingPattern2;
|
| |
|
| |
|
| |
|
| |
|
| | short mustExecute() const override;
|
| |
|
| |
|
| | const char* getViewProviderName() const override
|
| | {
|
| | return "PartDesignGui::ViewProviderLinearPattern";
|
| | }
|
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | const std::list<gp_Trsf> getTransformations(const std::vector<App::DocumentObject*>) override;
|
| |
|
| | protected:
|
| | void handleChangedPropertyType(
|
| | Base::XMLReader& reader,
|
| | const char* TypeName,
|
| | App::Property* prop
|
| | ) override;
|
| | void onChanged(const App::Property* prop) override;
|
| |
|
| | static const App::PropertyIntegerConstraint::Constraints intOccurrences;
|
| |
|
| | private:
|
| | static const char* ModeEnums[];
|
| |
|
| | gp_Dir getDirectionFromProperty(const App::PropertyLinkSub& dirProp) const;
|
| |
|
| | void setReadWriteStatusForMode(LinearPatternDirection dir);
|
| | void syncLengthAndOffset(LinearPatternDirection dir);
|
| |
|
| | void updateSpacings();
|
| | void updateSpacings(LinearPatternDirection dir);
|
| |
|
| | gp_Vec calculateOffsetVector(LinearPatternDirection dir) const;
|
| | std::vector<gp_Vec> calculateSteps(LinearPatternDirection dir, const gp_Vec& offsetVector) const;
|
| | };
|
| |
|
| | }
|
| |
|
| |
|
| | #endif
|
| |
|