Compare commits

...

6 Commits

Author SHA1 Message Date
Ralph Wessel 0420001239 Updated Primitive3D and associated classes 2024-10-31 09:47:40 +00:00
David Kekesi 519869e705 WIP, does not build - added Primitive3D, Primitive3DMover Polyline 2024-10-30 18:37:58 +01:00
Ralph Wessel ca2df4c020 Finish assignment operator did not call assignment operator for bae class 2024-10-30 12:38:20 +00:00
Ralph Wessel 764b548900 Updated VS projects 2024-10-30 11:48:54 +00:00
Ralph Wessel 71dac48830 Updated Xcode project
Implemented caching to avoid slow API material lookup
Some minor fixes
Eliminated some warnings
2024-10-30 11:47:48 +00:00
Ralph Wessel 5684364119 Merge pull request #14 from specklesystems/david/cnx-693-archicad-missing-elements
cnx 693 archicad missing elements
2024-10-30 10:25:18 +00:00
25 changed files with 606 additions and 145 deletions
@@ -48,6 +48,7 @@ SendBridge::SendBridge() : BrowserBridge{"sendBinding"} {
#endif
} //SendBridge::SendBridge
/*--------------------------------------------------------------------
Handle an element change
@@ -56,23 +57,20 @@ SendBridge::SendBridge() : BrowserBridge{"sendBinding"} {
return: True if the event should be closed
--------------------------------------------------------------------*/
bool SendBridge::handle(const ElementEvent& event) {
using enum ElementEvent::Type;
auto eventType = event.getEventType();
switch (eventType)
{
case ElementEvent::EventType::Begin: {
switch (eventType) {
case begin:
m_changedElements.clear();
} break;
case ElementEvent::EventType::End: {
break;
case end: {
auto modelCardDatabase = connector()->getModelCardDatabase();
auto modelCards = modelCardDatabase->getCards();
// POC: this is probably not efficient, should test, review and refactor it
RecordIDList expiredModelCardIds;
for (const auto& modelCard : modelCards) {
if (auto senderCard = dynamic_cast<SenderModelCard*>(modelCard.get())) {
auto modelCardSelection = senderCard->getFilter().getElementIDs();
for (const auto& elemId : modelCardSelection) {
if (std::find(m_changedElements.begin(), m_changedElements.end(), elemId) != m_changedElements.end()) {
expiredModelCardIds.push_back(modelCard->getID());
@@ -81,18 +79,17 @@ bool SendBridge::handle(const ElementEvent& event) {
}
}
}
if (!expiredModelCardIds.empty()) {
auto wrapped = std::make_unique<CargoHold<ContainerWrap<RecordIDList>, RecordIDList>>(std::move(expiredModelCardIds));
sendEvent("setModelsExpired", std::move(wrapped));
}
} break;
case ElementEvent::EventType::Change:
case ElementEvent::EventType::Edit:
case ElementEvent::EventType::Delete: {
auto changedElement = event.getChangedElement();
m_changedElements.push_back(changedElement);
} break;
break;
}
case changeElem: case editElem: case deleteElem: {
if (event.getElmentID())
m_changedElements.push_back(*event.getElmentID());
break;
}
default:
break;
}
@@ -9,6 +9,7 @@
#include "Connector/Record/Collection/FinishProxy.h"
#include "Speckle/Database/BIMAttributeDatabase.h"
#include "Speckle/Database/BIMElementDatabase.h"
#include "Speckle/Record/Attribute/Finish.h"
#include "Speckle/Record/Element/Element.h"
#ifdef ARCHICAD
@@ -24,7 +25,7 @@ using namespace speckle::utility;
#ifdef ARCHICAD
namespace connector::record {
class ProjectCollection::FinishCache : public std::unordered_map<active::utility::Guid, Finish::Unique> {};
class ProjectCollection::FinishCache : public std::unordered_map<active::utility::Guid, Finish> {};
}
#endif
@@ -131,14 +132,11 @@ bool ProjectCollection::addMaterialProxy(const speckle::database::BIMIndex& mate
return: True if the material proxy was added (false typically means the record already exists)
--------------------------------------------------------------------*/
bool ProjectCollection::addMaterialProxy(const ModelerAPI::Material& material, const speckle::database::BIMRecordID& objectID) {
auto finishID = Guid::fromInt(material.GenerateHashValue());
auto iter = m_finishes->find(finishID);
if (iter == m_finishes->end()) {
auto finish = std::make_unique<Finish>(material);
iter = m_finishes->insert({ finishID, std::move(finish) }).first;
}
return addMaterialProxy(finishID, objectID);
bool ProjectCollection::addMaterialProxy(const Finish& finish, const speckle::database::BIMRecordID& objectID) {
auto iter = m_finishes->find(finish.getBIMID());
if (iter == m_finishes->end())
iter = m_finishes->insert({finish.getBIMID(), finish}).first;
return addMaterialProxy(speckle::database::BIMIndex{finish.getBIMID()}, objectID);
} //ProjectCollection::addMaterialProxy
#endif
@@ -181,7 +179,7 @@ Cargo::Unique ProjectCollection::getCargo(const Inventory::Item& item) const {
std::advance(iter, item.available);
const Finish* finish = nullptr;
if (auto fin = m_finishes->find(iter->first); fin != m_finishes->end())
finish = fin->second.get();
finish = &fin->second;
else if (auto attribute = m_project->getAttributeDatabase()->getAttribute(iter->first, iter->first.tableID); attribute)
finish = dynamic_cast<const Finish*>(attribute.get());
if (finish != nullptr) {
@@ -70,15 +70,13 @@ namespace connector::record {
@return True if the material proxy was added (false typically means the record already exists)
*/
bool addMaterialProxy(const speckle::database::BIMIndex& materialIndex, const speckle::database::BIMRecordID& objectID) override;
#ifdef ARCHICAD
/*!
Add a ModelerAPI material to the collection (NB: These are not persistent so need to be captured by this method)
@param material A material
@param finish A finish
@param objectID The object the material is applied to
@return True if the material proxy was added (false typically means the record already exists)
*/
bool addMaterialProxy(const ModelerAPI::Material& material, const speckle::database::BIMRecordID& objectID) override;
#endif
bool addMaterialProxy(const speckle::record::attribute::Finish& finish, const speckle::database::BIMRecordID& objectID) override;
// MARK: - Serialisation
@@ -101,11 +99,9 @@ namespace connector::record {
std::unique_ptr<active::serialise::Management> m_management;
///Finish proxies accumulated from meshes generated from the collection elements
FinishProxies m_finishProxies;
#ifdef ARCHICAD
class FinishCache;
///Finishes cached from ModelerAPI materials
std::unique_ptr<FinishCache> m_finishes;
#endif
};
}
@@ -128,7 +128,7 @@ BIMLinkList ArchicadElementDBaseEngine::getSelection() const {
--------------------------------------------------------------------*/
void ArchicadElementDBaseEngine::setSelection(const BIMLinkList& elementIDs) const {
GS::Array<API_Neig> selNeigs;
for (const auto elemID : elementIDs) {
for (const auto& elemID : elementIDs) {
API_Neig neig(elemID);
selNeigs.Push(neig);
}
+2 -1
View File
@@ -77,6 +77,7 @@ std::weak_ptr<Project> Addon::getActiveProject() const {
void Addon::publishExternal(const active::event::Event& event) {
if (!logCallback())
return;
++m_sessionCount;
try {
preprocessEvent(event);
publish(event);
@@ -165,7 +166,7 @@ bool Addon::logCallback(bool initialise) {
return false;
}
return true;
} //Addon::publishExternalEvent
} //Addon::logCallback
/*--------------------------------------------------------------------
+7
View File
@@ -41,6 +41,11 @@ namespace speckle::environment {
@return The active project (nullptr = no open project)
*/
std::weak_ptr<Project> getActiveProject() const;
/*!
Get the session index
@return The session index (non-recursive entries into the add-on)
*/
uint32_t getSession() const { return m_sessionCount; }
// MARK: - Functions (mutating)
@@ -103,6 +108,8 @@ namespace speckle::environment {
std::shared_ptr<Project> m_activeProject;
///The depth of nested callbacks - the root call starts at depth 0 (important for some entry-point initialisation)
uint32_t m_callDepth = 0;
///The index of the active session (non-recursive entries into the add-on)
uint32_t m_sessionCount = 0;
};
@@ -16,6 +16,8 @@ using namespace speckle::event;
namespace {
using enum ElementEvent::Type;
#ifdef ARCHICAD
/*!
Callback for an Archicad element change
@@ -30,22 +32,22 @@ namespace {
{
case APINotifyElement_New: {
ACAPI_Element_AttachObserver(elemType->elemHead.guid);
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::New });
addon()->publishExternal(ElementEvent{newElem, ElementID{elemType->elemHead.guid}});
} break;
case APINotifyElement_Change: {
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::Change });
addon()->publishExternal(ElementEvent{changeElem, ElementID{elemType->elemHead.guid}});
} break;
case APINotifyElement_Edit: {
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::Edit });
addon()->publishExternal(ElementEvent{editElem, ElementID{elemType->elemHead.guid}});
} break;
case APINotifyElement_Delete: {
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::Delete });
addon()->publishExternal(ElementEvent{deleteElem, ElementID{ elemType->elemHead.guid}});
} break;
case APINotifyElement_BeginEvents:
addon()->publishExternal(ElementEvent{ ElementID{}, ElementEvent::EventType::Begin });
addon()->publishExternal(ElementEvent{begin});
break;
case APINotifyElement_EndEvents: {
addon()->publishExternal(ElementEvent{ ElementID{}, ElementEvent::EventType::End });
addon()->publishExternal(ElementEvent{end});
} break;
default:
break;
+21 -16
View File
@@ -9,23 +9,31 @@
namespace speckle::event {
/*!
Class representing a selection change event
Class representing an event signaling a database transaction operating on a BIM element, e.g. adding, editing, deleting etc
*/
class ElementEvent : public active::event::Event {
public:
enum EventType { New, Begin, End, Change, Edit, Delete };
enum Type {
newElem, ///<A new element has been created
begin, ///<An element database transaction has started - subsequent events will detail specific actions
end, ///<The current element database transaction has ended - any handling based on the transaction events should be fone now
changeElem, ///<An element has been changed
editElem, ///<An element has been edited
deleteElem ///<An element has been deleted
};
static const inline active::utility::NameID ID{active::utility::String{"element change"},
static const inline active::utility::NameID ID{active::utility::String{"element transaction"},
active::utility::Guid{active::utility::String{"ac9366d5-90fd-497e-b7f7-a7b4c8d97c91"}}};
// MARK: - Constructors
/*!
Constructor
@param selected A link to a selected element (nullopt if the selection is empty)
@param eventType An event type identifier
@param targetID The ID of the element targeted by the database transaction (nullopt = undefined, e.g. for a begin/end event)
*/
ElementEvent(speckle::database::ElementID changed, EventType eventType) : Event{ ID }, m_changedElement{ changed }, m_eventType{ eventType } {}
ElementEvent(Type eventType, database::ElementID::Option targetID = std::nullopt) : Event{ID}, m_elementID{targetID}, m_eventType{eventType} {}
/*!
Copy constructor
@param source The object to copy
@@ -39,20 +47,17 @@ namespace speckle::event {
// MARK: - Functions (const)
/*!
Determine if the event selection is empty
@return True if the event selection is empty
Get the ID of the database transaction target element
@return The target element ID (nullopt = no target, e.g. a begin/end event)
*/
bool empty() const { return m_changedElement.empty(); }
/*!
Get a link to the last selected element
@return A link to the last selected element (nullopt if the event selection is empty)
*/
speckle::database::ElementID getChangedElement() const { return m_changedElement; }
EventType getEventType() const { return m_eventType; }
database::ElementID::Option getElmentID() const { return m_elementID; }
Type getEventType() const { return m_eventType; }
private:
speckle::database::ElementID m_changedElement;
EventType m_eventType;
///The ID of the target element (nullopt = undefined)
database::ElementID::Option m_elementID;
///The specific database operation performed
Type m_eventType;
};
}
@@ -4,6 +4,7 @@
#include "Active/Serialise/JSON/JSONTransport.h"
#include "Active/Utility/BufferOut.h"
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
#include "Speckle/Record/Element/ModelElement.h"
#include <utility>
@@ -45,5 +46,6 @@ std::unique_ptr<WrappedResultArg> GetCallResult::getResult(const WrappedResultAr
return nullptr;
String jsonOutput;
JSONTransport().send(std::forward<Cargo&&>(*item), Identity{}, jsonOutput);
record::element::ModelElement::resetCache();
return std::make_unique<WrappedResultArg>(jsonOutput);
} //GetCallResult::getResult
+1 -1
View File
@@ -98,6 +98,6 @@ void Mesh::useManagement(Management* management) const {
//NB: This object only exists to populate the finish collection - it doesn't carry any serialisable content
if (management != nullptr) {
if (auto collector = management->get<FinishCollector>(); collector != nullptr)
collector->addMaterialProxy(m_material, getBIMID());
collector->addMaterialProxy(m_finish, getBIMID());
}
} //Mesh::useManagement
+21 -19
View File
@@ -1,24 +1,22 @@
#ifndef SPECKLE_PRIMITIVE_MESH
#define SPECKLE_PRIMITIVE_MESH
#include "Speckle/Primitive/Primitive3D.h"
#include "Speckle/Database/Content/BIMRecord.h"
#include "Speckle/Utility/String.h"
#ifdef ARCHICAD
#include "ModelMaterial.hpp"
#endif
#include "Speckle/Record/Attribute/Finish.h"
namespace speckle::primitive {
/*!
Class for a 3D mesh
*/
class Mesh : public speckle::database::BIMRecord {
class Mesh : public Primitive3D {
public:
// MARK: - Types
using base = speckle::database::BIMRecord;
using base = Primitive3D;
// MARK: - Constructors
@@ -26,27 +24,33 @@ namespace speckle::primitive {
Default constructor
@param unit The mesh unit type
*/
Mesh(active::measure::LengthType unit = active::measure::LengthType::metre) : base{utility::Guid{true}, utility::Guid{}, unit} {}
Mesh(active::measure::LengthType unit = active::measure::LengthType::metre) : base{ utility::Guid{true}, utility::Guid{}, unit } {}
/*!
Constructor
@param unit The mesh unit type
@param material The mesh material
@param finish The mesh finish
*/
Mesh(const ModelerAPI::Material& material,
Mesh(const record::attribute::Finish& finish,
active::measure::LengthType unit = active::measure::LengthType::metre) :
base{ utility::Guid{true}, utility::Guid{}, unit }, m_material{ material } {}
base{ utility::Guid{true}, utility::Guid{}, unit }, m_finish{ finish } {}
/*!
Constructor
@param unit The mesh unit type
@param vertices The mesh vertices
@param faces The mesh faces (the number of indices in the face followed by the vertex indices)
@param colors The mesh face colours
@param material The mesh material
@param finish The mesh material
@param unit The mesh unit type
*/
Mesh(std::vector<double>&& vertices, std::vector<int>&& faces, std::vector<int>&& colors, const ModelerAPI::Material& material,
active::measure::LengthType unit = active::measure::LengthType::metre) :
base{utility::Guid{true}, utility::Guid{}, unit}, m_vertices{std::move(vertices)}, m_faces{std::move(faces)}, m_colors{std::move(colors)}, m_material{material} {}
Mesh(std::vector<double>&& vertices, std::vector<int>&& faces, std::vector<int>&& colors, const record::attribute::Finish& finish,
active::measure::LengthType unit = active::measure::LengthType::metre) :
base{ utility::Guid{true}, utility::Guid{}, unit }, m_vertices{ std::move(vertices) }, m_faces{ std::move(faces) }, m_colors{ std::move(colors) }, m_finish{ finish } {}
/*!
Object cloning
@return A clone of this object
*/
virtual Mesh* clonePtr() const override { return new Mesh{*this}; }
// MARK: - Functions (const)
/*!
@@ -85,9 +89,7 @@ namespace speckle::primitive {
std::vector<double> m_vertices;
std::vector<int> m_faces;
std::vector<int> m_colors;
#ifdef ARCHICAD
ModelerAPI::Material m_material;
#endif
record::attribute::Finish m_finish;
};
}
@@ -0,0 +1,73 @@
#include "Speckle/Primitive/Polyline/Polyline.h"
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Active/Serialise/Inventory/Identity.h"
#include "Speckle/Serialise/Collection/FinishProxy.h"
#include <array>
using namespace active::serialise;
using namespace speckle::primitive;
using namespace speckle::serialise;
namespace {
///Serialisation fields
enum FieldIndex {
pointsID,
};
///Serialisation field IDs
static std::array fieldID = {
Identity{"values"},
};
}
/*--------------------------------------------------------------------
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 Polyline::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
inventory.merge(Inventory{
{
{ fieldID[pointsID], pointsID, element },
},
}.withType(&typeid(Polyline)));
return base::fillInventory(inventory);
} //Polyline::fillInventory
/*--------------------------------------------------------------------
Get the specified cargo
item: The inventory item to retrieve
return: The requested cargo (nullptr on failure)
--------------------------------------------------------------------*/
Cargo::Unique Polyline::getCargo(const Inventory::Item& item) const {
if (item.ownerType != &typeid(Polyline))
return base::getCargo(item);
using namespace active::serialise;
switch (item.index) {
case pointsID:
return std::make_unique<ContainerWrap<std::vector<double>>>(m_points);
default:
return nullptr; //Requested an unknown index
}
} //Polyline::getCargo
/*--------------------------------------------------------------------
Use a manager in (de)serialisation processes
management: The management to use
--------------------------------------------------------------------*/
void Polyline::useManagement(Management* management) const {
} //Polyline::useManagement
@@ -0,0 +1,74 @@
#ifndef SPECKLE_PRIMITIVE_POLYLINE
#define SPECKLE_PRIMITIVE_POLYLINE
#include "Speckle/Primitive/Primitive3D.h"
#include "Speckle/Record/Attribute/Finish.h"
namespace speckle::primitive {
/*!
Class for a 3D polyline
*/
class Polyline : public Primitive3D {
public:
// MARK: - Types
using base = Primitive3D;
// MARK: - Constructors
/*!
Default constructor
@param unit The polyline unit type
*/
Polyline(active::measure::LengthType unit = active::measure::LengthType::metre) : base{ utility::Guid{true}, utility::Guid{}, unit } {}
/*!
Constructor
@param points The polyline vertices
@param unit The polyline unit type
*/
Polyline(std::vector<double>&& points, active::measure::LengthType unit = active::measure::LengthType::metre) :
base{ utility::Guid{true}, utility::Guid{}, unit }, m_points{ std::move(points) } {}
/*!
Object cloning
@return A clone of this object
*/
virtual Polyline* clonePtr() const override { return new Polyline{*this}; }
// MARK: - Functions (const)
/*!
Get the speckle type identifier
@return The speckle type (relevant objects should override as required)
*/
speckle::utility::String getSpeckleType() const override { return "Objects.Geometry.Polyline"; }
// 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)
*/
active::serialise::Cargo::Unique getCargo(const active::serialise::Inventory::Item& item) const override;
/*!
Use a manager in (de)serialisation processes
@param management The management to use
*/
void useManagement(active::serialise::Management* management) const override;
private:
std::vector<double> m_points;
};
}
#endif //SPECKLE_PRIMITIVE_POLYLINE
@@ -0,0 +1,39 @@
#ifndef SPECKLE_PRIMITIVE_3D
#define SPECKLE_PRIMITIVE_3D
#include "Speckle/Database/Content/BIMRecord.h"
namespace speckle::primitive {
/*!
Interface for all 3D primitives
*/
class Primitive3D : public speckle::database::BIMRecord {
public:
using base = speckle::database::BIMRecord;
/*!
Default constructor
@param unit The recordc unit type
*/
Primitive3D(active::measure::LengthType unit = active::measure::LengthType::metre) : base{unit} {}
/*!
Constructor
@param ID The record ID
@param tableID The parent table ID
@param unit The record unit type
*/
Primitive3D(const speckle::utility::Guid& ID, const speckle::utility::Guid& tableID,
std::optional<active::measure::LengthType> unit = active::measure::LengthType::metre) : base{ID, tableID, unit} {}
/*!
Object cloning
@return A clone of this object
*/
Primitive3D* clonePtr() const override = 0;
};
}
#endif //SPECKLE_PRIMITIVE_3D
@@ -0,0 +1,54 @@
#include "Speckle/Primitive/Primitive3DMover.h"
#include "Speckle/Primitive/Primitive3D.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/Primitive/Polyline/Polyline.h"
using namespace active::serialise;
using namespace speckle::primitive;
namespace {
///The tag used to identify a Speckle type name value
const char* attributeTag = "speckle_type";
///Identity for a Mesh
const char* meshTypeName = "Objects.Geometry.Mesh";
///Identity for a Polyline
const char* polylineTypeName = "Objects.Geometry.Polyline";
/*--------------------------------------------------------------------
Ensure the handler is populated
handler: The card handler to validate
return: A reference to the handler
--------------------------------------------------------------------*/
std::shared_ptr<active::serialise::Handler>& validateHandler(std::shared_ptr<active::serialise::Handler>& handler) {
if (!handler->empty())
return handler;
handler->add<speckle::primitive::Polyline>(polylineTypeName);
handler->add<Mesh>(meshTypeName);
return handler;
}
}
///The handler for 3D primitive packages
std::shared_ptr<Handler> Primitive3DMover::m_handler = std::make_shared<Handler>(attributeTag);
/*--------------------------------------------------------------------
Constructor (for deserialisation)
handler: A package handler to reconstruct incoming packages
--------------------------------------------------------------------*/
Primitive3DMover::Primitive3DMover() : Mover{validateHandler(m_handler)} {
} //CardMover::CardMover
/*--------------------------------------------------------------------
Constructor (for serialisation)
outgoing: An outgoing package
--------------------------------------------------------------------*/
Primitive3DMover::Primitive3DMover(const active::serialise::Package& outgoing) : Mover{outgoing, validateHandler(m_handler)} {
} //CardMover::CardMover
@@ -0,0 +1,36 @@
#ifndef CONNECTOR_MODEL_PRIMITIVE3D_MOVER
#define CONNECTOR_MODEL_PRIMITIVE3D_MOVER
#include "Active/Serialise/Package/Wrapper/Mover.h"
namespace speckle::primitive {
/*!
Wrapper to box/unbox 3D primitives during (de)serialisation
Primitives are polymorphic - this class ensures the type information is included when a primitive is serialised
and the correct object type is constructed on deserialisation
*/
class Primitive3DMover : public active::serialise::Mover {
public:
// MARK: - Constructors
/*!
Default constructor
*/
Primitive3DMover();
/*!
Constructor (for serialisation)
@param outgoing An outgoing package
*/
Primitive3DMover(const active::serialise::Package& outgoing);
private:
///The handler for model card packages
static std::shared_ptr<active::serialise::Handler> m_handler;
};
}
#endif //CONNECTOR_MODEL_PRIMITIVE3D_MOVER
@@ -156,6 +156,22 @@ Finish::Finish(const Finish& source) : base{source} {
Finish::~Finish() {}
/*--------------------------------------------------------------------
Assignment operator
source: The object to assign
return: A reference to this
--------------------------------------------------------------------*/
Finish& Finish::operator=(const Finish& source) {
if (this != &source) {
base::operator=(source);
m_data = source.m_data ? std::make_unique<Data>(*source.m_data) : nullptr;
}
return *this;
} //Finish::operator=
#ifdef ARCHICAD
/*--------------------------------------------------------------------
Get the (immutable) API attribute header data
+9 -1
View File
@@ -77,7 +77,15 @@ namespace speckle::record::attribute {
@return A clone of this object
*/
Finish* clonePtr() const override { return new Finish{*this}; }
// MARK: - Operators
/*!
Assignment operator
@param source The object to assign
@return A reference to this
*/
Finish& operator=(const Finish& source);
// MARK: - Functions (const)
@@ -3,6 +3,7 @@
#include "Active/Serialise/Item/Wrapper/ValueWrap.h"
#include "Active/Serialise/Package/Wrapper/PackageWrap.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Active/Container/HashMap.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Primitive/Mesh/Mesh.h"
#include "Speckle/Record/Property/Wrapper/PropertiedWrapper.h"
@@ -10,17 +11,19 @@
#include "Speckle/Utility/Guid.h"
#ifdef ARCHICAD
#include <Sight.hpp>
#include <Model.hpp>
#include <ModelMaterial.hpp>
#include <ModelElement.hpp>
#include <exp.h>
#include <ModelMeshBody.hpp>
#include <AttributeIndex.hpp>
#include <ConvexPolygon.hpp>
#include <Model.hpp>
#include <ModelElement.hpp>
#include <ModelMaterial.hpp>
#include <ModelMeshBody.hpp>
#include <Sight.hpp>
#endif
using namespace active::measure;
using namespace active::serialise;
using namespace speckle::database;
using namespace speckle::environment;
using namespace speckle::record::attribute;
using namespace speckle::record::element;
@@ -45,6 +48,39 @@ namespace speckle::record::element {
std::unique_ptr<ModelElement::Body> m_cache;
};
/*!
Cache for materials in Archicad
NB: This has been implemented because looking up materials through the API is very slow (can easily triple processing time)
This can be eliminated in future if this problem is remedied
*/
class ModelElement::FinishCache : public std::unordered_map<Guid, Finish> {
public:
using base = std::unordered_map<Guid, Finish>;
using base::base;
FinishCache() : base{} { activeSession = addon()->getSession(); }
///The active session value when the cache was created - enables the content to be reset between sessions
uint32_t activeSession = 0;
/*!
Validate the cache (ensure matches the active session)
@return True if the content is valid
*/
bool validate() {
if (activeSession != addon()->getSession()) {
m_finishCache.reset();
return false;
}
return true;
}
};
std::unique_ptr<ModelElement::FinishCache> ModelElement::m_finishCache;
}
namespace {
@@ -60,7 +96,7 @@ namespace {
Identity{"displayValue"},
Identity{"properties"},
};
#ifdef ARCHICAD
template<typename T>
void getSubElementIds(T* ptr, std::set<API_Guid>& subIds)
@@ -76,7 +112,7 @@ namespace {
elem.header.guid = elemId;
ACAPI_Element_Get(&elem);
API_ElementMemo memo{};
GSErrCode err = ACAPI_Element_GetMemo(elemId, &memo);
ACAPI_Element_GetMemo(elemId, &memo);
std::set<API_Guid> subIds{};
subIds.insert(elemId);
@@ -161,6 +197,43 @@ ModelElement::ModelElement(const ModelElement& source) : base{source}, Classifie
ModelElement::~ModelElement() {}
/*--------------------------------------------------------------------
Get mesh finish from the cache
finishID: The finish ID
return: A pointer to the requested material (nullptr on failure)
--------------------------------------------------------------------*/
Finish* ModelElement::getFinish(const Guid& finishID) {
if (!m_finishCache || !m_finishCache->validate())
return nullptr;
if (auto iter = m_finishCache->find(finishID); iter != m_finishCache->end())
return &iter->second;
return nullptr;
} //ModelElement::getFinish
/*--------------------------------------------------------------------
Add a mesh finish to the cache
finishID: The finish ID
finish: The mesh finish
--------------------------------------------------------------------*/
Finish* ModelElement::cacheFinish(const Guid& finishID, const Finish& finish) {
if (!m_finishCache || !m_finishCache->validate())
m_finishCache = std::make_unique<ModelElement::FinishCache>();
return &m_finishCache->insert({finishID, finish}).first->second;
} //ModelElement::cacheFinish
/*--------------------------------------------------------------------
Reset the Archicad material cache
--------------------------------------------------------------------*/
void ModelElement::resetCache() {
m_finishCache.reset();
} //ModelElement::resetCache
/*--------------------------------------------------------------------
Get the element body as a list of faces or Meshes
@@ -168,93 +241,74 @@ ModelElement::~ModelElement() {}
--------------------------------------------------------------------*/
ModelElement::Body* ModelElement::getBody() const {
#ifdef ARCHICAD
if (m_data && m_data->m_cache) {
if (m_data && m_data->m_cache)
return m_data->m_cache.get();
}
void* dummy = nullptr;
GSErrCode err = ACAPI_Sight_GetCurrentWindowSight(&dummy);
if (err != NoError)
{
if (err != NoError) {
// TODO: should this throw?
}
Modeler::SightPtr currentSightPtr((Modeler::Sight*)dummy); // init the shared ptr with the raw pointer
ModelerAPI::Model acModel;
Modeler::IAttributeReader* attrReader = ACAPI_Attribute_GetCurrentAttributeSetReader();
err = EXPGetModel(currentSightPtr, &acModel, attrReader);
if (err != NoError)
{
if (err != NoError) {
// TODO: should this throw?
}
auto elementBody = new ModelElement::Body();
// Map to collect meshes per material name
std::map<GS::UniString, primitive::Mesh> materialMeshMap;
auto subIds = collectSubIds(getHead().guid);
active::container::HashMap<String, primitive::Mesh> materialMeshMap;
auto subIds = collectSubIds(getHead().guid);
Int32 nElements = acModel.GetElementCount();
for (Int32 iElement = 1; iElement <= nElements; iElement++)
{
for (Int32 iElement = 1; iElement <= nElements; iElement++) {
ModelerAPI::Element elem{};
acModel.GetElement(iElement, &elem);
auto apiGuid = reinterpret_cast<const API_Guid&> (elem.GetElemGuid());
API_Guid apiGuid{GSGuid2APIGuid(elem.GetElemGuid())};
if (subIds.find(apiGuid) == subIds.end())
continue;
Int32 nBodies = elem.GetTessellatedBodyCount();
for (Int32 bodyIndex = 1; bodyIndex <= nBodies; ++bodyIndex)
{
ModelerAPI::Material material{};
for (Int32 bodyIndex = 1; bodyIndex <= nBodies; ++bodyIndex) {
ModelerAPI::MeshBody body{};
elem.GetTessellatedBody(bodyIndex, &body);
Int32 polyCount = body.GetPolygonCount();
for (Int32 polyIndex = 1; polyIndex <= polyCount; ++polyIndex)
{
for (Int32 polyIndex = 1; polyIndex <= polyCount; ++polyIndex) {
ModelerAPI::Polygon polygon{};
body.GetPolygon(polyIndex, &polygon);
ModelerAPI::Material material{};
polygon.GetMaterial(&material);
auto materialName = material.GetName();
if (materialMeshMap.find(materialName) == materialMeshMap.end()) {
materialMeshMap[materialName] = primitive::Mesh(material);
ModelerAPI::AttributeIndex attrIndex{};
polygon.GetMaterialIndex(attrIndex);
Guid finishID{Guid::fromInt(attrIndex.GetIndex())};
auto faceFinish = ModelElement::getFinish(finishID);
if (faceFinish == nullptr) {
ModelerAPI::Material material{};
polygon.GetMaterial(&material);
Finish finish{material};
faceFinish = ModelElement::cacheFinish(finishID, finish);
}
auto materialName = faceFinish->getName();
if (materialMeshMap.find(materialName) == materialMeshMap.end())
materialMeshMap[materialName] = std::make_unique<primitive::Mesh>(*faceFinish);
Int32 convexPolyCount = polygon.GetConvexPolygonCount();
for (Int32 convPolyIndex = 1; convPolyIndex <= convexPolyCount; ++convPolyIndex)
{
for (Int32 convPolyIndex = 1; convPolyIndex <= convexPolyCount; ++convPolyIndex) {
std::vector<double> vertices;
ModelerAPI::ConvexPolygon convexPolygon{};
polygon.GetConvexPolygon(convPolyIndex, &convexPolygon);
Int32 vertexCount = convexPolygon.GetVertexCount();
for (Int32 vertexIndex = 1; vertexIndex <= vertexCount; ++vertexIndex)
{
for (Int32 vertexIndex = 1; vertexIndex <= vertexCount; ++vertexIndex) {
ModelerAPI::Vertex vertex{};
body.GetVertex(convexPolygon.GetVertexIndex(vertexIndex), &vertex);
// Collect vertices (as doubles for now, but should be changed to Vertex type)
// Collect vertices (as doubles for now, but should be changed to Vertex type)
vertices.push_back(vertex.x);
vertices.push_back(vertex.y);
vertices.push_back(vertex.z);
}
materialMeshMap[materialName].appendFace(std::move(vertices));
materialMeshMap[materialName]->appendFace(std::move(vertices));
}
}
}
}
for (auto& [materialName, mesh] : materialMeshMap)
{
elementBody->push_back(std::move(mesh));
}
for (auto& mesh : materialMeshMap)
elementBody->emplace_back(std::move(mesh.second));
m_data = std::make_unique<Data>();
m_data->m_cache.reset(elementBody);
return m_data->m_cache.get();
@@ -1,11 +1,16 @@
#ifndef SPECKLE_RECORD_MODEL_ELEMENT
#define SPECKLE_RECORD_MODEL_ELEMENT
#include "Speckle/Primitive/Primitive3D.h"
#include "Speckle/Record/Classification/Classified.h"
#include "Speckle/Record/Element/Element.h"
#include "Speckle/Record/Element/Element.h"
#include "Speckle/Record/Property/Propertied.h"
namespace speckle::record::attribute {
class Finish;
}
namespace speckle::record::element {
/*!
@@ -24,8 +29,28 @@ namespace speckle::record::element {
///Optional
using Option = std::optional<ModelElement>;
///A model element 3D body primitive
using Body = std::vector<primitive::Mesh>;
using Body = active::container::Vector<speckle::primitive::Primitive3D>;
// MARK: - Constructors
/*!
Get a mesh finish from the cache
@param finishID A finish ID
@return A pointer to the requested finish (nullptr on failure)
*/
static record::attribute::Finish* getFinish(const utility::Guid& finishID);
/*!
Add a mesh finish to the cache
@param finishID A finish ID
@param finish The mesh finish
@return A pointer to the cached finish
*/
static record::attribute::Finish* cacheFinish(const utility::Guid& finishID, const record::attribute::Finish& finish);
/*!
Reset the Archicad material cache
*/
static void resetCache();
// MARK: - Constructors
using base::base;
@@ -87,6 +112,9 @@ namespace speckle::record::element {
class Data;
///The element data
mutable std::unique_ptr<Data> m_data;
class FinishCache;
///Cached finishes (API lookup is very slow)
static std::unique_ptr<FinishCache> m_finishCache;
};
}
@@ -3,11 +3,9 @@
#include "Active/Serialise/Management/Manager.h"
#ifdef ARCHICAD
namespace ModelerAPI {
class Material;
namespace speckle::record::attribute {
class Finish;
}
#endif
namespace speckle::serialise {
@@ -32,15 +30,13 @@ namespace speckle::serialise {
@return True if the material proxy was added (false typically means the record already exists)
*/
virtual bool addMaterialProxy(const speckle::database::BIMIndex& materialIndex, const speckle::database::BIMRecordID& objectID) = 0;
#ifdef ARCHICAD
/*!
Add a ModelerAPI material to the collection (NB: These are not persistent so need to be captured by this method)
@param material A material
@param finish A finish
@param objectID The object the material is applied to
@return True if the material proxy was added (false typically means the record already exists)
*/
virtual bool addMaterialProxy(const ModelerAPI::Material& material, const speckle::database::BIMRecordID& objectID) = 0;
#endif
virtual bool addMaterialProxy(const record::attribute::Finish& finish, const speckle::database::BIMRecordID& objectID) = 0;
};
}
@@ -17,6 +17,15 @@
212A88132AE48821001EAFE7 /* libArchicad27.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21379E082AE47A6400A1584C /* libArchicad27.a */; platformFilters = (macos, ); };
21384BAB2CCDA9B400D4602B /* Host.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BA92CCDA9B400D4602B /* Host.h */; };
21384BAC2CCDA9B400D4602B /* Host.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BAA2CCDA9B400D4602B /* Host.cpp */; };
21384BC52CD24AB200D4602B /* ElementSubscriber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BC12CD24AB200D4602B /* ElementSubscriber.cpp */; };
21384BC62CD24AB200D4602B /* ElementSubscriber.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BC42CD24AB200D4602B /* ElementSubscriber.h */; };
21384BC82CD24ADC00D4602B /* ElementEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BC72CD24ADC00D4602B /* ElementEvent.h */; };
21384BDA2CD37C8C00D4602B /* Polyline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BD12CD37C8C00D4602B /* Polyline.cpp */; };
21384BDB2CD37C8C00D4602B /* Polyline.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BD22CD37C8C00D4602B /* Polyline.h */; };
21384BDC2CD37C8C00D4602B /* Primitive3DMover.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BD62CD37C8C00D4602B /* Primitive3DMover.cpp */; };
21384BDD2CD37C8C00D4602B /* Primitive3DMover.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BD72CD37C8C00D4602B /* Primitive3DMover.h */; };
21384BDE2CD37C8C00D4602B /* Primitive3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 21384BD82CD37C8C00D4602B /* Primitive3D.h */; };
21384BDF2CD37C8C00D4602B /* Primitive3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21384BD92CD37C8C00D4602B /* Primitive3D.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 */; };
@@ -200,6 +209,15 @@
21379E082AE47A6400A1584C /* libArchicad27.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libArchicad27.a; sourceTree = BUILT_PRODUCTS_DIR; };
21384BA92CCDA9B400D4602B /* Host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Host.h; sourceTree = "<group>"; };
21384BAA2CCDA9B400D4602B /* Host.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
21384BC12CD24AB200D4602B /* ElementSubscriber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ElementSubscriber.cpp; sourceTree = "<group>"; };
21384BC42CD24AB200D4602B /* ElementSubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementSubscriber.h; sourceTree = "<group>"; };
21384BC72CD24ADC00D4602B /* ElementEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementEvent.h; sourceTree = "<group>"; };
21384BD12CD37C8C00D4602B /* Polyline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Polyline.cpp; sourceTree = "<group>"; };
21384BD22CD37C8C00D4602B /* Polyline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Polyline.h; sourceTree = "<group>"; };
21384BD62CD37C8C00D4602B /* Primitive3DMover.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Primitive3DMover.cpp; path = Speckle/Primitive/Primitive3DMover.cpp; sourceTree = SOURCE_ROOT; };
21384BD72CD37C8C00D4602B /* Primitive3DMover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Primitive3DMover.h; path = Speckle/Primitive/Primitive3DMover.h; sourceTree = SOURCE_ROOT; };
21384BD82CD37C8C00D4602B /* Primitive3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Primitive3D.h; path = Speckle/Primitive/Primitive3D.h; sourceTree = SOURCE_ROOT; };
21384BD92CD37C8C00D4602B /* Primitive3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Primitive3D.cpp; path = Speckle/Primitive/Primitive3D.cpp; sourceTree = SOURCE_ROOT; };
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>"; };
@@ -449,6 +467,16 @@
name = Products;
sourceTree = "<group>";
};
21384BD32CD37C8C00D4602B /* Polyline */ = {
isa = PBXGroup;
children = (
21384BD12CD37C8C00D4602B /* Polyline.cpp */,
21384BD22CD37C8C00D4602B /* Polyline.h */,
);
name = Polyline;
path = Speckle/Primitive/Polyline;
sourceTree = SOURCE_ROOT;
};
215F08612C9AE3D200CD343B /* RINT */ = {
isa = PBXGroup;
children = (
@@ -518,6 +546,11 @@
219246112CA34DCE00CF5703 /* Primitive */ = {
isa = PBXGroup;
children = (
21384BD32CD37C8C00D4602B /* Polyline */,
21384BD92CD37C8C00D4602B /* Primitive3D.cpp */,
21384BD82CD37C8C00D4602B /* Primitive3D.h */,
21384BD62CD37C8C00D4602B /* Primitive3DMover.cpp */,
21384BD72CD37C8C00D4602B /* Primitive3DMover.h */,
219246102CA34DCE00CF5703 /* Mesh */,
);
path = Primitive;
@@ -537,6 +570,8 @@
children = (
21D0BDBB2C90F2830077E104 /* DocStoreSubscriber.cpp */,
21D0BDBA2C90F2830077E104 /* DocStoreSubscriber.h */,
21384BC12CD24AB200D4602B /* ElementSubscriber.cpp */,
21384BC42CD24AB200D4602B /* ElementSubscriber.h */,
219351782C624FC100E5A69C /* MenuSubscriber.cpp */,
219351792C624FC100E5A69C /* MenuSubscriber.h */,
21D0BDC22C9241940077E104 /* ProjectSubscriber.cpp */,
@@ -551,6 +586,7 @@
isa = PBXGroup;
children = (
21D0BDBE2C90F36B0077E104 /* DocStoreMergeEvent.h */,
21384BC72CD24ADC00D4602B /* ElementEvent.h */,
219351892C62655700E5A69C /* MenuEvent.h */,
215F08652C9B006700CD343B /* ProjectEvent.cpp */,
21D0BDC62C9245E40077E104 /* ProjectEvent.h */,
@@ -933,6 +969,7 @@
21A0FBB52CBA5E380023F24E /* Str256.h in Headers */,
210CC86F2C7E879700610F58 /* ArgumentBase.h in Headers */,
21AE19872CC7FF5F004DBCFC /* Group.h in Headers */,
21384BDB2CD37C8C00D4602B /* Polyline.h in Headers */,
210CC8A02C81E34400610F58 /* Platform.h in Headers */,
219246132CA34DCE00CF5703 /* Mesh.h in Headers */,
21A890CF2CC1B87C0087E732 /* GenericDrawingElement.h in Headers */,
@@ -941,6 +978,7 @@
21AE19A92CC8F1F8004DBCFC /* Beam.h in Headers */,
215F08962CA19AF800CD343B /* BIMElementDatabase.h in Headers */,
2196F2F12CB4823C00450DFC /* Attribute.h in Headers */,
21384BDD2CD37C8C00D4602B /* Primitive3DMover.h in Headers */,
21D0BD332C86FE090077E104 /* Link.h in Headers */,
21AE19612CC2D358004DBCFC /* Setting.h in Headers */,
21D0BD5A2C8910400077E104 /* UserInfo.h in Headers */,
@@ -955,6 +993,7 @@
21AE19802CC7D265004DBCFC /* PropertiedWrapper.h in Headers */,
21A0FC0B2CBE5E220023F24E /* Segment.h in Headers */,
215F088D2CA195EC00CD343B /* ArchicadElementDBaseEngine.h in Headers */,
21384BC82CD24ADC00D4602B /* ElementEvent.h in Headers */,
2196F2F42CB483D600450DFC /* Finish.h in Headers */,
21A0FBED2CBD6B1A0023F24E /* Part.h in Headers */,
21B67D002C7CE15100FD64FC /* Exception.h in Headers */,
@@ -977,6 +1016,7 @@
21AE19942CC82866004DBCFC /* BIMGroupDatabase.h in Headers */,
21AE19542CC273F1004DBCFC /* Template.h in Headers */,
21A0FBBC2CBBC04C0023F24E /* ArchicadRGB.h in Headers */,
21384BDE2CD37C8C00D4602B /* Primitive3D.h in Headers */,
21AE19842CC7D517004DBCFC /* PropertyWrapper.h in Headers */,
21A0FC052CBE59A80023F24E /* SegmentedColumn.h in Headers */,
21A0FC0F2CBE92F10023F24E /* ModelElement.h in Headers */,
@@ -988,6 +1028,7 @@
21AE196A2CC57832004DBCFC /* Propertied.h in Headers */,
2196F2EC2CB4816B00450DFC /* ArchicadAttributeDBaseEngine.h in Headers */,
21AE19582CC27DB3004DBCFC /* Value.h in Headers */,
21384BC62CD24AB200D4602B /* ElementSubscriber.h in Headers */,
21D0BD312C86FE090077E104 /* Index.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1145,6 +1186,7 @@
21AE19572CC27DB3004DBCFC /* Value.cpp in Sources */,
21AE19A82CC8F1F8004DBCFC /* BeamSegment.cpp in Sources */,
21AEF9BE2CA6FDA4000B8681 /* DetachedWrap.cpp in Sources */,
21384BDF2CD37C8C00D4602B /* Primitive3D.cpp in Sources */,
21A0FC062CBE59A80023F24E /* Path.cpp in Sources */,
2196F2F52CB483D600450DFC /* Finish.cpp in Sources */,
21A0FBEA2CBD6B1A0023F24E /* ColumnSegment.cpp in Sources */,
@@ -1153,6 +1195,7 @@
219246042CA2CE2700CF5703 /* BIMLink.cpp in Sources */,
21A890CE2CC1B87C0087E732 /* GenericDrawingElement.cpp in Sources */,
215F08952CA19AF800CD343B /* BIMElementDatabase.cpp in Sources */,
21384BDC2CD37C8C00D4602B /* Primitive3DMover.cpp in Sources */,
21A0FC0E2CBE92F10023F24E /* ModelElement.cpp in Sources */,
219246122CA34DCE00CF5703 /* Mesh.cpp in Sources */,
21A0FBF02CBD6B1A0023F24E /* Column.cpp in Sources */,
@@ -1172,8 +1215,10 @@
21A890D12CC1B87C0087E732 /* GenericModelElement.cpp in Sources */,
21AEF9BC2CA6DF84000B8681 /* DetachmentManager.cpp in Sources */,
215F08552C99DA8D00CD343B /* Project.cpp in Sources */,
21384BDA2CD37C8C00D4602B /* Polyline.cpp in Sources */,
21AE19882CC7FF5F004DBCFC /* Group.cpp in Sources */,
21F69F3B2C6B880C008B6A06 /* JSBaseTransport.cpp in Sources */,
21384BC52CD24AB200D4602B /* ElementSubscriber.cpp in Sources */,
2196F2EB2CB4816B00450DFC /* ArchicadAttributeDBaseEngine.cpp in Sources */,
21AE19532CC273F1004DBCFC /* Template.cpp in Sources */,
21384BAC2CCDA9B400D4602B /* Host.cpp in Sources */,
+6
View File
@@ -71,6 +71,9 @@
<ClInclude Include="Speckle\Interface\Browser\NamedFunction.h" />
<ClInclude Include="Speckle\Interface\Browser\PlatformBinding.h" />
<ClInclude Include="Speckle\Primitive\Mesh\Mesh.h" />
<ClInclude Include="Speckle\Primitive\Polyline\Polyline.h" />
<ClInclude Include="Speckle\Primitive\Primitive3D.h" />
<ClInclude Include="Speckle\Primitive\Primitive3DMover.h" />
<ClInclude Include="Speckle\Record\Attribute\Attribute.h" />
<ClInclude Include="Speckle\Record\Attribute\Finish.h" />
<ClInclude Include="Speckle\Record\Attribute\Storey.h" />
@@ -155,6 +158,9 @@
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\GetCallResult.cpp" />
<ClCompile Include="Speckle\Interface\Browser\Bridge\Functions\RunMethod.cpp" />
<ClCompile Include="Speckle\Primitive\Mesh\Mesh.cpp" />
<ClCompile Include="Speckle\Primitive\Polyline\Polyline.cpp" />
<ClCompile Include="Speckle\Primitive\Primitive3D.cpp" />
<ClCompile Include="Speckle\Primitive\Primitive3DMover.cpp" />
<ClCompile Include="Speckle\Record\Attribute\Attribute.cpp" />
<ClCompile Include="Speckle\Record\Attribute\Finish.cpp" />
<ClCompile Include="Speckle\Record\Attribute\Storey.cpp" />
+26 -4
View File
@@ -116,6 +116,9 @@
<Filter Include="Speckle\Database\Storage\ArchicadDBase\Property">
<UniqueIdentifier>{f9b0554b-d0a5-40c0-ac20-22032dc8f30c}</UniqueIdentifier>
</Filter>
<Filter Include="Speckle\Primitive\Polyline">
<UniqueIdentifier>{25953cb1-f6c3-4db2-80f7-ea3cbc5ad16a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Speckle\Environment\Addon.h">
@@ -415,12 +418,21 @@
<ClInclude Include="Speckle\Record\Element\BeamSegment.h">
<Filter>Speckle\Record\Element</Filter>
</ClInclude>
<ClInclude Include="Speckle\Environment\Host.h">
<Filter>Speckle\Environment</Filter>
</ClInclude>
<ClInclude Include="Speckle\Event\Subscriber\ElementSubscriber.h">
<Filter>Speckle\Event\Subscriber</Filter>
</ClInclude>
<ClInclude Include="Speckle\Event\Type\ElementEvent.h" />
<ClInclude Include="Speckle\Environment\Host.h">
<Filter>Speckle\Environment</Filter>
<ClInclude Include="Speckle\Primitive\Primitive3D.h">
<Filter>Speckle\Primitive</Filter>
</ClInclude>
<ClInclude Include="Speckle\Primitive\Polyline\Polyline.h">
<Filter>Speckle\Primitive\Polyline</Filter>
</ClInclude>
<ClInclude Include="Speckle\Primitive\Primitive3DMover.h">
<Filter>Speckle\Primitive</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
@@ -637,11 +649,21 @@
<ClCompile Include="Speckle\Record\Element\BeamSegment.cpp">
<Filter>Speckle\Record\Element</Filter>
</ClCompile>
<ClCompile Include="Speckle\Event\Subscriber\ElementSubscriber.cpp">
<Filter>Speckle\Event\Subscriber</Filter>
<ClCompile Include="Speckle\Environment\Host.cpp">
<Filter>Speckle\Environment</Filter>
</ClCompile>
<ClCompile Include="Speckle\Event\Subscriber\ElementSubscriber.cpp">
<Filter>Speckle\Event\Subscriber</Filter>
</ClCompile>
<ClCompile Include="Speckle\Primitive\Primitive3D.cpp">
<Filter>Speckle\Primitive</Filter>
</ClCompile>
<ClCompile Include="Speckle\Primitive\Polyline\Polyline.cpp">
<Filter>Speckle\Primitive\Polyline</Filter>
</ClCompile>
<ClCompile Include="Speckle\Primitive\Primitive3DMover.cpp">
<Filter>Speckle\Primitive</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="Speckle\CMakeLists.txt">