OpenLexocad  28.0
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);
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);
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);
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;
96  void setTag(const Base::String& aTag);
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 
113 
116  std::vector<std::shared_ptr<Element>> getElementsConnectedAtEnd() const;
117  std::vector<std::shared_ptr<Element>> getElementsConnectedAtStart() const;
118  std::vector<int> getJointsTypeAtEnd() const;
119  std::vector<int> getJointsTypeAtStart() const;
121 
122  virtual ~Element() = default;
123 
124 protected:
125  Element() = default;
126  void _copySubElems(App::Element* fromElem, std::shared_ptr<Element> toElem) const;
127 };
128 
129 } // namespace OpenLxApp
OpenLxApp::Element::getJointsTypeAtEnd
std::vector< int > getJointsTypeAtEnd() const
OpenLxApp
Definition: ActiveScript.h:10
OpenLxApp::Element::setLayer
bool setLayer(int layernumber)
OpenLxApp::Element::setAssociatedMaterial
void setAssociatedMaterial(std::shared_ptr< MaterialDefinition > aMaterialDefinition)
OpenLxApp::Product
The Product is an abstract representation of any object that relates to a geometric or spatial contex...
Definition: Product.h:45
MaterialSelect.h
OpenLxApp::Element::addOpeningElement
void addOpeningElement(std::shared_ptr< OpeningElement > aOpening)
OpenLxApp::Element::removeSubElement
void removeSubElement(std::shared_ptr< SubElement > aSubElement)
OpenLxApp::Element::getAxisRepresentation
std::shared_ptr< OpenLxApp::Geometry > getAxisRepresentation() const
FORWARD_DECL
#define FORWARD_DECL(x, y)
Definition: Globals.h:93
OpenLxApp::Element::addSubElement
void addSubElement(std::shared_ptr< SubElement > aSubElement)
OpenLxApp::Element::showAxisRepresentation
void showAxisRepresentation() const
Product.h
OpenLxApp::Element::setPlacementRelativeTo
void setPlacementRelativeTo(std::shared_ptr< Element > other)
OpenLxApp::Element::removeOpeningElement
void removeOpeningElement(std::shared_ptr< OpeningElement > aOpening)
OpenLxApp::Element::~Element
virtual ~Element()=default
OpenLxApp::Element::getPlacementRelativeTo
std::shared_ptr< Element > getPlacementRelativeTo() const
OpenLxApp::Element::setTag
void setTag(const Base::String &aTag)
OpenLxApp::Element::addParamCutHardElement
void addParamCutHardElement(std::shared_ptr< Element > aElement)
OpenLxApp::Element::getLayer
int getLayer() const
OpenLxApp::Element::getSolidModelRepresentation
std::shared_ptr< OpenLxApp::Geometry > getSolidModelRepresentation() const
OpenLxApp::Element::getSubElements
std::vector< std::shared_ptr< SubElement > > getSubElements() const
OpenLxApp::CdwkAttributeData
Definition: CdwkAttributeData.h:8
OpenLxApp::Element::setSolidModelRepresentation
bool setSolidModelRepresentation(std::shared_ptr< OpenLxApp::Geometry > aGeometry) const
OpenLxApp::Element::getTag
Base::String getTag() const
OpenLxApp::Element::setPlacementRelativeTo
void setPlacementRelativeTo(std::shared_ptr< Element > other, bool keepGlobalPosition)
OpenLxApp::Element::removeAssociatedMaterial
void removeAssociatedMaterial()
OpenLxApp::Element
An element is a generalization of all components that make up an AEC product. Those elements can be l...
Definition: Element.h:30
OpenLxApp::Element::_copySubElems
void _copySubElems(App::Element *fromElem, std::shared_ptr< Element > toElem) const
OpenLxApp::Element::getElementsConnectedAtEnd
std::vector< std::shared_ptr< Element > > getElementsConnectedAtEnd() const
Topo::Cdwk_SAT_Attributes
Definition: ShapeAttributes.h:20
OpenLxApp::Element::getGroup
std::shared_ptr< Group > getGroup() const
OpenLxApp::Element::getJointsTypeAtStart
std::vector< int > getJointsTypeAtStart() const
OpenLxApp::Element::isTemporary
bool isTemporary() const
Property.h
OpenLxApp::Element::isParamCutHardElement
bool isParamCutHardElement() const
OpenLxApp::Element::setAxisRepresentation
bool setAxisRepresentation(std::shared_ptr< OpenLxApp::Geometry > aGeometry) const
OpenLxApp::Element::setCdwkAttributeData
void setCdwkAttributeData(const CdwkAttributeData &aData)
OpenLxApp::Element::copy
std::shared_ptr< Element > copy() const
OpenLxApp::Element::getFilledOpeningElement
std::shared_ptr< OpeningElement > getFilledOpeningElement() const
OpenLxApp::Element::get_Cdwk_SAT_Attributes
Topo::Cdwk_SAT_Attributes get_Cdwk_SAT_Attributes() const
CdwkAttributeData.h
OpenLxApp::Element::isParamCutSoftElement
bool isParamCutSoftElement() const
OpenLxApp::Element::getParamCutSoftElements
std::vector< std::shared_ptr< Element > > getParamCutSoftElements() const
MaterialDefinition.h
OpenLxApp::Element::showSolidModelRepresentation
void showSolidModelRepresentation() const
OpenLxApp::Element::addParamCutSoftElement
void addParamCutSoftElement(std::shared_ptr< Element > aElement)
OpenLxApp::Element::setTemporary
void setTemporary(bool on)
ShapeAttributes.h
OpenLxApp::Element::Element
Element()=default
OpenLxApp::Element::getOpeningElements
std::vector< std::shared_ptr< OpeningElement > > getOpeningElements() const
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
OpenLxApp::Element::getParamCutHardElements
std::vector< std::shared_ptr< Element > > getParamCutHardElements(bool includeAggregatedElements=false) const
OpenLxApp::Element::setBoundingBoxEnabled
void setBoundingBoxEnabled(bool enabled)
OpenLxApp::Element::removeSubElements
void removeSubElements()
OpenLxApp::Element::getAssociatedMaterial
std::shared_ptr< MaterialSelect > getAssociatedMaterial() const
OpenLxApp::Element::removeParamCutSoftElement
void removeParamCutSoftElement(std::shared_ptr< Element > aElement)
OpenLxApp::Element::removeParamCutHardElement
void removeParamCutHardElement(std::shared_ptr< Element > aElement)
OpenLxApp::Element::getCadworkGroup
std::string getCadworkGroup() const
OpenLxApp::Element::getElementsConnectedAtStart
std::vector< std::shared_ptr< Element > > getElementsConnectedAtStart() const
PROXY_HEADER
#define PROXY_HEADER(_openlexocadclass_, _corelexocadclass_, _type_)
Definition: Globals.h:146
OpenLxApp::Element::removeOpeningElements
void removeOpeningElements()