Compare commits

...

16 Commits

Author SHA1 Message Date
David Kekesi 45c4311d95 temporary hack to send DisplayValues of Stairs, Rails, CurtainWalls 2024-10-30 10:51:08 +01:00
kekesidavid ae521de698 Merge pull request #12 from specklesystems/david/cnx-665-object-tracking
cnx 665 object tracking
2024-10-29 17:02:08 +01:00
kekesidavid 0ff87576da Merge branch 'develop' into david/cnx-665-object-tracking 2024-10-29 17:01:27 +01:00
Ralph Wessel 63c3c9befa Fixed applicationId tag 2024-10-29 13:16:41 +00:00
David Kekesi 281a2654c9 comment 2024-10-29 12:48:57 +01:00
David Kekesi 8fdbaaa52d ElementChangedSubscriber renamed to ElementSubscriber 2024-10-29 11:03:21 +01:00
David Kekesi 67b12ae353 ElementChangedEvent renamed to ElementEvent 2024-10-29 10:54:47 +01:00
David Kekesi 690e527b81 attach element observer to existing elements 2024-10-29 10:48:43 +01:00
David Kekesi 8f2e31c16e searching for expired ModelCards, naive, not efficient solution for now 2024-10-29 10:32:26 +01:00
Ralph Wessel e9b768daec Updated JSBaseTransport for new read/writeSetting functions
Updated VS projects
2024-10-29 09:05:38 +00:00
David Kekesi e5bf001590 handling Begin, End event types, sending setModelsExpired event to UI 2024-10-28 21:58:07 +01:00
Ralph Wessel 7c0ac2e8f6 Updated Xcode projects
Added environment Host to represent host BIM application
Updated for latest ActiveLib
2024-10-28 17:27:46 +00:00
David Kekesi 0969026f39 ElementChangedSubscriber, ElementChangedEvent added 2024-10-28 11:22:27 +01:00
Ralph Wessel 3d2aab8862 Updated documentation 2024-10-24 18:06:18 +01:00
Ralph Wessel bdea330c2e Moved include file to implementation
Fixed docs typo
2024-10-24 16:50:58 +01:00
Ralph Wessel b066b4ba3c Merge pull request #11 from specklesystems/david/cnx-660-document-switch-and-model-cards
cnx 660 document switch and model cards
2024-10-24 15:38:40 +01:00
50 changed files with 655 additions and 123 deletions
@@ -32,6 +32,7 @@
2192460D2CA3469D00CF5703 /* ProjectCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2192460B2CA3469D00CF5703 /* ProjectCollection.cpp */; };
219F30422C769283009834E9 /* ConfigTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219F30402C769282009834E9 /* ConfigTests.cpp */; };
21A0FB982CB723240023F24E /* FinishProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21A0FB942CB723240023F24E /* FinishProxy.cpp */; };
21A79EC92CCDA45C001754E4 /* HighlightModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21A79EC52CCDA45C001754E4 /* HighlightModel.cpp */; };
21A890BC2CC15C540087E732 /* SelectionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21A890B22CC15C540087E732 /* SelectionInfo.cpp */; };
21A890BD2CC15C540087E732 /* GetSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21A890B52CC15C540087E732 /* GetSelection.cpp */; };
21A890BE2CC15C540087E732 /* SelectionBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 21A890B72CC15C540087E732 /* SelectionBridge.cpp */; };
@@ -317,6 +318,8 @@
219F30432C7693B6009834E9 /* Connector-AC27-Debug.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Connector-AC27-Debug.xctestplan"; sourceTree = SOURCE_ROOT; };
21A0FB942CB723240023F24E /* FinishProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FinishProxy.cpp; sourceTree = "<group>"; };
21A0FB972CB723240023F24E /* FinishProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FinishProxy.h; sourceTree = "<group>"; };
21A79EC52CCDA45C001754E4 /* HighlightModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HighlightModel.cpp; sourceTree = "<group>"; };
21A79EC82CCDA45C001754E4 /* HighlightModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HighlightModel.h; sourceTree = "<group>"; };
21A890B22CC15C540087E732 /* SelectionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionInfo.cpp; sourceTree = "<group>"; };
21A890B32CC15C540087E732 /* SelectionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionInfo.h; sourceTree = "<group>"; };
21A890B52CC15C540087E732 /* GetSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetSelection.cpp; sourceTree = "<group>"; };
@@ -1026,6 +1029,8 @@
21B67CA82C77329800FD64FC /* GetSourceApplicationName.h */,
21B67CA92C77329800FD64FC /* GetSourceApplicationVersion.cpp */,
21B67CAA2C77329800FD64FC /* GetSourceApplicationVersion.h */,
21A79EC52CCDA45C001754E4 /* HighlightModel.cpp */,
21A79EC82CCDA45C001754E4 /* HighlightModel.h */,
21D0BDD52C935DAE0077E104 /* RemoveModel.cpp */,
21D0BDD62C935DAE0077E104 /* RemoveModel.h */,
21D0BDD22C935D1A0077E104 /* UpdateModel.cpp */,
@@ -1508,6 +1513,7 @@
214B7A372C764BCD00D586C1 /* UpdateConfig.cpp in Sources */,
21AEF9EC2CAB56E5000B8681 /* SendViaBrowserArgs.cpp in Sources */,
21FF70492CA1A7F400AAD99A /* RecordCollection.cpp in Sources */,
21A79EC92CCDA45C001754E4 /* HighlightModel.cpp in Sources */,
21B67CC02C775A0D00FD64FC /* GetDocumentInfo.cpp in Sources */,
21D0BDD42C935D1A0077E104 /* UpdateModel.cpp in Sources */,
21A890BD2CC15C540087E732 /* GetSelection.cpp in Sources */,
@@ -2065,7 +2071,7 @@
);
LOCALISATION_SUFFIX = "EN-GB";
MACH_O_TYPE = mh_bundle;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 13.3;
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
OBJROOT = "";
ONLY_ACTIVE_ARCH = YES;
@@ -2172,7 +2178,7 @@
);
LOCALISATION_SUFFIX = "EN-GB";
MACH_O_TYPE = mh_bundle;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 13.3;
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
OBJROOT = "";
PLUGIN_FOLDER = "";
@@ -14,7 +14,7 @@ using namespace speckle::utility;
namespace {
using WrappedValue = active::serialise::CargoHold<ContainerWrap<Vector<Account>>, Vector<Account>>;
using WrappedValue = CargoHold<ContainerWrap<Vector<Account>>, Vector<Account>>;
}
@@ -6,7 +6,7 @@
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
JS Function class to retrieve the user's account(s)
*/
class GetAccounts : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
@@ -2,7 +2,6 @@
#include "Connector/Connector.h"
#include "Connector/Database/ModelCardDatabase.h"
#include "Connector/Interface/Browser/Bridge/Base/Arg/DocumentInfo.h"
using namespace active::container;
using namespace active::serialise;
@@ -8,7 +8,7 @@
namespace connector::interfac::browser::bridge {
///Argument parameter for a string
///Argument parameter for a model card
using CardHold = active::serialise::CargoHold<connector::record::CardMover, connector::record::ModelCard>;
///Argument type for this method
using ModelCardEventWrapper = speckle::interfac::browser::bridge::JSArgType<CardHold>;
@@ -8,6 +8,7 @@
#include "Connector/Interface/Browser/Bridge/Base/RemoveModel.h"
#include "Connector/Interface/Browser/Bridge/Base/UpdateModel.h"
#include "Connector/Interface/Browser/Bridge/Base/HighlightModel.h"
#include "Speckle/Event/Type/ProjectEvent.h"
using namespace connector::interfac::browser::bridge;
@@ -37,11 +38,11 @@ BaseBridge::BaseBridge() : BrowserBridge{"baseBinding"} {
bool BaseBridge::handle(const speckle::event::ProjectEvent& event) {
using enum speckle::event::ProjectEvent::Type;
switch (event.getType()) {
case open:
sendEvent("documentChanged");
break;
default:
break;
case open:
sendEvent("documentChanged");
break;
default:
break;
}
return false;
} //BaseBridge::handle
@@ -3,12 +3,11 @@
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
#include "Speckle/Event/Subscriber/ProjectSubscriber.h"
#include "Speckle/Event/Type/ProjectEvent.h"
namespace connector::interfac::browser::bridge {
/*!
A browser bridge to provide configuration settings
A browser bridge to manage document settings
*/
class BaseBridge : public speckle::interfac::browser::bridge::BrowserBridge, public speckle::event::ProjectSubscriber {
public:
@@ -25,13 +25,13 @@ GetConnectorVersion::GetConnectorVersion() : BridgeMethod{"GetConnectorVersion",
/*--------------------------------------------------------------------
Get the host application version
Get the connector software version
return: The application version
return: The connector software version
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetConnectorVersion::run() const {
//Implement other platforms as required
String result{active::utility::String{connector::versionMajor} + "." + active::utility::String{connector::versionMinor} + "." +
active::utility::String{connector::versionPatch}};
String result{String{connector::versionMajor} + "." + String{connector::versionMinor} + "." +
String{connector::versionPatch}};
return std::make_unique<WrappedValue>(result);
} //GetConnectorVersion::run
@@ -8,7 +8,7 @@ namespace connector::interfac::browser::bridge {
class ConnectorConfig;
/*!
JS Function class to retrieve the names of the methods supported by the bridge
JS Function class to get the connector software version
*/
class GetConnectorVersion : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
@@ -23,8 +23,8 @@ namespace connector::interfac::browser::bridge {
// MARK: - Functions (const)
/*!
Get the host application version
@return The application version
Get the connector software version
@return The connector software version
*/
std::unique_ptr<active::serialise::Cargo> run() const;
};
@@ -21,9 +21,9 @@ GetDocumentState::GetDocumentState() : BridgeMethod{"GetDocumentState", [&]() {
/*--------------------------------------------------------------------
Get the document info
Get the document model cards
return: The document info
return: The document model cards
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetDocumentState::run() const {
if (auto modelCardDBase = connector()->getModelCardDatabase(); modelCardDBase != nullptr) {
@@ -6,7 +6,7 @@
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the information about the active document
JS Function class to retrieve model cards stored in the current document
*/
class GetDocumentState : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
@@ -21,8 +21,8 @@ namespace connector::interfac::browser::bridge {
// MARK: - Functions (const)
/*!
Get the document info
@return The document info
Get the document model cards
@return The document model cards
*/
std::unique_ptr<active::serialise::Cargo> run() const;
};
@@ -10,17 +10,11 @@
#include "Speckle/Database/BIMElementDatabase.h"
#include "Speckle/Environment/Project.h"
#include <array>
using namespace speckle::record::element;
using namespace connector::interfac::browser::bridge;
using namespace connector::record;
using namespace speckle::utility;
namespace {
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
@@ -30,9 +24,9 @@ HighlightModel::HighlightModel() : BridgeMethod{"HighlightModel", [&](const Send
/*--------------------------------------------------------------------
Higlight the model card selection
Highlight elements linked to the model card selection
modelCardID: The ID of the model to send
modelCardID: The ID of the target model card
--------------------------------------------------------------------*/
void HighlightModel::run(const String& modelCardID) const {
// Find the specified model card
@@ -16,7 +16,7 @@ namespace connector::interfac::browser::bridge {
using SendArgs = speckle::interfac::browser::bridge::JSArgType<StringHold>;
/*!
JS Function class to send a specified model
JS Function class to highlight elements from the selected model card in the open document
*/
class HighlightModel : public speckle::interfac::browser::bridge::BridgeMethod<SendArgs, void> {
public:
@@ -31,8 +31,8 @@ namespace connector::interfac::browser::bridge {
// MARK: - Functions (const)
/*!
Higlight the model card selection
@param modelCardID The ID of the model to send
Highlight elements linked to the model card selection
@param modelCardID The ID of the target model card
*/
void run(const speckle::utility::String& modelCardID) const;
};
@@ -8,13 +8,13 @@
namespace connector::interfac::browser::bridge {
///Argument parameter for a string
///Argument parameter for a model card
using CardHold = active::serialise::CargoHold<connector::record::CardMover, connector::record::ModelCard>;
///Argument type for this method
using ModelCardEventWrapper = speckle::interfac::browser::bridge::JSArgType<CardHold>;
/*!
JS Function class to add a model card to the document storage
JS Function class to remove a model card from the document storage
*/
class RemoveModel : public speckle::interfac::browser::bridge::BridgeMethod<ModelCardEventWrapper, void> {
public:
@@ -29,8 +29,8 @@ namespace connector::interfac::browser::bridge {
// MARK: - Functions (const)
/*!
Add a model card to document storage
@param card The card to add
Remove a model card from document storage
@param card The card to remove
*/
void run(const connector::record::ModelCard& card) const;
};
@@ -26,9 +26,9 @@ UpdateModel::UpdateModel() : BridgeMethod{"UpdateModel", [&](const ModelCardEven
/*--------------------------------------------------------------------
Add a model card to document storage
Update a model card in document storage
card: The card to add
card: The card to update
--------------------------------------------------------------------*/
void UpdateModel::run(const ModelCard& card) const {
if (auto modelCardDBase = connector()->getModelCardDatabase(); modelCardDBase != nullptr)
@@ -8,13 +8,13 @@
namespace connector::interfac::browser::bridge {
///Argument parameter for a string
///Argument parameter for a model card
using CardHold = active::serialise::CargoHold<connector::record::CardMover, connector::record::ModelCard>;
///Argument type for this method
using ModelCardEventWrapper = speckle::interfac::browser::bridge::JSArgType<CardHold>;
/*!
JS Function class to add a model card to the document storage
JS Function class to update a model card in document storage
*/
class UpdateModel : public speckle::interfac::browser::bridge::BridgeMethod<ModelCardEventWrapper, void> {
public:
@@ -29,8 +29,8 @@ namespace connector::interfac::browser::bridge {
// MARK: - Functions (const)
/*!
Add a model card to document storage
@param card The card to add
Update a model card in document storage
@param card The card to update
*/
void run(const connector::record::ModelCard& card) const;
};
@@ -6,7 +6,7 @@
namespace connector::interfac::browser::bridge {
/*!
JS Function class to retrieve the names of the methods supported by the bridge
JS Function class to retrieve the current display configuration settings
*/
class GetConfig : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
@@ -9,11 +9,11 @@ namespace connector::interfac::browser::bridge {
class ConnectorConfig;
///Argument for a JS call to update the configuration
///Argument for a JS call to update the display configuration settings
using UpdateArgs = speckle::interfac::browser::bridge::JSArgType<ConnectorConfig>;
/*!
JS Function class to retrieve the names of the methods supported by the bridge
JS Function class to update the display configuration settings
*/
class UpdateConfig : public speckle::interfac::browser::bridge::BridgeMethod<UpdateArgs, void> {
public:
@@ -22,7 +22,6 @@ namespace connector::interfac::browser::bridge {
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
UpdateConfig();
@@ -12,7 +12,6 @@ namespace connector::interfac::browser::bridge {
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetSelection();
@@ -18,7 +18,6 @@ namespace connector::interfac::browser::bridge {
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetSendFilters();
@@ -13,7 +13,7 @@ using namespace speckle::utility;
namespace {
using WrappedValue = active::serialise::CargoHold<ContainerWrap<Vector<CardSetting>, PackageWrap>, Vector<CardSetting>>;
using WrappedValue = CargoHold<ContainerWrap<Vector<CardSetting>, PackageWrap>, Vector<CardSetting>>;
}
@@ -26,9 +26,9 @@ GetSendSettings::GetSendSettings() : BridgeMethod{"GetSendSettings", [&]() {
/*--------------------------------------------------------------------
Get the send filters
Get send settings relevant to the host BIM application
return: The send filters
return: The send settings
--------------------------------------------------------------------*/
std::unique_ptr<Cargo> GetSendSettings::run() const {
auto filters = std::make_unique<Vector<CardSetting>>();
@@ -9,7 +9,7 @@ namespace connector::interfac::browser::bridge {
class ConnectorConfig;
/*!
JS Function class to retrieve the send filters
JS Function class to retrieve the send settings relevant to the host BIM application
*/
class GetSendSettings : public speckle::interfac::browser::bridge::BridgeMethod<void, active::serialise::Cargo> {
public:
@@ -18,15 +18,14 @@ namespace connector::interfac::browser::bridge {
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetSendSettings();
// MARK: - Functions (const)
/*!
Get the send filters
@return The send filters
Get send settings relevant to the host BIM application
@return The send settings
*/
std::unique_ptr<active::serialise::Cargo> run() const;
};
@@ -20,8 +20,6 @@
#include "Speckle/Record/Element/Element.h"
using namespace speckle::record::element;
#include <array>
using namespace active::serialise;
using namespace connector::interfac::browser::bridge;
using namespace connector::record;
@@ -29,10 +27,6 @@ using namespace speckle::database;
using namespace speckle::serialise;
using namespace speckle::utility;
namespace {
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
@@ -44,7 +38,7 @@ Send::Send() : BridgeMethod{"Send", [&](const SendArgs& args) {
/*--------------------------------------------------------------------
Send a specified model
modelCardID: The ID of the model to send
modelCardID: The ID of the model card identifying the objects to send
--------------------------------------------------------------------*/
void Send::run(const String& modelCardID) const {
//Find the specified model card
@@ -70,8 +64,7 @@ void Send::run(const String& modelCardID) const {
std::make_unique<SendError>(connector()->getLocalString(errorString, noProjectOpenID), modelCardID));
return;
}
//Build a collection from the selected elements
auto collection = std::make_unique<ProjectCollection>(project);
//Get the selected elements
auto elementDatabase = project->getElementDatabase();
auto selected = elementDatabase->getSelection();
if (selected.empty()) {
@@ -79,6 +72,8 @@ void Send::run(const String& modelCardID) const {
std::make_unique<SendError>(connector()->getLocalString(errorString, noSelectedModelItemsID), modelCardID));
return;
}
//Build a collection from the selected elements
auto collection = std::make_unique<ProjectCollection>(project);
for (const auto& link : selected) {
if (auto element = elementDatabase->getElement(link); element)
collection->addElement(*element);
@@ -25,7 +25,6 @@ namespace connector::interfac::browser::bridge {
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
Send();
@@ -33,7 +32,7 @@ namespace connector::interfac::browser::bridge {
/*!
Send a specified model
@param modelCardID The ID of the model to send
@param modelCardID The ID of the model card identifying the objects to send
*/
void run(const speckle::utility::String& modelCardID) const;
};
@@ -1,10 +1,26 @@
#include "Connector/Interface/Browser/Bridge/Send/SendBridge.h"
#include "Connector/Interface/Browser/Bridge/Send/GetSendFilters.h"
#include "Connector/Interface/Browser/Bridge/Send/GetSendSettings.h"
#include "Connector/Interface/Browser/Bridge/Send/Send.h"
#include "Connector/Connector.h"
#include "Connector/ConnectorResource.h"
#include "Connector/Database/ModelCardDatabase.h"
#include "Speckle/Event/Type/ElementEvent.h"
#include "Speckle/Record/Element/Element.h"
#include "Speckle/Database/BIMElementDatabase.h"
#include "Speckle/Environment/Project.h"
#include "Speckle/Database/Identity/RecordID.h"
#include "Active/Serialise/CargoHold.h"
#include "Active/Serialise/Package/Wrapper/ContainerWrap.h"
#include "Connector/Record/Model/SenderModelCard.h"
#include "Connector/Record/Model/Filter/SendFilter.h"
using namespace speckle::database;
using namespace connector::interfac::browser::bridge;
using namespace speckle::utility;
using namespace speckle::event;
using namespace active::serialise;
using namespace connector::record;
/*--------------------------------------------------------------------
Default constructor
@@ -14,4 +30,71 @@ SendBridge::SendBridge() : BrowserBridge{"sendBinding"} {
addMethod<GetSendFilters>();
addMethod<GetSendSettings>();
addMethod<Send>();
// POC: do we have a better place to attach observer to elements?
#ifdef ARCHICAD
auto project = connector()->getActiveProject().lock();
if (!project) {
// TODO: is this OK? should this throw?
return;
}
auto elementDatabase = project->getElementDatabase();
auto elements = elementDatabase->getElements();
ElementIDList elementIds;
for (const auto& id : elementIds) {
ACAPI_Element_AttachObserver(id);
}
#endif
} //SendBridge::SendBridge
/*--------------------------------------------------------------------
Handle an element change
event: The selection event
return: True if the event should be closed
--------------------------------------------------------------------*/
bool SendBridge::handle(const ElementEvent& event) {
auto eventType = event.getEventType();
switch (eventType)
{
case ElementEvent::EventType::Begin: {
m_changedElements.clear();
} break;
case ElementEvent::EventType::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());
break;
}
}
}
}
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;
default:
break;
}
return true;
} //SendBridge::handle
@@ -2,13 +2,14 @@
#define CONNECTOR_INTERFACE_BRIDGE_SEND_BRIDGE
#include "Speckle/Interface/Browser/Bridge/BrowserBridge.h"
#include "Speckle/Event/Subscriber/ElementSubscriber.h"
namespace connector::interfac::browser::bridge {
/*!
A browser bridge to support sending model data to a Speckle server
*/
class SendBridge : public speckle::interfac::browser::bridge::BrowserBridge {
class SendBridge : public speckle::interfac::browser::bridge::BrowserBridge, public speckle::event::ElementSubscriber {
public:
// MARK: - Types
@@ -22,6 +23,14 @@ namespace connector::interfac::browser::bridge {
Default constructor
*/
SendBridge();
protected:
/*!
Handle an element change
@param event The selection event
@return True if the event should be closed
*/
bool handle(const speckle::event::ElementEvent& event) override;
};
}
@@ -1,5 +1,5 @@
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#define CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#ifndef CONNECTOR_INTERFACE_BRIDGE_GET_COMPLEX_TYPE
#define CONNECTOR_INTERFACE_BRIDGE_GET_COMPLEX_TYPE
#include "Speckle/Interface/Browser/Bridge/BridgeMethod.h"
@@ -15,7 +15,6 @@ namespace connector::interfac::browser::bridge {
/*!
Constructor
@param bridge The parent bridge object (provides access to bridge methods)
*/
GetComplexType();
@@ -30,4 +29,4 @@ namespace connector::interfac::browser::bridge {
}
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_CONFIG
#endif //CONNECTOR_INTERFACE_BRIDGE_GET_COMPLEX_TYPE
@@ -1,8 +1,9 @@
#include "Connector/Interface/Browser/Bridge/Test/GoAway.h"
using namespace connector::interfac::browser::bridge;
#include "Speckle/Environment/Platform.h"
#include <iostream>
using namespace connector::interfac::browser::bridge;
using namespace speckle::environment;
/*--------------------------------------------------------------------
Default constructor
@@ -16,5 +17,5 @@ GoAway::GoAway() : BridgeMethod{"GoAway", [&]() {
Write a message to the console
--------------------------------------------------------------------*/
void GoAway::run() const {
std::cout << "Okay, going away.";
platform()->writeToConsole("Okay, going away.");
} //GoAway::run
@@ -174,7 +174,13 @@ BrowserPalette::BrowserPalette() :
}
install<ConfigBridge>();
install<SendBridge>();
if (auto ref = install<SendBridge>(); ref) {
if (auto sendBridgeRef = std::dynamic_pointer_cast<SendBridge>(ref); sendBridgeRef) {
connector::connector()->addWeak(sendBridgeRef);
sendBridgeRef->start();
}
}
if (auto ref = install<SelectionBridge>(); ref) {
if (auto selectionBridgeRef = std::dynamic_pointer_cast<SelectionBridge>(ref); selectionBridgeRef) {
@@ -3,6 +3,7 @@
#include "Connector/Record/Model/ReceiverModelCard.h"
#include "Connector/Record/Model/SenderModelCard.h"
using namespace active::serialise;
using namespace connector::record;
namespace {
@@ -32,7 +33,7 @@ namespace {
}
///The handler for model card packages
std::shared_ptr<active::serialise::Handler> CardMover::m_handler = std::make_shared<active::serialise::Handler>(attributeTag);
std::shared_ptr<Handler> CardMover::m_handler = std::make_shared<Handler>(attributeTag);
/*--------------------------------------------------------------------
@@ -6,10 +6,10 @@
namespace connector::record {
/*!
Wrapper to box/unbox objects during (de)serialisation, including reading/writing a specified attribute to determine object type
Wrapper to box/unbox model cards during (de)serialisation
Note that a derived class could also define the package handler, allowing the wrapper to be created via a default constructor that is
automatically bound to a set of internally defined object types
Model cards are polymorphic - this class ensures the type information is included when a card is serialised
and the correct object type is constructed on deserialisation
*/
class CardMover : public active::serialise::Mover {
public:
@@ -11,7 +11,10 @@
namespace connector::record {
/*!
A connector send filter
Base class for a Speckle model card
A model card captures key information about a model submitted to a Speckle server, e.g. the model ID, the target server
and account, and any settings or filters applicable to the host BIM application and open document
*/
class ModelCard : public speckle::database::Record {
public:
@@ -60,13 +63,13 @@ namespace connector::record {
*/
const speckle::utility::String& getModelID() const { return m_modelID; }
/*!
Get the setting type
@return The setting type
Get the ID of the active BIM project
@return The ID of the active BIM project
*/
const speckle::utility::String& getProjectID() const { return m_projectID; }
/*!
Get the setting type
@return The setting type
Get the user account ID
@return The user account ID
*/
const speckle::utility::String& getAccountID() const { return m_accountID; }
/*!
@@ -75,8 +78,8 @@ namespace connector::record {
*/
const speckle::utility::String& getMessage() const { return m_message; }
/*!
Get the setting type
@return The setting type
Get the server URL
@return The server URL
*/
const speckle::utility::String& getServerURL() const { return m_serverURL; }
/*!
+1 -1
View File
@@ -1,5 +1,5 @@
'STR#' 32500 "Connector Menu" {
/*[ 1]*/ "Speckle Connector"
/*[ 1]*/ "Speckle Connector^E3^EL^ES^ED^EE^EI^EW^ET^"
}
+2 -2
View File
@@ -1,7 +1,7 @@
/* --- Dockable browser palette ----------------------------------------------*/
'GDLG' 32500 Palette | topCaption | close | grow 0 0 450 150 "Speckle Connector" {
/* [ 1] */ Browser 0 0 450 150
'GDLG' 32500 Palette | topCaption | close | grow 0 0 350 150 "Speckle Connector" {
/* [ 1] */ Browser 0 0 350 150
}
'DLGH' 32500 DLG_32500_Browser_Palette {
@@ -14,11 +14,8 @@ BIMLink::BIMLink(const API_Neig& selected, const BIMRecordID& tableID) : base{Gu
//More info should be extracted from API_Neig in future (as required) - extract into link settings, e.g. selection target etc
} //Link::Link
BIMLinkList::BIMLinkList(const ElementIDList& elementIDList) {
for (const auto& id : elementIDList)
push_back(id);
}
#endif
@@ -239,7 +239,7 @@ void DocumentStoreCore::writeStore() {
GS::HashTable<API_Guid, short> conflicts;
if (auto statusCode = convertArchicadError(ACAPI_AddOnObject_ReserveObjects({Guid{m_id.id}}, &conflicts)); statusCode != nominal)
throw std::system_error(makeError(statusCode));
//TODO: Implamenent handling for conflicts
//TODO: Implement handling for conflicts
}
auto toWrite = buildStore();
//Write the new data
+43
View File
@@ -0,0 +1,43 @@
#include "Speckle/Environment/Host.h"
#ifdef ARCHICAD
#include "DG.h"
#endif
using namespace speckle::utility;
using namespace speckle::environment;
namespace {
//An object representing the active host
Host m_hostInstance;
}
/*--------------------------------------------------------------------
Default constructor
--------------------------------------------------------------------*/
Host::Host() {
} //Host::Host
/*--------------------------------------------------------------------
Display an alert dialog
message: The alert message
--------------------------------------------------------------------*/
void Host::displayAlert(const String& message) const {
#ifdef ARCHICAD
DGAlert(DG_INFORMATION, "Notification", message.data(), "", "OK");
#endif
} //Host::displayAlert
/*--------------------------------------------------------------------
Get an object representing the parent process/application
return: The active application instance
--------------------------------------------------------------------*/
speckle::environment::Host* speckle::environment::host() {
return &m_hostInstance;
} //speckle::environment::host
+41
View File
@@ -0,0 +1,41 @@
#ifndef SPECKLE_ENVIRONMENT_HOST
#define SPECKLE_ENVIRONMENT_HOST
#include "Speckle/Utility/String.h"
namespace speckle::environment {
/*!
Class to represent a host application (for plugin contexts)
*/
class Host {
public:
// MARK: Constructors
/*!
Default constructor
*/
Host();
// MARK: Functions (const)
/*!
Display an alert dialog
@param message The alert message
*/
void displayAlert(const speckle::utility::String& message) const;
// MARK: Functions (mutating)
};
/*!
Get an object representing the host instance
@return The active host instance (nullptr if the host is not running)
*/
speckle::environment::Host* host();
}
#endif //SPECKLE_ENVIRONMENT_HOST
@@ -0,0 +1,110 @@
#include "Speckle/Event/Subscriber/ElementSubscriber.h"
#include "Speckle/Environment/Addon.h"
#include "Speckle/Database/Identity/BIMLink.h"
#include "Speckle/Database/Storage/ArchicadDBase/Element/ArchicadElementDBaseEngine.h"
#include "Speckle/Event/Type/ElementEvent.h"
#ifdef ARCHICAD
#include <ACAPinc.h>
#endif
using namespace active::environment;
using namespace active::event;
using namespace speckle::database;
using namespace speckle::environment;
using namespace speckle::event;
namespace {
#ifdef ARCHICAD
/*!
Callback for an Archicad element change
@param elemType Info about the last changed element
*/
GSErrCode __ACENV_CALL elementChangedCallback(const API_NotifyElementType* elemType) {
if (addon() == nullptr)
return NoError;
// POC: can we do this switch smater?
switch (elemType->notifID)
{
case APINotifyElement_New: {
ACAPI_Element_AttachObserver(elemType->elemHead.guid);
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::New });
} break;
case APINotifyElement_Change: {
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::Change });
} break;
case APINotifyElement_Edit: {
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::Edit });
} break;
case APINotifyElement_Delete: {
addon()->publishExternal(ElementEvent{ ElementID{ elemType->elemHead.guid }, ElementEvent::EventType::Delete });
} break;
case APINotifyElement_BeginEvents:
addon()->publishExternal(ElementEvent{ ElementID{}, ElementEvent::EventType::Begin });
break;
case APINotifyElement_EndEvents: {
addon()->publishExternal(ElementEvent{ ElementID{}, ElementEvent::EventType::End });
} break;
default:
break;
}
return NoError;
}
#endif
}
/*--------------------------------------------------------------------
Get the event subscription list
return: The subscription list (an empty list will put the subscriber into a suspended state)
--------------------------------------------------------------------*/
Subscriber::Subscription ElementSubscriber::subscription() const {
return { {ElementEvent::ID} };
} //ElementSubscriber::subscription
/*--------------------------------------------------------------------
Receive a subscribed event
event: The incoming event
return: True if the event should be closed
--------------------------------------------------------------------*/
bool ElementSubscriber::receive(const Event& event) {
//Pass a menu event to the specified handler function
if (auto changeEvent = dynamic_cast<const ElementEvent*>(&event); changeEvent != nullptr)
return handle(*changeEvent);
return false;
} //ElementSubscriber::receive
/*--------------------------------------------------------------------
Start the participant operation
return: True if the participant is able to continue
--------------------------------------------------------------------*/
bool ElementSubscriber::start() {
#ifdef ARCHICAD
GSErrCode err = ACAPI_Element_InstallElementObserver(elementChangedCallback);
if (err != NoError)
return false;
return (ACAPI_Element_CatchNewElement(nullptr, elementChangedCallback) == NoError);
#else
return false;
#endif
} //ElementSubscriber::start
/*--------------------------------------------------------------------
Stop participation (release resources etc)
--------------------------------------------------------------------*/
void ElementSubscriber::stop() {
#ifdef ARCHICAD
ACAPI_Notification_CatchSelectionChange(nullptr);
#endif
} //ElementSubscriber::stop
@@ -0,0 +1,73 @@
#ifndef SPECKLE_EVENT_ELEMENT_CHANGED_SUBSCRIBER
#define SPECKLE_EVENT_ELEMENT_CHANGED_SUBSCRIBER
#include "Active/Event/Subscriber.h"
#include "Speckle/Database/Identity/RecordID.h"
namespace speckle::event {
class ElementEvent;
/*!
Base class for subscribers responding to element changes
*/
class ElementSubscriber : public virtual active::event::Subscriber {
public:
// MARK: - Constructors
/*!
Default constructor
*/
ElementSubscriber() = default;
/*!
Copy constructor
@param source The object to copy
*/
ElementSubscriber(const ElementSubscriber& source) = default;
/*!
Destructor
*/
~ElementSubscriber() = default;
// MARK: - Functions (const)
/*!
Get the event subscription list
@return The subscription list (an empty list will put the subscriber into a suspended state)
*/
Subscription subscription() const override;
// MARK: - Functions (mutating)
/*!
Receive a subscribed event
@param event The incoming event
@return True if the event should be closed
*/
bool receive(const active::event::Event& event) override;
/*!
Start the participant operation
@return True if the participant is able to continue
*/
virtual bool start() override;
/*!
Stop participation (release resources etc)
*/
void stop() override;
protected:
/*!
Handle an element change
@param event The element change event
@return True if the event should be closed
*/
virtual bool handle(const ElementEvent& event) = 0;
speckle::database::ElementIDList m_changedElements;
};
}
#endif //SPECKLE_EVENT_ELEMENT_CHANGED_SUBSCRIBER
@@ -81,4 +81,4 @@ void SelectionSubscriber::stop() {
#ifdef ARCHICAD
ACAPI_Notification_CatchSelectionChange(nullptr);
#endif
}
} //SelectionSubscriber::stop
@@ -0,0 +1,60 @@
#ifndef SPECKLE_EVENT_ELEMENT_EVENT
#define SPECKLE_EVENT_ELEMENT_EVENT
#include "Active/Event/Event.h"
#include "Active/Utility/Guid.h"
#include "Active/Utility/String.h"
namespace speckle::event {
/*!
Class representing a selection change event
*/
class ElementEvent : public active::event::Event {
public:
enum EventType { New, Begin, End, Change, Edit, Delete };
static const inline active::utility::NameID ID{active::utility::String{"element change"},
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)
*/
ElementEvent(speckle::database::ElementID changed, EventType eventType) : Event{ ID }, m_changedElement{ changed }, m_eventType{ eventType } {}
/*!
Copy constructor
@param source The object to copy
*/
ElementEvent(const ElementEvent& source) = default;
/*!
Destructor
*/
~ElementEvent() = default;
// MARK: - Functions (const)
/*!
Determine if the event selection is empty
@return True if the event selection is empty
*/
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; }
private:
speckle::database::ElementID m_changedElement;
EventType m_eventType;
};
}
#endif //SPECKLE_EVENT_ELEMENT_EVENT
@@ -62,12 +62,17 @@ namespace speckle::interfac::browser::bridge {
@return The number of parameters
*/
virtual uint32_t parameterCount() const { return 1; }
/*!
Get any error message relating to the arguments
@return The error message (nullopt if no errors occurred)
*/
speckle::utility::String::Option errorMessage() const { return m_errorMessage; }
/*!
Write the item data to a string
@param dest The string to write the data to
@return True if the data was successfully written
*/
bool write(active::utility::String& dest) const override { return true; }
/*!
Fill an inventory with the cargo items
@param inventory The inventory to receive the cargo items
@@ -83,6 +88,12 @@ namespace speckle::interfac::browser::bridge {
// MARK: - Functions (mutating)
/*!
Read the cargo data from the specified string
@param source The string to read
@return True if the data was successfully read
*/
bool read(const active::utility::String& source) override { return true; }
/*!
Set to the default package content
*/
@@ -121,12 +132,24 @@ namespace speckle::interfac::browser::bridge {
*/
JSArgType(const JSArgType& source) : BridgeArgument{source}, T{source} {}
/*!
/*!
Write the item data to a string
@param dest The string to write the data to
@return True if the data was successfully written
*/
bool write(active::utility::String& dest) const override { return true; }
/*!
Get the number of parameters in the argument
@return The number of parameters
*/
uint32_t parameterCount() const override { return Params; }
/*!
Read the cargo data from the specified string
@param source The string to read
@return True if the data was successfully read
*/
bool read(const active::utility::String& source) override { return true; }
/*!
Set to the default package content
*/
@@ -60,6 +60,70 @@ namespace {
Identity{"displayValue"},
Identity{"properties"},
};
#ifdef ARCHICAD
template<typename T>
void getSubElementIds(T* ptr, std::set<API_Guid>& subIds)
{
GSSize nSubElements = BMGetPtrSize(reinterpret_cast<GSPtr>(ptr)) / sizeof(T);
for (Int32 idx = 0; idx < nSubElements; ++idx)
subIds.insert(ptr[idx].head.guid);
}
std::set<API_Guid> collectSubIds(API_Guid elemId)
{
API_Element elem{};
elem.header.guid = elemId;
ACAPI_Element_Get(&elem);
API_ElementMemo memo{};
GSErrCode err = ACAPI_Element_GetMemo(elemId, &memo);
std::set<API_Guid> subIds{};
subIds.insert(elemId);
if (elem.header.type.typeID == API_StairID)
{
getSubElementIds(memo.stairRisers, subIds);
getSubElementIds(memo.stairTreads, subIds);
getSubElementIds(memo.stairStructures, subIds);
}
if (elem.header.type.typeID == API_RailingID)
{
// segments
getSubElementIds(memo.railingSegments, subIds);
getSubElementIds(memo.railingPatterns, subIds);
getSubElementIds(memo.railingRails, subIds);
getSubElementIds(memo.railingHandrails, subIds);
getSubElementIds(memo.railingToprails, subIds);
getSubElementIds(memo.railingBalusterSets, subIds);
getSubElementIds(memo.railingBalusters, subIds);
getSubElementIds(memo.railingPanels, subIds);
getSubElementIds(memo.railingInnerPosts, subIds);
// nodes
getSubElementIds(memo.railingNodes, subIds);
getSubElementIds(memo.railingRailConnections, subIds);
getSubElementIds(memo.railingHandrailConnections, subIds);
getSubElementIds(memo.railingToprailConnections, subIds);
getSubElementIds(memo.railingPosts, subIds);
getSubElementIds(memo.railingRailEnds, subIds);
getSubElementIds(memo.railingHandrailEnds, subIds);
getSubElementIds(memo.railingToprailEnds, subIds);
}
if (elem.header.type.typeID == API_CurtainWallID)
{
getSubElementIds(memo.cWallSegments, subIds);
getSubElementIds(memo.cWallFrames, subIds);
getSubElementIds(memo.cWallPanels, subIds);
getSubElementIds(memo.cWallJunctions, subIds);
getSubElementIds(memo.cWallAccessories, subIds);
}
return subIds;
}
#endif
}
@@ -130,12 +194,16 @@ ModelElement::Body* ModelElement::getBody() const {
// Map to collect meshes per material name
std::map<GS::UniString, primitive::Mesh> materialMeshMap;
auto subIds = collectSubIds(getHead().guid);
Int32 nElements = acModel.GetElementCount();
for (Int32 iElement = 1; iElement <= nElements; iElement++)
{
ModelerAPI::Element elem{};
acModel.GetElement(iElement, &elem);
if (elem.GetElemGuid() != getHead().guid)
auto apiGuid = reinterpret_cast<const API_Guid&> (elem.GetElemGuid());
if (subIds.find(apiGuid) == subIds.end())
continue;
Int32 nBodies = elem.GetTessellatedBodyCount();
@@ -26,7 +26,7 @@ namespace {
Identity{"name"},
Identity{"group"},
Identity{"value"},
Identity{"applicationID"},
Identity{"applicationId"},
};
}
@@ -13,6 +13,12 @@
#include "Active/Serialise/XML/Item/XMLDateTime.h"
#include "Speckle/Environment/Platform.h"
#ifdef ARCHICAD
#include "Active/Serialise/JSON/JSONTransport.h"
#include "Active/Utility/BufferOut.h"
#endif
#include <JSON/JDOMWriter.hpp>
#include <JSON/Value.hpp>
@@ -189,14 +195,14 @@ namespace {
switch (item.type().value_or(Item::text)) {
case Item::boolean: {
BoolValue value;
if (!item.write(value))
if (!item.writeSetting(value))
throw std::system_error(makeJSBaseError(badValue));
newValue = new JS::Value(value.operator bool());
break;
}
case Item::number: {
DoubleValue value;
if (!item.write(value))
if (!item.writeSetting(value))
throw std::system_error(makeJSBaseError(badValue));
newValue = new JS::Value(value.operator double());
break;
@@ -208,6 +214,9 @@ namespace {
newValue = new JS::Value(value);
break;
}
case Item::package: {
break; //Not currently considered relevant
}
}
if (destination)
addJSBase(newValue, tag, destination);
@@ -271,19 +280,19 @@ namespace {
throw std::system_error(makeJSBaseError(badSource)); //The source isn't a value
switch (value->GetType()) {
case JS::Value::ValueType::BOOL:
item->read(BoolValue{value->GetBool()});
item->readSetting(BoolValue{value->GetBool()});
break;
case JS::Value::ValueType::INTEGER:
item->read(Int32Value{value->GetInteger()});
item->readSetting(Int32Value{value->GetInteger()});
break;
case JS::Value::ValueType::UINTEGER:
item->read(UInt32Value{value->GetUInteger()});
item->readSetting(UInt32Value{value->GetUInteger()});
break;
case JS::Value::ValueType::DOUBLE:
item->read(DoubleValue{value->GetDouble()});
item->readSetting(DoubleValue{value->GetDouble()});
break;
case JS::Value::ValueType::STRING:
item->read(StringValue{String{value->GetString()}});
item->readSetting(StringValue{String{value->GetString()}});
break;
default:
break;
+10 -10
View File
@@ -15,6 +15,8 @@
210CC89F2C81E34400610F58 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 210CC89D2C81E34400610F58 /* Platform.cpp */; };
210CC8A02C81E34400610F58 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 210CC89E2C81E34400610F58 /* Platform.h */; };
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 */; };
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 */; };
@@ -196,6 +198,8 @@
21329F632BFD452C00B5C7AF /* Environment.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Environment.md; sourceTree = "<group>"; };
21329F642BFD457000B5C7AF /* Event.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Event.md; sourceTree = "<group>"; };
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>"; };
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>"; };
@@ -493,13 +497,6 @@
path = ArchicadDBase;
sourceTree = "<group>";
};
218953A92C0F29FB0078F182 /* EventTests */ = {
isa = PBXGroup;
children = (
);
name = EventTests;
sourceTree = "<group>";
};
219246062CA2D22D00CF5703 /* Element */ = {
isa = PBXGroup;
children = (
@@ -613,7 +610,6 @@
isa = PBXGroup;
children = (
210CC8912C81AEBB00610F58 /* Guid32Tests.cpp */,
218953A92C0F29FB0078F182 /* EventTests */,
);
path = SpeckleLibDoctest;
sourceTree = "<group>";
@@ -911,6 +907,8 @@
2167E2782C4911E2000827D3 /* CMakeLists.txt */,
21F93AEA2B2F406D009A2C5B /* Addon.cpp */,
21F93AE92B2F406D009A2C5B /* Addon.h */,
21384BAA2CCDA9B400D4602B /* Host.cpp */,
21384BA92CCDA9B400D4602B /* Host.h */,
210CC89D2C81E34400610F58 /* Platform.cpp */,
210CC89E2C81E34400610F58 /* Platform.h */,
215F08512C99DA8D00CD343B /* Project.cpp */,
@@ -985,6 +983,7 @@
21D0BDB52C8F8AB60077E104 /* DocumentStoreEngine.h in Headers */,
21A890D02CC1B87C0087E732 /* GenericModelElement.h in Headers */,
21A890C52CC171D80087E732 /* ArchicadPropertyDBaseEngine.h in Headers */,
21384BAB2CCDA9B400D4602B /* Host.h in Headers */,
21D0BDC52C9241940077E104 /* ProjectSubscriber.h in Headers */,
21AE196A2CC57832004DBCFC /* Propertied.h in Headers */,
2196F2EC2CB4816B00450DFC /* ArchicadAttributeDBaseEngine.h in Headers */,
@@ -1177,6 +1176,7 @@
21F69F3B2C6B880C008B6A06 /* JSBaseTransport.cpp in Sources */,
2196F2EB2CB4816B00450DFC /* ArchicadAttributeDBaseEngine.cpp in Sources */,
21AE19532CC273F1004DBCFC /* Template.cpp in Sources */,
21384BAC2CCDA9B400D4602B /* Host.cpp in Sources */,
21A0FC042CBE59A80023F24E /* SegmentedColumn.cpp in Sources */,
210CC89F2C81E34400610F58 /* Platform.cpp in Sources */,
21D0BD202C86F0280077E104 /* AccountDatabase.cpp in Sources */,
@@ -1317,7 +1317,7 @@
LOCALISATION_SUFFIX = "EN-GB";
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
@@ -1414,7 +1414,7 @@
LOCALISATION_SUFFIX = "EN-GB";
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MACOSX_DEPLOYMENT_TARGET = 13.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
NNA_WARNING_CPLUSPLUSFLAGS = "-Wno-deprecated";
+5
View File
@@ -39,13 +39,16 @@
<ClInclude Include="Speckle\Database\Storage\DocumentStore\DocumentStoreCore.h" />
<ClInclude Include="Speckle\Database\Storage\DocumentStore\DocumentStoreEngine.h" />
<ClInclude Include="Speckle\Environment\Addon.h" />
<ClInclude Include="Speckle\Environment\Host.h" />
<ClInclude Include="Speckle\Environment\Platform.h" />
<ClInclude Include="Speckle\Environment\Project.h" />
<ClInclude Include="Speckle\Event\Subscriber\DocStoreSubscriber.h" />
<ClInclude Include="Speckle\Event\Subscriber\ElementSubscriber.h" />
<ClInclude Include="Speckle\Event\Subscriber\MenuSubscriber.h" />
<ClInclude Include="Speckle\Event\Subscriber\ProjectSubscriber.h" />
<ClInclude Include="Speckle\Event\Subscriber\SelectionSubscriber.h" />
<ClInclude Include="Speckle\Event\Type\DocStoreMergeEvent.h" />
<ClInclude Include="Speckle\Event\Type\ElementEvent.h" />
<ClInclude Include="Speckle\Event\Type\MenuEvent.h" />
<ClInclude Include="Speckle\Event\Type\ProjectEvent.h" />
<ClInclude Include="Speckle\Event\Type\SelectionEvent.h" />
@@ -135,9 +138,11 @@
<ClCompile Include="Speckle\Database\Storage\ArchicadDBase\Property\ArchicadPropertyDBaseEngine.cpp" />
<ClCompile Include="Speckle\Database\Storage\DocumentStore\DocumentStoreCore.cpp" />
<ClCompile Include="Speckle\Environment\Addon.cpp" />
<ClCompile Include="Speckle\Environment\Host.cpp" />
<ClCompile Include="Speckle\Environment\Platform.cpp" />
<ClCompile Include="Speckle\Environment\Project.cpp" />
<ClCompile Include="Speckle\Event\Subscriber\DocStoreSubscriber.cpp" />
<ClCompile Include="Speckle\Event\Subscriber\ElementSubscriber.cpp" />
<ClCompile Include="Speckle\Event\Subscriber\MenuSubscriber.cpp" />
<ClCompile Include="Speckle\Event\Subscriber\ProjectSubscriber.cpp" />
<ClCompile Include="Speckle\Event\Subscriber\SelectionSubscriber.cpp" />
+12
View File
@@ -415,6 +415,13 @@
<ClInclude Include="Speckle\Record\Element\BeamSegment.h">
<Filter>Speckle\Record\Element</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>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Speckle\Environment\Addon.cpp">
@@ -630,6 +637,11 @@
<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>
</ItemGroup>
<ItemGroup>
<Text Include="Speckle\CMakeLists.txt">
+3 -3
View File
@@ -1,6 +1,6 @@
#include "ActiveLibDoctest/TestingPlatforms.h"
#include "Speckle/Utility/Guid32.h"
#include "Speckle/Utility/Guid64.h"
using namespace speckle::utility;
@@ -8,8 +8,8 @@ TEST_SUITE(TESTQ(GuidTests)) TEST_SUITE_OPEN
///Tests for creating/modifying guids
TEST_CASE(TESTQ(testGuidContent)) {
Guid32 badGuid{String{"abcd"}};
CHECK_MESSAGE(!badGuid, TEST_MESSAGE(Guid32 created from bad data));
Guid64 badGuid{String{"abcd"}};
CHECK_MESSAGE(!badGuid, TEST_MESSAGE(Guid64 created from bad data));
}
TEST_SUITE_CLOSE