Added materials quants for mesh, morph, roof, shell, slab and wall

This commit is contained in:
Ralph Wessel
2024-11-01 22:57:47 +00:00
parent 51370ababc
commit 2c0d53c186
23 changed files with 1822 additions and 66 deletions
@@ -16,6 +16,12 @@
#include "Speckle/Record/Element/Beam.h"
#include "Speckle/Record/Element/BeamSegment.h"
#include "Speckle/Record/Element/Memo.h"
#include "Speckle/Record/Element/Mesh.h"
#include "Speckle/Record/Element/Morph.h"
#include "Speckle/Record/Element/Roof.h"
#include "Speckle/Record/Element/Shell.h"
#include "Speckle/Record/Element/Slab.h"
#include "Speckle/Record/Element/Wall.h"
#include "Speckle/Utility/Guid.h"
#include "Speckle/Utility/String.h"
@@ -82,6 +88,18 @@ namespace {
return std::make_unique<Beam>(elementData, tableID);
case API_BeamSegmentID:
return std::make_unique<BeamSegment>(elementData, tableID);
case API_MeshID:
return std::make_unique<Mesh>(elementData, tableID);
case API_MorphID:
return std::make_unique<Morph>(elementData, tableID);
case API_RoofID:
return std::make_unique<Roof>(elementData, tableID);
case API_ShellID:
return std::make_unique<Shell>(elementData, tableID);
case API_SlabID:
return std::make_unique<Slab>(elementData, tableID);
case API_WallID:
return std::make_unique<Wall>(elementData, tableID);
default:
return std::make_unique<GenericModelElement>(elementData, tableID);
}
@@ -1,15 +1,8 @@
#include "Speckle/Record/Element/Beam.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::utility;
@@ -1,22 +1,14 @@
#include "Speckle/Record/Element/BeamSegment.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/BIMMemory.h"
#include "Speckle/Utility/Guid.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
@@ -1,15 +1,8 @@
#include "Speckle/Record/Element/Column.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::utility;
@@ -1,22 +1,14 @@
#include "Speckle/Record/Element/ColumnSegment.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/BIMMemory.h"
#include "Speckle/Utility/Guid.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
@@ -1,15 +1,6 @@
#include "Speckle/Record/Element/DrawingElement.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::utility;
@@ -1,16 +1,11 @@
#include "Speckle/Record/Element/Element.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Database/BIMElementDatabase.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Environment/Project.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/Record/Element/Memo.h"
#include "Speckle/Record/Element/Setting/TypeSetting.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::database;
@@ -1,15 +1,6 @@
#include "Speckle/Record/Element/GenericDrawingElement.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::utility;
@@ -1,15 +1,6 @@
#include "Speckle/Record/Element/GenericModelElement.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/Guid.h"
using namespace active::serialise;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::utility;
+164
View File
@@ -0,0 +1,164 @@
#include "Speckle/Record/Element/Mesh.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/Utility/BIMMemory.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
using namespace speckle::utility;
#include <array>
#include <memory>
namespace speckle::record::element {
class Mesh::Data {
public:
friend class Mesh;
#ifdef ARCHICAD
Data(const API_MeshType& seg) : root{seg} {}
private:
API_MeshType root;
#endif
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Mesh::Mesh() {
} //Mesh::Mesh
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Constructor
elemData: Archicad element data
tableID: The element table ID (AC database, e.g. floor plan, 3D)
--------------------------------------------------------------------*/
Mesh::Mesh(const API_Element& elemData, const speckle::utility::Guid& tableID) : base{ elemData.header.guid, tableID } {
m_data = std::make_unique<Data>(elemData.mesh);
} //Mesh::Mesh
#endif
/*--------------------------------------------------------------------
Copy constructor
source: The object to copy
--------------------------------------------------------------------*/
Mesh::Mesh(const Mesh& source) : base{ source } {
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
} //Mesh::Mesh
/*--------------------------------------------------------------------
Move constructor
source: The object to move
--------------------------------------------------------------------*/
Mesh::Mesh(Mesh&& source) noexcept : base{source} {
m_data = std::move(source.m_data);
} //Mesh::Mesh
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
Mesh::~Mesh() {}
/*--------------------------------------------------------------------
Get the element material (applicable to elements with a single, homogenous material)
return: The element material (nullopt if not applicable to the element)
--------------------------------------------------------------------*/
std::optional<Material> Mesh::getMaterial() const {
#ifdef ARCHICAD
return Material{Guid{Guid::fromInt(m_data->root.buildingMaterial.GenerateHashValue())}};
#endif
} //Mesh::getMaterial
/*--------------------------------------------------------------------
Get a spatial measurement from this element (area/volume, as used for material quantities)
return: The element measurement (empty if unavailable)
--------------------------------------------------------------------*/
ModelElement::SpatialMeasure Mesh::getSpatialMeasure() const {
#ifdef ARCHICAD
Surveyor surveyor;
BIMMemory::setMask(&surveyor.elementMask().mesh.topSurface);
BIMMemory::setMask(&surveyor.elementMask().mesh.volume);
surveyor.measure(getBIMLink());
return SpatialMeasure{surveyor.quantity().mesh.topSurface, surveyor.quantity().mesh.volume};
#endif
} //Mesh::getSpatialMeasure
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
const API_Elem_Head& Mesh::getHead() const {
return m_data->root.head;
} //Mesh::getHead
/*--------------------------------------------------------------------
Get the (mutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
API_Elem_Head& Mesh::getHead() {
return m_data->root.head;
} //Mesh::getHead
#endif
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Mesh::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//TODO: Implement other fields as required
return base::fillInventory(inventory);
} //Mesh::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Mesh::getCargo(const Inventory::Item& item) const {
//TODO: Implement other fields as required
return base::getCargo(item);
} //Mesh::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Mesh::setDefault() {
m_data.reset();
} //Mesh::setDefault
+120
View File
@@ -0,0 +1,120 @@
#ifndef SPECKLE_RECORD_ELEMENT_MESH
#define SPECKLE_RECORD_ELEMENT_MESH
#include "Speckle/Record/Element/ModelElement.h"
#include "Speckle/Record/Element/Interface/Assembly/Segment.h"
namespace speckle::record::element {
/*!
BIM mesh class
*/
class Mesh : public ModelElement {
public:
// MARK: - Types
using base = ModelElement;
///Unique pointer
using Unique = std::unique_ptr<Mesh>;
///Shared pointer
using Shared = std::shared_ptr<Mesh>;
///Optional
using Option = std::optional<Mesh>;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
Mesh();
#ifdef ARCHICAD
/*!
Constructor
@param elemData Archicad element data
@param tableID The element table ID (AC database, e.g. floor plan, 3D)
*/
Mesh(const API_Element& elemData, const speckle::utility::Guid& tableID);
#endif
/*!
Copy constructor
@param source The object to copy
*/
Mesh(const Mesh& source);
/*!
Move constructor
@param source The object to move
*/
Mesh(Mesh&& source) noexcept;
/*!
Destructor
*/
~Mesh();
/*!
Object cloning
@return A clone of this object
*/
Mesh* clonePtr() const override { return new Mesh{*this}; }
// MARK: - Functions (const)
/*!
Get the element material (applicable to elements with a single, homogenous material)
@return The element material (nullopt if not applicable to the element)
*/
std::optional<record::attribute::Material> getMaterial() const override;
/*!
Get a spatial measurement from this element (area/volume, as used for material quantities)
@return The element measurement (empty if unavailable)
*/
SpatialMeasure getSpatialMeasure() const override;
#ifdef ARCHICAD
/*!
Get the (immutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
const API_Elem_Head& getHead() const override;
#endif
// MARK: - Functions (mutating)
#ifdef ARCHICAD
/*!
Get the (mutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
API_Elem_Head& getHead() override;
#endif
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
private:
class Data;
///The beam data
std::unique_ptr<Data> m_data;
};
}
#endif //SPECKLE_RECORD_ELEMENT_MESH
@@ -1,7 +1,5 @@
#include "Speckle/Record/Element/ModelElement.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
@@ -9,7 +7,6 @@
#include "Speckle/Record/Property/Wrapper/PropertiedWrapper.h"
#include "Speckle/SpeckleResource.h"
#include "Speckle/Utility/BIMMemory.h"
#include "Speckle/Utility/Guid.h"
#ifdef ARCHICAD
#include <exp.h>
@@ -292,7 +289,7 @@ MaterialQuantityList ModelElement::getMaterialQuantities() const {
measureQuantities(getHead().guid, elementQuantity, extendedQuantity, quantityMask);
//Create material quantities from the quantity takeoff (one oer skin in the composite structure)
for (auto& skinQuant : compositeQuantity)
result.push_back({Guid{Guid::fromInt(skinQuant.buildMatIndices.GenerateHashValue())}, skinQuant.volumes, skinQuant.projectedArea});
result.push_back({Guid{Guid::fromInt(skinQuant.buildMatIndices.GenerateHashValue())}, skinQuant.projectedArea, skinQuant.volumes});
#endif
break;
}
+164
View File
@@ -0,0 +1,164 @@
#include "Speckle/Record/Element/Morph.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/Utility/BIMMemory.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
using namespace speckle::utility;
#include <array>
#include <memory>
namespace speckle::record::element {
class Morph::Data {
public:
friend class Morph;
#ifdef ARCHICAD
Data(const API_MorphType& seg) : root{seg} {}
private:
API_MorphType root;
#endif
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Morph::Morph() {
} //Morph::Morph
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Constructor
elemData: Archicad element data
tableID: The element table ID (AC database, e.g. floor plan, 3D)
--------------------------------------------------------------------*/
Morph::Morph(const API_Element& elemData, const speckle::utility::Guid& tableID) : base{ elemData.header.guid, tableID } {
m_data = std::make_unique<Data>(elemData.morph);
} //Morph::Morph
#endif
/*--------------------------------------------------------------------
Copy constructor
source: The object to copy
--------------------------------------------------------------------*/
Morph::Morph(const Morph& source) : base{ source } {
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
} //Morph::Morph
/*--------------------------------------------------------------------
Move constructor
source: The object to move
--------------------------------------------------------------------*/
Morph::Morph(Morph&& source) noexcept : base{source} {
m_data = std::move(source.m_data);
} //Morph::Morph
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
Morph::~Morph() {}
/*--------------------------------------------------------------------
Get the element material (applicable to elements with a single, homogenous material)
return: The element material (nullopt if not applicable to the element)
--------------------------------------------------------------------*/
std::optional<Material> Morph::getMaterial() const {
#ifdef ARCHICAD
return Material{Guid{Guid::fromInt(m_data->root.buildingMaterial.GenerateHashValue())}};
#endif
} //Morph::getMaterial
/*--------------------------------------------------------------------
Get a spatial measurement from this element (area/volume, as used for material quantities)
return: The element measurement (empty if unavailable)
--------------------------------------------------------------------*/
ModelElement::SpatialMeasure Morph::getSpatialMeasure() const {
#ifdef ARCHICAD
Surveyor surveyor;
BIMMemory::setMask(&surveyor.elementMask().morph.surface);
BIMMemory::setMask(&surveyor.elementMask().morph.volume);
surveyor.measure(getBIMLink());
return SpatialMeasure{surveyor.quantity().morph.surface, surveyor.quantity().morph.volume};
#endif
} //Morph::getSpatialMeasure
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
const API_Elem_Head& Morph::getHead() const {
return m_data->root.head;
} //Morph::getHead
/*--------------------------------------------------------------------
Get the (mutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
API_Elem_Head& Morph::getHead() {
return m_data->root.head;
} //Morph::getHead
#endif
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Morph::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//TODO: Implement other fields as required
return base::fillInventory(inventory);
} //Morph::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Morph::getCargo(const Inventory::Item& item) const {
//TODO: Implement other fields as required
return base::getCargo(item);
} //Morph::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Morph::setDefault() {
m_data.reset();
} //Morph::setDefault
+120
View File
@@ -0,0 +1,120 @@
#ifndef SPECKLE_RECORD_ELEMENT_MORPH
#define SPECKLE_RECORD_ELEMENT_MORPH
#include "Speckle/Record/Element/ModelElement.h"
#include "Speckle/Record/Element/Interface/Assembly/Segment.h"
namespace speckle::record::element {
/*!
BIM morph class
*/
class Morph : public ModelElement {
public:
// MARK: - Types
using base = ModelElement;
///Unique pointer
using Unique = std::unique_ptr<Morph>;
///Shared pointer
using Shared = std::shared_ptr<Morph>;
///Optional
using Option = std::optional<Morph>;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
Morph();
#ifdef ARCHICAD
/*!
Constructor
@param elemData Archicad element data
@param tableID The element table ID (AC database, e.g. floor plan, 3D)
*/
Morph(const API_Element& elemData, const speckle::utility::Guid& tableID);
#endif
/*!
Copy constructor
@param source The object to copy
*/
Morph(const Morph& source);
/*!
Move constructor
@param source The object to move
*/
Morph(Morph&& source) noexcept;
/*!
Destructor
*/
~Morph();
/*!
Object cloning
@return A clone of this object
*/
Morph* clonePtr() const override { return new Morph{*this}; }
// MARK: - Functions (const)
/*!
Get the element material (applicable to elements with a single, homogenous material)
@return The element material (nullopt if not applicable to the element)
*/
std::optional<record::attribute::Material> getMaterial() const override;
/*!
Get a spatial measurement from this element (area/volume, as used for material quantities)
@return The element measurement (empty if unavailable)
*/
SpatialMeasure getSpatialMeasure() const override;
#ifdef ARCHICAD
/*!
Get the (immutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
const API_Elem_Head& getHead() const override;
#endif
// MARK: - Functions (mutating)
#ifdef ARCHICAD
/*!
Get the (mutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
API_Elem_Head& getHead() override;
#endif
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
private:
class Data;
///The beam data
std::unique_ptr<Data> m_data;
};
}
#endif //SPECKLE_RECORD_ELEMENT_MORPH
+176
View File
@@ -0,0 +1,176 @@
#include "Speckle/Record/Element/Roof.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/Utility/BIMMemory.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
using namespace speckle::utility;
#include <array>
#include <memory>
namespace speckle::record::element {
class Roof::Data {
public:
friend class Roof;
#ifdef ARCHICAD
Data(const API_RoofType& seg) : root{seg} {}
private:
API_RoofType root;
#endif
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Roof::Roof() {
} //Roof::Roof
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Constructor
elemData: Archicad element data
tableID: The element table ID (AC database, e.g. floor plan, 3D)
--------------------------------------------------------------------*/
Roof::Roof(const API_Element& elemData, const speckle::utility::Guid& tableID) : base{ elemData.header.guid, tableID } {
m_data = std::make_unique<Data>(elemData.roof);
} //Roof::Roof
#endif
/*--------------------------------------------------------------------
Copy constructor
source: The object to copy
--------------------------------------------------------------------*/
Roof::Roof(const Roof& source) : base{ source } {
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
} //Roof::Roof
/*--------------------------------------------------------------------
Move constructor
source: The object to move
--------------------------------------------------------------------*/
Roof::Roof(Roof&& source) noexcept : base{source} {
m_data = std::move(source.m_data);
} //Roof::Roof
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
Roof::~Roof() {}
/*--------------------------------------------------------------------
Get the composition of materials in the element
return: The material composition (element with ordered material composition should override)
--------------------------------------------------------------------*/
ModelElement::Composition Roof::getComposition() const {
#ifdef ARCHICAD
return convert(m_data->root.shellBase.modelElemStructureType);
#endif
} //Roof::getComposition
/*--------------------------------------------------------------------
Get the element material (applicable to elements with a single, homogenous material)
return: The element material (nullopt if not applicable to the element)
--------------------------------------------------------------------*/
std::optional<Material> Roof::getMaterial() const {
#ifdef ARCHICAD
return Material{Guid{Guid::fromInt(m_data->root.shellBase.buildingMaterial.GenerateHashValue())}};
#endif
} //Roof::getMaterial
/*--------------------------------------------------------------------
Get a spatial measurement from this element (area/volume, as used for material quantities)
return: The element measurement (empty if unavailable)
--------------------------------------------------------------------*/
ModelElement::SpatialMeasure Roof::getSpatialMeasure() const {
#ifdef ARCHICAD
Surveyor surveyor;
BIMMemory::setMask(&surveyor.elementMask().roof.topSurface);
BIMMemory::setMask(&surveyor.elementMask().roof.volume);
surveyor.measure(getBIMLink());
return SpatialMeasure{surveyor.quantity().roof.topSurface, surveyor.quantity().roof.volume};
#endif
} //Roof::getSpatialMeasure
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
const API_Elem_Head& Roof::getHead() const {
return m_data->root.head;
} //Roof::getHead
/*--------------------------------------------------------------------
Get the (mutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
API_Elem_Head& Roof::getHead() {
return m_data->root.head;
} //Roof::getHead
#endif
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Roof::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//TODO: Implement other fields as required
return base::fillInventory(inventory);
} //Roof::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Roof::getCargo(const Inventory::Item& item) const {
//TODO: Implement other fields as required
return base::getCargo(item);
} //Roof::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Roof::setDefault() {
m_data.reset();
} //Roof::setDefault
+125
View File
@@ -0,0 +1,125 @@
#ifndef SPECKLE_RECORD_ELEMENT_ROOF
#define SPECKLE_RECORD_ELEMENT_ROOF
#include "Speckle/Record/Element/ModelElement.h"
#include "Speckle/Record/Element/Interface/Assembly/Segment.h"
namespace speckle::record::element {
/*!
BIM roof class
*/
class Roof : public ModelElement {
public:
// MARK: - Types
using base = ModelElement;
///Unique pointer
using Unique = std::unique_ptr<Roof>;
///Shared pointer
using Shared = std::shared_ptr<Roof>;
///Optional
using Option = std::optional<Roof>;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
Roof();
#ifdef ARCHICAD
/*!
Constructor
@param elemData Archicad element data
@param tableID The element table ID (AC database, e.g. floor plan, 3D)
*/
Roof(const API_Element& elemData, const speckle::utility::Guid& tableID);
#endif
/*!
Copy constructor
@param source The object to copy
*/
Roof(const Roof& source);
/*!
Move constructor
@param source The object to move
*/
Roof(Roof&& source) noexcept;
/*!
Destructor
*/
~Roof();
/*!
Object cloning
@return A clone of this object
*/
Roof* clonePtr() const override { return new Roof{*this}; }
// MARK: - Functions (const)
/*!
Get the composition of materials in the element
@return The material composition (element with ordered material composition should override)
*/
Composition getComposition() const override;
/*!
Get the element material (applicable to elements with a single, homogenous material)
@return The element material (nullopt if not applicable to the element)
*/
std::optional<record::attribute::Material> getMaterial() const override;
/*!
Get a spatial measurement from this element (area/volume, as used for material quantities)
@return The element measurement (empty if unavailable)
*/
SpatialMeasure getSpatialMeasure() const override;
#ifdef ARCHICAD
/*!
Get the (immutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
const API_Elem_Head& getHead() const override;
#endif
// MARK: - Functions (mutating)
#ifdef ARCHICAD
/*!
Get the (mutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
API_Elem_Head& getHead() override;
#endif
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
private:
class Data;
///The beam data
std::unique_ptr<Data> m_data;
};
}
#endif //SPECKLE_RECORD_ELEMENT_ROOF
+164
View File
@@ -0,0 +1,164 @@
#include "Speckle/Record/Element/Shell.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/Utility/BIMMemory.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
using namespace speckle::utility;
#include <array>
#include <memory>
namespace speckle::record::element {
class Shell::Data {
public:
friend class Shell;
#ifdef ARCHICAD
Data(const API_ShellType& seg) : root{seg} {}
private:
API_ShellType root;
#endif
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Shell::Shell() {
} //Shell::Shell
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Constructor
elemData: Archicad element data
tableID: The element table ID (AC database, e.g. floor plan, 3D)
--------------------------------------------------------------------*/
Shell::Shell(const API_Element& elemData, const speckle::utility::Guid& tableID) : base{ elemData.header.guid, tableID } {
m_data = std::make_unique<Data>(elemData.shell);
} //Shell::Shell
#endif
/*--------------------------------------------------------------------
Copy constructor
source: The object to copy
--------------------------------------------------------------------*/
Shell::Shell(const Shell& source) : base{ source } {
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
} //Shell::Shell
/*--------------------------------------------------------------------
Move constructor
source: The object to move
--------------------------------------------------------------------*/
Shell::Shell(Shell&& source) noexcept : base{source} {
m_data = std::move(source.m_data);
} //Shell::Shell
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
Shell::~Shell() {}
/*--------------------------------------------------------------------
Get the element material (applicable to elements with a single, homogenous material)
return: The element material (nullopt if not applicable to the element)
--------------------------------------------------------------------*/
std::optional<Material> Shell::getMaterial() const {
#ifdef ARCHICAD
return Material{Guid{Guid::fromInt(m_data->root.shellBase.buildingMaterial.GenerateHashValue())}};
#endif
} //Shell::getMaterial
/*--------------------------------------------------------------------
Get a spatial measurement from this element (area/volume, as used for material quantities)
return: The element measurement (empty if unavailable)
--------------------------------------------------------------------*/
ModelElement::SpatialMeasure Shell::getSpatialMeasure() const {
#ifdef ARCHICAD
Surveyor surveyor;
BIMMemory::setMask(&surveyor.elementMask().shell.referenceSurface);
BIMMemory::setMask(&surveyor.elementMask().shell.volume);
surveyor.measure(getBIMLink());
return SpatialMeasure{surveyor.quantity().shell.referenceSurface, surveyor.quantity().shell.volume};
#endif
} //Shell::getSpatialMeasure
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
const API_Elem_Head& Shell::getHead() const {
return m_data->root.head;
} //Shell::getHead
/*--------------------------------------------------------------------
Get the (mutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
API_Elem_Head& Shell::getHead() {
return m_data->root.head;
} //Shell::getHead
#endif
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Shell::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//TODO: Implement other fields as required
return base::fillInventory(inventory);
} //Shell::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Shell::getCargo(const Inventory::Item& item) const {
//TODO: Implement other fields as required
return base::getCargo(item);
} //Shell::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Shell::setDefault() {
m_data.reset();
} //Shell::setDefault
+120
View File
@@ -0,0 +1,120 @@
#ifndef SPECKLE_RECORD_ELEMENT_SHELL
#define SPECKLE_RECORD_ELEMENT_SHELL
#include "Speckle/Record/Element/ModelElement.h"
#include "Speckle/Record/Element/Interface/Assembly/Segment.h"
namespace speckle::record::element {
/*!
BIM shell class
*/
class Shell : public ModelElement {
public:
// MARK: - Types
using base = ModelElement;
///Unique pointer
using Unique = std::unique_ptr<Shell>;
///Shared pointer
using Shared = std::shared_ptr<Shell>;
///Optional
using Option = std::optional<Shell>;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
Shell();
#ifdef ARCHICAD
/*!
Constructor
@param elemData Archicad element data
@param tableID The element table ID (AC database, e.g. floor plan, 3D)
*/
Shell(const API_Element& elemData, const speckle::utility::Guid& tableID);
#endif
/*!
Copy constructor
@param source The object to copy
*/
Shell(const Shell& source);
/*!
Move constructor
@param source The object to move
*/
Shell(Shell&& source) noexcept;
/*!
Destructor
*/
~Shell();
/*!
Object cloning
@return A clone of this object
*/
Shell* clonePtr() const override { return new Shell{*this}; }
// MARK: - Functions (const)
/*!
Get the element material (applicable to elements with a single, homogenous material)
@return The element material (nullopt if not applicable to the element)
*/
std::optional<record::attribute::Material> getMaterial() const override;
/*!
Get a spatial measurement from this element (area/volume, as used for material quantities)
@return The element measurement (empty if unavailable)
*/
SpatialMeasure getSpatialMeasure() const override;
#ifdef ARCHICAD
/*!
Get the (immutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
const API_Elem_Head& getHead() const override;
#endif
// MARK: - Functions (mutating)
#ifdef ARCHICAD
/*!
Get the (mutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
API_Elem_Head& getHead() override;
#endif
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
private:
class Data;
///The beam data
std::unique_ptr<Data> m_data;
};
}
#endif //SPECKLE_RECORD_ELEMENT_SHELL
+176
View File
@@ -0,0 +1,176 @@
#include "Speckle/Record/Element/Slab.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/Utility/BIMMemory.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
using namespace speckle::utility;
#include <array>
#include <memory>
namespace speckle::record::element {
class Slab::Data {
public:
friend class Slab;
#ifdef ARCHICAD
Data(const API_SlabType& seg) : root{seg} {}
private:
API_SlabType root;
#endif
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Slab::Slab() {
} //Slab::Slab
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Constructor
elemData: Archicad element data
tableID: The element table ID (AC database, e.g. floor plan, 3D)
--------------------------------------------------------------------*/
Slab::Slab(const API_Element& elemData, const speckle::utility::Guid& tableID) : base{ elemData.header.guid, tableID } {
m_data = std::make_unique<Data>(elemData.slab);
} //Slab::Slab
#endif
/*--------------------------------------------------------------------
Copy constructor
source: The object to copy
--------------------------------------------------------------------*/
Slab::Slab(const Slab& source) : base{ source } {
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
} //Slab::Slab
/*--------------------------------------------------------------------
Move constructor
source: The object to move
--------------------------------------------------------------------*/
Slab::Slab(Slab&& source) noexcept : base{source} {
m_data = std::move(source.m_data);
} //Slab::Slab
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
Slab::~Slab() {}
/*--------------------------------------------------------------------
Get the composition of materials in the element
return: The material composition (element with ordered material composition should override)
--------------------------------------------------------------------*/
ModelElement::Composition Slab::getComposition() const {
#ifdef ARCHICAD
return convert(m_data->root.modelElemStructureType);
#endif
} //Slab::getComposition
/*--------------------------------------------------------------------
Get the element material (applicable to elements with a single, homogenous material)
return: The element material (nullopt if not applicable to the element)
--------------------------------------------------------------------*/
std::optional<Material> Slab::getMaterial() const {
#ifdef ARCHICAD
return Material{Guid{Guid::fromInt(m_data->root.buildingMaterial.GenerateHashValue())}};
#endif
} //Slab::getMaterial
/*--------------------------------------------------------------------
Get a spatial measurement from this element (area/volume, as used for material quantities)
return: The element measurement (empty if unavailable)
--------------------------------------------------------------------*/
ModelElement::SpatialMeasure Slab::getSpatialMeasure() const {
#ifdef ARCHICAD
Surveyor surveyor;
BIMMemory::setMask(&surveyor.elementMask().slab.topSurface);
BIMMemory::setMask(&surveyor.elementMask().slab.volume);
surveyor.measure(getBIMLink());
return SpatialMeasure{surveyor.quantity().slab.topSurface, surveyor.quantity().slab.volume};
#endif
} //Slab::getSpatialMeasure
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
const API_Elem_Head& Slab::getHead() const {
return m_data->root.head;
} //Slab::getHead
/*--------------------------------------------------------------------
Get the (mutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
API_Elem_Head& Slab::getHead() {
return m_data->root.head;
} //Slab::getHead
#endif
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Slab::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//TODO: Implement other fields as required
return base::fillInventory(inventory);
} //Slab::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Slab::getCargo(const Inventory::Item& item) const {
//TODO: Implement other fields as required
return base::getCargo(item);
} //Slab::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Slab::setDefault() {
m_data.reset();
} //Slab::setDefault
+125
View File
@@ -0,0 +1,125 @@
#ifndef SPECKLE_RECORD_ELEMENT_SLAB
#define SPECKLE_RECORD_ELEMENT_SLAB
#include "Speckle/Record/Element/ModelElement.h"
#include "Speckle/Record/Element/Interface/Assembly/Segment.h"
namespace speckle::record::element {
/*!
BIM slab class
*/
class Slab : public ModelElement {
public:
// MARK: - Types
using base = ModelElement;
///Unique pointer
using Unique = std::unique_ptr<Slab>;
///Shared pointer
using Shared = std::shared_ptr<Slab>;
///Optional
using Option = std::optional<Slab>;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
Slab();
#ifdef ARCHICAD
/*!
Constructor
@param elemData Archicad element data
@param tableID The element table ID (AC database, e.g. floor plan, 3D)
*/
Slab(const API_Element& elemData, const speckle::utility::Guid& tableID);
#endif
/*!
Copy constructor
@param source The object to copy
*/
Slab(const Slab& source);
/*!
Move constructor
@param source The object to move
*/
Slab(Slab&& source) noexcept;
/*!
Destructor
*/
~Slab();
/*!
Object cloning
@return A clone of this object
*/
Slab* clonePtr() const override { return new Slab{*this}; }
// MARK: - Functions (const)
/*!
Get the composition of materials in the element
@return The material composition (element with ordered material composition should override)
*/
Composition getComposition() const override;
/*!
Get the element material (applicable to elements with a single, homogenous material)
@return The element material (nullopt if not applicable to the element)
*/
std::optional<record::attribute::Material> getMaterial() const override;
/*!
Get a spatial measurement from this element (area/volume, as used for material quantities)
@return The element measurement (empty if unavailable)
*/
SpatialMeasure getSpatialMeasure() const override;
#ifdef ARCHICAD
/*!
Get the (immutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
const API_Elem_Head& getHead() const override;
#endif
// MARK: - Functions (mutating)
#ifdef ARCHICAD
/*!
Get the (mutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
API_Elem_Head& getHead() override;
#endif
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
private:
class Data;
///The beam data
std::unique_ptr<Data> m_data;
};
}
#endif //SPECKLE_RECORD_ELEMENT_SLAB
+176
View File
@@ -0,0 +1,176 @@
#include "Speckle/Record/Element/Wall.h"
#include "Speckle/Record/Element/Quants/Surveyor.h"
#include "Speckle/Record/Element/Setting/Conversion.h"
#include "Speckle/Utility/BIMMemory.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::serialise;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
using namespace speckle::record::element::quants;
using namespace speckle::utility;
#include <array>
#include <memory>
namespace speckle::record::element {
class Wall::Data {
public:
friend class Wall;
#ifdef ARCHICAD
Data(const API_WallType& seg) : root{seg} {}
private:
API_WallType root;
#endif
};
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Wall::Wall() {
} //Wall::Wall
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Constructor
elemData: Archicad element data
tableID: The element table ID (AC database, e.g. floor plan, 3D)
--------------------------------------------------------------------*/
Wall::Wall(const API_Element& elemData, const speckle::utility::Guid& tableID) : base{ elemData.header.guid, tableID } {
m_data = std::make_unique<Data>(elemData.wall);
} //Wall::Wall
#endif
/*--------------------------------------------------------------------
Copy constructor
source: The object to copy
--------------------------------------------------------------------*/
Wall::Wall(const Wall& source) : base{ source } {
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
} //Wall::Wall
/*--------------------------------------------------------------------
Move constructor
source: The object to move
--------------------------------------------------------------------*/
Wall::Wall(Wall&& source) noexcept : base{source} {
m_data = std::move(source.m_data);
} //Wall::Wall
/*--------------------------------------------------------------------
Destructor
--------------------------------------------------------------------*/
Wall::~Wall() {}
/*--------------------------------------------------------------------
Get the composition of materials in the element
return: The material composition (element with ordered material composition should override)
--------------------------------------------------------------------*/
ModelElement::Composition Wall::getComposition() const {
#ifdef ARCHICAD
return convert(m_data->root.modelElemStructureType);
#endif
} //Wall::getComposition
/*--------------------------------------------------------------------
Get the element material (applicable to elements with a single, homogenous material)
return: The element material (nullopt if not applicable to the element)
--------------------------------------------------------------------*/
std::optional<Material> Wall::getMaterial() const {
#ifdef ARCHICAD
return Material{Guid{Guid::fromInt(m_data->root.buildingMaterial.GenerateHashValue())}};
#endif
} //Wall::getMaterial
/*--------------------------------------------------------------------
Get a spatial measurement from this element (area/volume, as used for material quantities)
return: The element measurement (empty if unavailable)
--------------------------------------------------------------------*/
ModelElement::SpatialMeasure Wall::getSpatialMeasure() const {
#ifdef ARCHICAD
Surveyor surveyor;
BIMMemory::setMask(&surveyor.elementMask().wall.surface1);
BIMMemory::setMask(&surveyor.elementMask().wall.volume);
surveyor.measure(getBIMLink());
return SpatialMeasure{surveyor.quantity().wall.surface1, surveyor.quantity().wall.volume};
#endif
} //Wall::getSpatialMeasure
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
const API_Elem_Head& Wall::getHead() const {
return m_data->root.head;
} //Wall::getHead
/*--------------------------------------------------------------------
Get the (mutable) API element header data
return: The element header data (only use this data for low-level operations - for normal code, call getters/setters)
--------------------------------------------------------------------*/
API_Elem_Head& Wall::getHead() {
return m_data->root.head;
} //Wall::getHead
#endif
/*--------------------------------------------------------------------
Fill an inventory with the package items
inventory: The inventory to receive the package items
return: True if the package has added items to the inventory
--------------------------------------------------------------------*/
bool Wall::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//TODO: Implement other fields as required
return base::fillInventory(inventory);
} //Wall::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Wall::getCargo(const Inventory::Item& item) const {
//TODO: Implement other fields as required
return base::getCargo(item);
} //Wall::getCargo
/*--------------------------------------------------------------------
Set to the default package content
--------------------------------------------------------------------*/
void Wall::setDefault() {
m_data.reset();
} //Wall::setDefault
+125
View File
@@ -0,0 +1,125 @@
#ifndef SPECKLE_RECORD_ELEMENT_WALL
#define SPECKLE_RECORD_ELEMENT_WALL
#include "Speckle/Record/Element/ModelElement.h"
#include "Speckle/Record/Element/Interface/Assembly/Segment.h"
namespace speckle::record::element {
/*!
BIM wall class
*/
class Wall : public ModelElement {
public:
// MARK: - Types
using base = ModelElement;
///Unique pointer
using Unique = std::unique_ptr<Wall>;
///Shared pointer
using Shared = std::shared_ptr<Wall>;
///Optional
using Option = std::optional<Wall>;
// MARK: - Constructors
using base::base;
/*!
Default constructor
*/
Wall();
#ifdef ARCHICAD
/*!
Constructor
@param elemData Archicad element data
@param tableID The element table ID (AC database, e.g. floor plan, 3D)
*/
Wall(const API_Element& elemData, const speckle::utility::Guid& tableID);
#endif
/*!
Copy constructor
@param source The object to copy
*/
Wall(const Wall& source);
/*!
Move constructor
@param source The object to move
*/
Wall(Wall&& source) noexcept;
/*!
Destructor
*/
~Wall();
/*!
Object cloning
@return A clone of this object
*/
Wall* clonePtr() const override { return new Wall{*this}; }
// MARK: - Functions (const)
/*!
Get the composition of materials in the element
@return The material composition (element with ordered material composition should override)
*/
Composition getComposition() const override;
/*!
Get the element material (applicable to elements with a single, homogenous material)
@return The element material (nullopt if not applicable to the element)
*/
std::optional<record::attribute::Material> getMaterial() const override;
/*!
Get a spatial measurement from this element (area/volume, as used for material quantities)
@return The element measurement (empty if unavailable)
*/
SpatialMeasure getSpatialMeasure() const override;
#ifdef ARCHICAD
/*!
Get the (immutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
const API_Elem_Head& getHead() const override;
#endif
// MARK: - Functions (mutating)
#ifdef ARCHICAD
/*!
Get the (mutable) API element header data
@return The element header data (only use this data for low-level operations - for normal code, call getters/setters)
*/
API_Elem_Head& getHead() override;
#endif
// MARK: - Serialisation
/*!
Fill an inventory with the package items
@param inventory The inventory to receive the package items
@return True if the package has added items to the inventory
*/
bool fillInventory(active::serialise::Inventory& inventory) const override;
/*!
Get the specified cargo
@param item The inventory item to retrieve
@return The requested cargo (nullptr on failure)
*/
Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Set to the default package content
*/
void setDefault() override;
private:
class Data;
///The beam data
std::unique_ptr<Data> m_data;
};
}
#endif //SPECKLE_RECORD_ELEMENT_WALL
@@ -31,6 +31,18 @@
21384BF82CD50CD400D4602B /* TypeSetting.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BF62CD50CD400D4602B /* TypeSetting.h */; };
21384BFA2CD51B6F00D4602B /* TypeSetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BF92CD51B6F00D4602B /* TypeSetting.cpp */; };
21384BFC2CD52C7500D4602B /* Conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BFB2CD52C7500D4602B /* Conversion.h */; };
21384BFF2CD558D100D4602B /* Slab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BFD2CD558D000D4602B /* Slab.cpp */; };
21384C002CD558D100D4602B /* Slab.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BFE2CD558D000D4602B /* Slab.h */; };
21384C032CD57CA500D4602B /* Wall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384C012CD57CA500D4602B /* Wall.cpp */; };
21384C042CD57CA500D4602B /* Wall.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384C022CD57CA500D4602B /* Wall.h */; };
21384C072CD57EE600D4602B /* Mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384C052CD57EE600D4602B /* Mesh.cpp */; };
21384C082CD57EE600D4602B /* Mesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384C062CD57EE600D4602B /* Mesh.h */; };
21384C182CD585A600D4602B /* Roof.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384C162CD585A600D4602B /* Roof.cpp */; };
21384C192CD585A600D4602B /* Roof.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384C172CD585A600D4602B /* Roof.h */; };
21384C1C2CD586D800D4602B /* Morph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384C1A2CD586D800D4602B /* Morph.cpp */; };
21384C1D2CD586D800D4602B /* Morph.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384C1B2CD586D800D4602B /* Morph.h */; };
21384C202CD5880400D4602B /* Shell.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384C1E2CD5880400D4602B /* Shell.h */; };
21384C212CD5880400D4602B /* Shell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384C1F2CD5880400D4602B /* Shell.cpp */; };
215F08552C99DA8D00CD343B /* Project.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 215F08512C99DA8D00CD343B /* Project.cpp */; };
215F08562C99DA8D00CD343B /* Project.h in Headers */ = {isa = PBXBuildFile; fileRef = 215F08542C99DA8D00CD343B /* Project.h */; };
215F08662C9B006800CD343B /* ProjectEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 215F08652C9B006700CD343B /* ProjectEvent.cpp */; };
@@ -228,6 +240,18 @@
21384BF62CD50CD400D4602B /* TypeSetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeSetting.h; sourceTree = "<group>"; };
21384BF92CD51B6F00D4602B /* TypeSetting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypeSetting.cpp; sourceTree = "<group>"; };
21384BFB2CD52C7500D4602B /* Conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Conversion.h; sourceTree = "<group>"; };
21384BFD2CD558D000D4602B /* Slab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slab.cpp; sourceTree = "<group>"; };
21384BFE2CD558D000D4602B /* Slab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slab.h; sourceTree = "<group>"; };
21384C012CD57CA500D4602B /* Wall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Wall.cpp; sourceTree = "<group>"; };
21384C022CD57CA500D4602B /* Wall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Wall.h; sourceTree = "<group>"; };
21384C052CD57EE600D4602B /* Mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mesh.cpp; path = Speckle/Record/Element/Mesh.cpp; sourceTree = SOURCE_ROOT; };
21384C062CD57EE600D4602B /* Mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mesh.h; path = Speckle/Record/Element/Mesh.h; sourceTree = SOURCE_ROOT; };
21384C162CD585A600D4602B /* Roof.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Roof.cpp; sourceTree = "<group>"; };
21384C172CD585A600D4602B /* Roof.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Roof.h; sourceTree = "<group>"; };
21384C1A2CD586D800D4602B /* Morph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Morph.cpp; sourceTree = "<group>"; };
21384C1B2CD586D800D4602B /* Morph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Morph.h; sourceTree = "<group>"; };
21384C1E2CD5880400D4602B /* Shell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shell.h; sourceTree = "<group>"; };
21384C1F2CD5880400D4602B /* Shell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Shell.cpp; sourceTree = "<group>"; };
214EA4C52BA374FD008E5358 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
214EA4C62BA3762D008E5358 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = SOURCE_ROOT; };
215F08512C99DA8D00CD343B /* Project.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Project.cpp; sourceTree = "<group>"; };
@@ -530,10 +554,22 @@
21A0FBE72CBD6B1A0023F24E /* Interface */,
21A0FBF32CBD6B700023F24E /* Memo.cpp */,
21A0FBF22CBD6B700023F24E /* Memo.h */,
21384C052CD57EE600D4602B /* Mesh.cpp */,
21384C062CD57EE600D4602B /* Mesh.h */,
21A0FC0C2CBE92F10023F24E /* ModelElement.cpp */,
21A0FC0D2CBE92F10023F24E /* ModelElement.h */,
21384C1A2CD586D800D4602B /* Morph.cpp */,
21384C1B2CD586D800D4602B /* Morph.h */,
21384BE52CD3DD6200D4602B /* Quants */,
21384C162CD585A600D4602B /* Roof.cpp */,
21384C172CD585A600D4602B /* Roof.h */,
21384BF72CD50CD400D4602B /* Setting */,
21384C1F2CD5880400D4602B /* Shell.cpp */,
21384C1E2CD5880400D4602B /* Shell.h */,
21384BFD2CD558D000D4602B /* Slab.cpp */,
21384BFE2CD558D000D4602B /* Slab.h */,
21384C012CD57CA500D4602B /* Wall.cpp */,
21384C022CD57CA500D4602B /* Wall.h */,
);
path = Element;
sourceTree = "<group>";
@@ -986,6 +1022,7 @@
21A0FBF42CBD6B700023F24E /* Memo.h in Headers */,
215F088C2CA195EC00CD343B /* ArchicadDBaseCore.h in Headers */,
21AE19AD2CC8F214004DBCFC /* SegmentedBeam.h in Headers */,
21384C1D2CD586D800D4602B /* Morph.h in Headers */,
21D0BDE72C943D3F0077E104 /* RecordID.h in Headers */,
21D0BD212C86F0280077E104 /* AccountDatabase.h in Headers */,
21A0FBB52CBA5E380023F24E /* Str256.h in Headers */,
@@ -1011,10 +1048,12 @@
21AE19662CC2F702004DBCFC /* BIMPropertyDatabase.h in Headers */,
21A0FC072CBE59A80023F24E /* Path.h in Headers */,
21A0FBA42CB880690023F24E /* FinishCollector.h in Headers */,
21384C192CD585A600D4602B /* Roof.h in Headers */,
21AE19802CC7D265004DBCFC /* PropertiedWrapper.h in Headers */,
21A0FC0B2CBE5E220023F24E /* Segment.h in Headers */,
215F088D2CA195EC00CD343B /* ArchicadElementDBaseEngine.h in Headers */,
21384BC82CD24ADC00D4602B /* ElementEvent.h in Headers */,
21384C202CD5880400D4602B /* Shell.h in Headers */,
2196F2F42CB483D600450DFC /* Finish.h in Headers */,
21A0FBED2CBD6B1A0023F24E /* Part.h in Headers */,
21B67D002C7CE15100FD64FC /* Exception.h in Headers */,
@@ -1031,12 +1070,14 @@
21AE198F2CC80541004DBCFC /* ArchicadGroupDBaseEngine.h in Headers */,
21D0BD4D2C8901A00077E104 /* ServerInfo.h in Headers */,
2196F3042CB57E8000450DFC /* Storey.h in Headers */,
21384C042CD57CA500D4602B /* Wall.h in Headers */,
21AE196F2CC64D37004DBCFC /* Classified.h in Headers */,
21AE19522CC273F1004DBCFC /* Property.h in Headers */,
21A0FBF92CBDB9A70023F24E /* BIMMemory.h in Headers */,
21AE19AA2CC8F1F8004DBCFC /* BeamSegment.h in Headers */,
21384BF12CD3F3A500D4602B /* MaterialWrap.h in Headers */,
21AE19942CC82866004DBCFC /* BIMGroupDatabase.h in Headers */,
21384C082CD57EE600D4602B /* Mesh.h in Headers */,
21AE19542CC273F1004DBCFC /* Template.h in Headers */,
21A0FBBC2CBBC04C0023F24E /* ArchicadRGB.h in Headers */,
21384BFC2CD52C7500D4602B /* Conversion.h in Headers */,
@@ -1046,6 +1087,7 @@
21D0BDB52C8F8AB60077E104 /* DocumentStoreEngine.h in Headers */,
21384BE92CD3DD6200D4602B /* MaterialQuantity.h in Headers */,
21A890D02CC1B87C0087E732 /* GenericModelElement.h in Headers */,
21384C002CD558D100D4602B /* Slab.h in Headers */,
21A890C52CC171D80087E732 /* ArchicadPropertyDBaseEngine.h in Headers */,
21384BAB2CCDA9B400D4602B /* Host.h in Headers */,
21384BF82CD50CD400D4602B /* TypeSetting.h in Headers */,
@@ -1188,6 +1230,7 @@
215F088B2CA195EC00CD343B /* ArchicadDBaseCore.cpp in Sources */,
2193517B2C624FC100E5A69C /* MenuSubscriber.cpp in Sources */,
2196F2F02CB4823C00450DFC /* Attribute.cpp in Sources */,
21384C032CD57CA500D4602B /* Wall.cpp in Sources */,
21F69F612C6D0286008B6A06 /* GetBindingsMethodNames.cpp in Sources */,
215F08662C9B006800CD343B /* ProjectEvent.cpp in Sources */,
21AE19932CC82866004DBCFC /* BIMGroupDatabase.cpp in Sources */,
@@ -1205,11 +1248,13 @@
21384BED2CD3EBE200D4602B /* Material.cpp in Sources */,
21B67D0E2C7E0E8D00FD64FC /* ErrorReport.cpp in Sources */,
21AE19902CC80541004DBCFC /* ArchicadGroupDBaseEngine.cpp in Sources */,
21384C072CD57EE600D4602B /* Mesh.cpp in Sources */,
21AE19692CC57832004DBCFC /* Propertied.cpp in Sources */,
21F69F7E2C6FD9FC008B6A06 /* GetCallResult.cpp in Sources */,
2196F3052CB57E8000450DFC /* Storey.cpp in Sources */,
219245FE2CA2CC4300CF5703 /* BIMRecord.cpp in Sources */,
21AE19572CC27DB3004DBCFC /* Value.cpp in Sources */,
21384BFF2CD558D100D4602B /* Slab.cpp in Sources */,
21AE19A82CC8F1F8004DBCFC /* BeamSegment.cpp in Sources */,
21AEF9BE2CA6FDA4000B8681 /* DetachedWrap.cpp in Sources */,
21A0FC062CBE59A80023F24E /* Path.cpp in Sources */,
@@ -1239,10 +1284,12 @@
219351B12C62CC1A00E5A69C /* Guid.cpp in Sources */,
21F69F512C6CCC25008B6A06 /* BrowserBridge.cpp in Sources */,
21A0FC112CBEE5C30023F24E /* Part.cpp in Sources */,
21384C212CD5880400D4602B /* Shell.cpp in Sources */,
21A890D12CC1B87C0087E732 /* GenericModelElement.cpp in Sources */,
21AEF9BC2CA6DF84000B8681 /* DetachmentManager.cpp in Sources */,
215F08552C99DA8D00CD343B /* Project.cpp in Sources */,
21AE19882CC7FF5F004DBCFC /* Group.cpp in Sources */,
21384C182CD585A600D4602B /* Roof.cpp in Sources */,
21F69F3B2C6B880C008B6A06 /* JSBaseTransport.cpp in Sources */,
21384BC52CD24AB200D4602B /* ElementSubscriber.cpp in Sources */,
21384BF42CD4D65700D4602B /* Surveyor.cpp in Sources */,
@@ -1256,6 +1303,7 @@
21F69F962C71087A008B6A06 /* Account.cpp in Sources */,
21A0FBF82CBDB9A70023F24E /* BIMMemory.cpp in Sources */,
21A0FBF52CBD6B700023F24E /* Memo.cpp in Sources */,
21384C1C2CD586D800D4602B /* Morph.cpp in Sources */,
21AEF9BA2CA606B5000B8681 /* DetachedReference.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;