OpenLexocad  27.1
CmdAddPropertySet.h
Go to the documentation of this file.
1  #pragma once
2 #include <Core/Command.h>
3 
4 #include <App/ComponentType.h>
5 #include <App/Properties/PropertySetInfo.h>
6 #include <OpenLxApp/Element.h>
7 
8 
9 namespace OpenLxCmd
10 {
14 class LX_OPENLXCMD_EXPORT CmdAddPropertySet : public Core::Command
15 {
16 public:
17  CmdAddPropertySet() = default;
18  CmdAddPropertySet(const std::string& propertySetName, const std::string& propertyName);
19  CmdAddPropertySet(const std::string& propertySetName, const std::string& propertyName, std::shared_ptr<OpenLxApp::Element> aElement);
20  CmdAddPropertySet(const std::string& propertySetName, const std::string& propertyName, std::vector<std::shared_ptr<OpenLxApp::Element>>& aElements);
21  CmdAddPropertySet(const std::string& propertySetName, const std::vector<std::string>& propertyNames);
22  CmdAddPropertySet(const std::string& propertySetName, const std::vector<std::string>& propertyNames, std::shared_ptr<OpenLxApp::Element> aElement);
23  CmdAddPropertySet(const std::string& propertySetName, const std::vector<std::string>& propertyNames, std::vector<std::shared_ptr<OpenLxApp::Element>>& aElements);
24  ~CmdAddPropertySet() = default;
25 
26  bool redo() override;
27  bool undo() override;
28 
29 private:
30  std::map<App::ComponentType*, std::map<App::Element*, App::PropertySet*>> _components = {};
31  App::Document* _document = nullptr;
32  App::PropertySetInfo* _propertySetInfo = nullptr;
33  std::vector<Core::PropertyDescriptor *> _propertyDescriptors = {};
34 
35  void execute(const std::string& propertySetName, const std::vector<std::string>& propertyNames, const std::vector<App::Element*> &elements);
36  Core::PropertyDescriptor* getPropertyDescriptor(const Base::String& propertyName) const;
37  App::PropertySet* getPropertySet(const Base::String& propertySetName, App::Element* element) const;
38 };
39 }
"CmdAddPropertySet" is used to assign one or more EXISTING Property to a PropertySet.
Definition: CmdAddPropertySet.h:14
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
Definition: PropertyDescriptor.h:15
bool undo(int id=0)
Will UNDO one step, returns False if no undo was done (Undos == 0).
bool redo(int id=0)
Will REDO one step, returns False if no redo was done (Redos == 0).
Definition: CmdAddBolt.h:7
Definition: Command.h:34