OpenLexocad  27.1
Element.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include <OpenLxApp/Product.h>
7 #include <OpenLxApp/Property.h>
8 #include <Topo/ShapeAttributes.h>
9 
10 #include <memory>
11 
12 FORWARD_DECL(App, Element)
13 
14 namespace OpenLxApp
15 {
16 class Group;
17 class Geometry;
18 class OpeningElement;
19 class SubElement;
20 
29 class LX_OPENLXAPP_EXPORT Element : public Product
30 {
31  PROXY_HEADER(Element, App::Element, IFCELEMENT)
32 
33 public:
36  void setPlacementRelativeTo(std::shared_ptr<Element> other);
37  void setPlacementRelativeTo(std::shared_ptr<Element> other, bool keepGlobalPosition);
38  std::shared_ptr<Element> getPlacementRelativeTo() const;
40 
43  bool setLayer(int layernumber);
44  int getLayer() const;
46 
49  void addOpeningElement(std::shared_ptr<OpeningElement> aOpening);
50  void removeOpeningElement(std::shared_ptr<OpeningElement> aOpening);
51  void removeOpeningElements();
52  std::vector<std::shared_ptr<OpeningElement>> getOpeningElements() const;
54 
57  void addParamCutHardElement(std::shared_ptr<Element> aElement);
58  void addParamCutSoftElement(std::shared_ptr<Element> aElement);
59  void removeParamCutHardElement(std::shared_ptr<Element> aElement);
60  void removeParamCutSoftElement(std::shared_ptr<Element> aElement);
61  std::vector<std::shared_ptr<Element>> getParamCutHardElements(bool includeAggregatedElements = false) const;
62  std::vector<std::shared_ptr<Element>> getParamCutSoftElements() const;
63  bool isParamCutHardElement() const;
64  bool isParamCutSoftElement() const;
66 
69  void addSubElement(std::shared_ptr<SubElement> aSubElement);
70  std::vector<std::shared_ptr<SubElement>> getSubElements() const;
71  void removeSubElement(std::shared_ptr<SubElement> aSubElement);
72  void removeSubElements();
74 
77  std::shared_ptr<OpeningElement> getFilledOpeningElement() const;
79 
82  void setAssociatedMaterial(std::shared_ptr<MaterialDefinition> aMaterialDefinition);
83  // void setAssociatedMaterial(std::shared_ptr<MaterialUsageDefinition> aMaterialUsageDefinition);
84  void removeAssociatedMaterial();
85  std::shared_ptr<MaterialSelect> getAssociatedMaterial() const;
87 
90  bool isTemporary() const;
91  void setTemporary(bool on);
92  std::shared_ptr<Group> getGroup() const;
93  std::shared_ptr<Element> copy() const;
94  Topo::Cdwk_SAT_Attributes get_Cdwk_SAT_Attributes() const;
95  Base::String getTag() const;
96  void setTag(const Base::String& aTag);
97  void setCdwkAttributeData(const CdwkAttributeData& aData);
98  std::string getCadworkGroup() const;
99  void setBoundingBoxEnabled(bool enabled);
101 
104  std::shared_ptr<OpenLxApp::Geometry> getAxisRepresentation() const;
105  bool setAxisRepresentation(std::shared_ptr<OpenLxApp::Geometry> aGeometry) const;
106 
107  std::shared_ptr<OpenLxApp::Geometry> getSolidModelRepresentation() const;
108  bool setSolidModelRepresentation(std::shared_ptr<OpenLxApp::Geometry> aGeometry) const;
109 
110  void showAxisRepresentation() const;
111  void showSolidModelRepresentation() const;
113 
114  virtual ~Element() = default;
115 
116 protected:
117  Element() = default;
118  void _copySubElems(App::Element* fromElem, std::shared_ptr<Element> toElem) const;
119 };
120 
121 } // namespace OpenLxApp
The Product is an abstract representation of any object that relates to a geometric or spatial contex...
Definition: Product.h:37
An element is a generalization of all components that make up an AEC product. Those elements can be l...
Definition: Element.h:29
#define PROXY_HEADER(_openlexocadclass_, _corelexocadclass_, _type_)
Definition: Globals.h:146
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
Definition: ActiveScript.h:7
Definition: ShapeAttributes.h:23
Definition: CdwkAttributeData.h:7
#define FORWARD_DECL(x, y)
Definition: Globals.h:93