OpenLexocad  27.0
Element.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <Base/Exception.h>
5 #include <Draw/DrawStyle.h>
6 #include <Draw/Texture2.h>
7 #include <Draw/Texture2Transform.h>
8 #include <Geom/Ax1.h>
9 #include <Geom/Ax2.h>
10 #include <Geom/Dir.h>
11 #include <Geom/Vec.h>
13 #include <OpenLxApp/Geometry.h>
17 #include <OpenLxApp/Product.h>
18 #include <OpenLxApp/Property.h>
19 #include <Topo/ShapeAttributes.h>
20 
21 #include <memory>
22 
23 FORWARD_DECL(App, Element)
24 
25 namespace OpenLxApp
26 {
27 class Group;
28 class Geometry;
29 class OpeningElement;
30 class SubElement;
31 
41 {
42  PROXY_HEADER(Element, App::Element, IFCELEMENT)
43 
44 public:
47  void setPlacementRelativeTo(std::shared_ptr<Element> other);
48  void setPlacementRelativeTo(std::shared_ptr<Element> other, bool keepGlobalPosition);
49  std::shared_ptr<Element> getPlacementRelativeTo() const;
51 
54  bool setLayer(int layernumber);
55  int getLayer() const;
57 
60  void addOpeningElement(std::shared_ptr<OpeningElement> aOpening);
61  void removeOpeningElement(std::shared_ptr<OpeningElement> aOpening);
62  void removeOpeningElements();
63  std::vector<std::shared_ptr<OpeningElement>> getOpeningElements() const;
64 
67  void addSubElement(std::shared_ptr<SubElement> aSubElement);
68  std::vector<std::shared_ptr<SubElement>> getSubElements() const;
69  void removeSubElement(std::shared_ptr<SubElement> aSubElement);
70  void removeSubElements();
72 
75  std::shared_ptr<OpeningElement> getFilledOpeningElement() const;
77 
80  void setAssociatedMaterial(std::shared_ptr<MaterialDefinition> aMaterialDefinition);
81  // void setAssociatedMaterial(std::shared_ptr<MaterialUsageDefinition> aMaterialUsageDefinition);
82  void removeAssociatedMaterial();
83  std::shared_ptr<MaterialSelect> getAssociatedMaterial() const;
85 
88  bool isTemporary() const;
89  void setTemporary(bool on);
90  std::shared_ptr<Group> getGroup() const;
91  std::shared_ptr<Element> copy() const;
92  Topo::Cdwk_SAT_Attributes get_Cdwk_SAT_Attributes() const;
93  Base::String getTag() const;
94  void setTag(const Base::String& aTag);
95  void setCdwkAttributeData(const CdwkAttributeData& aData);
97 
98 
99 
100  // DEPRECATED
101  // bool toMesh(); // TODO: Needs to go elsewhere
102 
103  virtual ~Element(void);
104 
105 protected:
106  Element() {}
107  void _copySubElems(App::Element* fromElem, std::shared_ptr<Element> toElem) const;
108 };
109 
110 } // namespace OpenLxApp
The Product is an abstract representation of any object that relates to a geometric or spatial contex...
Definition: Product.h:41
An element is a generalization of all components that make up an AEC product. Those elements can be l...
Definition: Element.h:40
#define PROXY_HEADER(_openlexocadclass_, _corelexocadclass_, _type_)
Definition: Globals.h:149
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:29
#define OPENLXAPP_EXPORT
Definition: OpenLxApp_defines.h:12
Definition: ActiveScript.h:9
Definition: ShapeAttributes.h:24
Definition: CdwkAttributeData.h:8
Element()
Definition: Element.h:106
#define FORWARD_DECL(x, y)
Definition: Globals.h:96