ElementHighlighter ensures layers are visible (on request) before selecting target elements
Updates to allow attribute changes to be written Workaround to force VS to recognise template specialisations
This commit is contained in:
@@ -175,6 +175,8 @@
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Receive\Receive.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Receive\ReceiveBridge.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Selection\Arg\SelectionInfo.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Selection\GetSelection.cpp" />
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Selection\SelectionBridge.cpp" />
|
||||
@@ -206,6 +208,7 @@
|
||||
<ClCompile Include="Connector\Record\Model\ModelCard.cpp" />
|
||||
<ClCompile Include="Connector\Record\Model\ReceiverModelCard.cpp" />
|
||||
<ClCompile Include="Connector\Record\Model\SenderModelCard.cpp" />
|
||||
<ClCompile Include="Connector\Tool\ElementHighlighter.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Connector\Connector.h" />
|
||||
@@ -234,6 +237,8 @@
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\UpdateConfig.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Receive\Receive.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Receive\ReceiveBridge.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Selection\Arg\SelectionInfo.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Selection\GetSelection.h" />
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Selection\SelectionBridge.h" />
|
||||
@@ -268,6 +273,7 @@
|
||||
<ClInclude Include="Connector\Record\Model\ModelCard.h" />
|
||||
<ClInclude Include="Connector\Record\Model\ReceiverModelCard.h" />
|
||||
<ClInclude Include="Connector\Record\Model\SenderModelCard.h" />
|
||||
<ClInclude Include="Connector\Tool\ElementHighlighter.h" />
|
||||
<ClInclude Include="Connector\Version.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
|
||||
@@ -74,6 +74,12 @@
|
||||
<Filter Include="Connector\Environment">
|
||||
<UniqueIdentifier>{1d9a10c3-cac6-4b15-afb9-f117b99b3a24}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Interface\Browser\Bridge\Receive">
|
||||
<UniqueIdentifier>{896b7b9b-61d8-46e7-8432-cfbdab4918fb}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Connector\Tool">
|
||||
<UniqueIdentifier>{f9330e8f-8242-4605-b25c-b1ba24451825}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="RFIX.win\Connector.rc2">
|
||||
@@ -98,9 +104,6 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Connector\Connector.cpp">
|
||||
<Filter>Connector</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\ConnectorMenu.cpp">
|
||||
<Filter>Connector\Interface</Filter>
|
||||
</ClCompile>
|
||||
@@ -260,6 +263,18 @@
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Receive\Receive.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Receive</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Interface\Browser\Bridge\Receive\ReceiveBridge.cpp">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Receive</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Tool\ElementHighlighter.cpp">
|
||||
<Filter>Connector\Tool</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Connector\Connector.cpp">
|
||||
<Filter>Connector</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Connector\ConnectorResource.h">
|
||||
@@ -445,5 +460,14 @@
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Config\GetIsDevMode.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Receive\Receive.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Receive</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Interface\Browser\Bridge\Receive\ReceiveBridge.h">
|
||||
<Filter>Connector\Interface\Browser\Bridge\Receive</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Connector\Tool\ElementHighlighter.h">
|
||||
<Filter>Connector\Tool</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -4,12 +4,21 @@
|
||||
#include "Connector/Environment/ConnectorProject.h"
|
||||
#include "Connector/Interface/ConnectorMenu.h"
|
||||
#include "Connector/Interface/ConnectorPalette.h"
|
||||
#include "Connector/Tool/ElementHighlighter.h"
|
||||
#include "Speckle/Database/AccountDatabase.h"
|
||||
#include "Speckle/Environment/Addon.h"
|
||||
#include "Speckle/Utility/String.h"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#ifdef WINDOWS
|
||||
//NB: VS is ignoring template specialisations unless they are explicitly used in the top-level project
|
||||
#include "Active/Setting/Values/GuidValue.h"
|
||||
#include "Active/Setting/Values/TimeValue.h"
|
||||
#include "Active/Setting/Values/StringValue.h"
|
||||
using namespace active::setting;
|
||||
#endif
|
||||
|
||||
using namespace active::file;
|
||||
using namespace active::environment;
|
||||
using namespace connector;
|
||||
@@ -42,6 +51,7 @@ namespace {
|
||||
//Define the connector UI components
|
||||
add<ConnectorMenu>();
|
||||
add<ConnectorPalette>();
|
||||
add<ElementHighlighter>();
|
||||
}
|
||||
|
||||
// MARK: Functions (const)
|
||||
@@ -84,6 +94,18 @@ namespace {
|
||||
return std::nullopt;
|
||||
return Directory{*appData, speckleDataDirName, true};
|
||||
} //getAppDataDirectory
|
||||
|
||||
#ifdef WINDOWS
|
||||
//NB: VS is ignoring template specialisations unless they are explicitly used in the top-level project
|
||||
void invokeSpecialisation() {
|
||||
StringValue stringValue;
|
||||
active::utility::String unusedString = stringValue;
|
||||
GuidValue guidValue;
|
||||
active::utility::Guid unusedGuid = guidValue;
|
||||
TimeValue timeValue;
|
||||
active::utility::Time unusedTime = timeValue;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -93,6 +115,9 @@ namespace {
|
||||
name: The add-on name
|
||||
--------------------------------------------------------------------*/
|
||||
ConnectorAddon::ConnectorAddon(const speckle::utility::String& name) : Addon{name} {
|
||||
#ifdef WINDOWS
|
||||
invokeSpecialisation();
|
||||
#endif
|
||||
} //ConnectorAddon::ConnectorAddon
|
||||
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ enum PromptString {
|
||||
|
||||
//Information strings (in UI content, logging, reports)
|
||||
enum GeneralString {
|
||||
showHiddenLayersID = 1,
|
||||
};
|
||||
|
||||
|
||||
//Notification strings (advice displayed in alerts)
|
||||
enum NotifyString {
|
||||
showHiddenLayersID = 1,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#include "Active/Setting/ValueSetting.h"
|
||||
#include "Active/Setting/Values/GuidValue.h"
|
||||
#include "Active/Event/Event.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Base/HighlightModel.h"
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/ConnectorResource.h"
|
||||
#include "Connector/Environment/ConnectorProject.h"
|
||||
#include "Connector/Event/ConnectorEventID.h"
|
||||
#include "Connector/Database/ModelCardDatabase.h"
|
||||
#include "Connector/Interface/Browser/Bridge/Send/Arg/SendError.h"
|
||||
#include "Connector/Record/Model/SenderModelCard.h"
|
||||
@@ -12,6 +16,8 @@
|
||||
#include "Speckle/Environment/Host.h"
|
||||
#include "Speckle/Environment/Project.h"
|
||||
|
||||
using namespace active::event;
|
||||
using namespace active::setting;
|
||||
using namespace connector::environment;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace connector::record;
|
||||
@@ -46,13 +52,9 @@ void HighlightModel::run(const String& modelCardID) const {
|
||||
return;
|
||||
}
|
||||
if (auto senderCard = dynamic_cast<SenderModelCard*>(modelCard.get())) {
|
||||
auto modelCardSelection = senderCard->getFilter().getElementIDs();
|
||||
auto project = connector()->getActiveProject().lock();
|
||||
if (!project)
|
||||
return; // TODO: is this OK? should this throw?
|
||||
auto elementDatabase = project->getElementDatabase();
|
||||
elementDatabase->clearSelection();
|
||||
elementDatabase->setSelection(modelCardSelection);
|
||||
host()->zoomToFit(true);
|
||||
ValueSetting elementIDs{recordLinks};
|
||||
for (const auto& elementID : senderCard->getFilter().getElementIDs())
|
||||
elementIDs.emplace_back(GuidValue{elementID});
|
||||
connector()->publish(Event{setElementHighlight, { elementIDs }});
|
||||
}
|
||||
} //HighlightModel::run
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "Connector/Interface/Browser/Bridge/Base/HighlightObjects.h"
|
||||
|
||||
#include "Active/Setting/ValueSetting.h"
|
||||
#include "Active/Event/Event.h"
|
||||
#include "Connector/Connector.h"
|
||||
#include "Connector/Environment/ConnectorProject.h"
|
||||
#include "Speckle/Database/BIMElementDatabase.h"
|
||||
#include "Speckle/Environment/Host.h"
|
||||
#include "Speckle/Environment/Project.h"
|
||||
#include "Connector/Event/ConnectorEventID.h"
|
||||
|
||||
using namespace connector::environment;
|
||||
using namespace active::event;
|
||||
using namespace active::setting;
|
||||
using namespace connector;
|
||||
using namespace connector::interfac::browser::bridge;
|
||||
using namespace speckle::database;
|
||||
using namespace speckle::environment;
|
||||
@@ -26,18 +27,5 @@ HighlightObjects::HighlightObjects() : BridgeMethod{"HighlightObjects", [&](cons
|
||||
objectIDs: List of object IDs to be highlighted
|
||||
--------------------------------------------------------------------*/
|
||||
void HighlightObjects::run(const StringList& objectIDs) const {
|
||||
BIMLinkList objectSelection;
|
||||
for (const auto& text : objectIDs)
|
||||
if (Guid guid{text}; !guid.empty())
|
||||
objectSelection.emplace_back(guid);
|
||||
if (objectSelection.empty())
|
||||
return;
|
||||
auto project = connector()->getActiveProject().lock();
|
||||
auto connectorProject = dynamic_cast<ConnectorProject*>(project.get());
|
||||
if (!connectorProject)
|
||||
return;
|
||||
auto elementDatabase = project->getElementDatabase();
|
||||
elementDatabase->clearSelection();
|
||||
elementDatabase->setSelection(objectSelection);
|
||||
host()->zoomToFit(true);
|
||||
connector()->publish(Event{setElementHighlight, { ValueSetting{objectIDs, recordLinks} }});
|
||||
} //HighlightObjects::run
|
||||
|
||||
@@ -24,7 +24,7 @@ SelectionBridge::SelectionBridge() : BrowserBridge{"selectionBinding"} {
|
||||
--------------------------------------------------------------------*/
|
||||
bool SelectionBridge::handle(const speckle::event::SelectionEvent& event) {
|
||||
auto selectionInfo = std::make_unique<SelectionInfo>();
|
||||
auto wrapped = std::make_unique<CargoHold<PackageWrap, SelectionInfo>>(std::move(selectionInfo));
|
||||
auto wrapped = std::make_unique<CargoHold<PackageWrap, SelectionInfo>>(std::move(selectionInfo));
|
||||
sendEvent("setSelection", std::move(wrapped));
|
||||
return true;
|
||||
} //SelectionBridge::handle
|
||||
|
||||
@@ -86,11 +86,11 @@ Subscriber::Subscription ElementHighlighter::subscription() const {
|
||||
bool ElementHighlighter::receive(const active::event::Event& event) {
|
||||
//Collect the IDs of elements to be highlighted
|
||||
ValueSetting* elementIDs = nullptr;
|
||||
if (elementIDs = event.findValue(recordLinks); elementIDs != nullptr)
|
||||
if (elementIDs = event.findValue(recordLinks); elementIDs == nullptr)
|
||||
return false;
|
||||
BIMLinkList elementSelection;
|
||||
for (const auto& value : *elementIDs)
|
||||
if (Guid guid{*value}; guid)
|
||||
if (Guid guid{value->operator active::utility::Guid()}; guid)
|
||||
elementSelection.emplace_back(guid);
|
||||
if (elementSelection.empty())
|
||||
return false;
|
||||
@@ -101,7 +101,8 @@ bool ElementHighlighter::receive(const active::event::Event& event) {
|
||||
auto elementDatabase = project->getElementDatabase();
|
||||
//Collect the layers assigned to the model card elements
|
||||
ElementVisibilityCollector collector;
|
||||
elementDatabase->findElements(collector, elementSelection);
|
||||
BIMElementDatabase::Filter filter = [&collector](const speckle::record::element::Element& elem) { return collector(elem); };
|
||||
elementDatabase->findElements(&filter, elementSelection);
|
||||
//If any collected layers are hidden, the useer is prompted to show them (otherwise they may see nothing happen when a model card is clicked)
|
||||
for (const auto& layer : collector.getLayers()) {
|
||||
if (layer.second.isHidden()) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
'STR#' 32602 "Notify strings" {
|
||||
/* [ 1] */ "No objects were found to convert. Please update your publish filter!"
|
||||
/* [ 1] */ "Some elements published with the selected model card are on hidden layers - do you wish to make these layers visible?"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void BIMElementDatabase::clearSelection() const {
|
||||
|
||||
return: A list containing IDs of found elements (empty if none found)
|
||||
--------------------------------------------------------------------*/
|
||||
BIMRecordIDList BIMElementDatabase::findElements(const Filter& filter, const BIMRecordIDList& subset, std::optional<BIMRecordID> tableID,
|
||||
BIMRecordIDList BIMElementDatabase::findElements(const Filter* filter, const BIMRecordIDList& subset, std::optional<BIMRecordID> tableID,
|
||||
std::optional<BIMRecordID> documentID) const {
|
||||
return m_engine->findObjects(filter, subset, tableID, documentID);
|
||||
} //BIMElementDatabase::findElements
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return A list containing IDs of found elements (empty if none found)
|
||||
*/
|
||||
BIMRecordIDList findElements(const Filter& filter = nullptr, const BIMRecordIDList& subset = {},
|
||||
BIMRecordIDList findElements(const Filter* filter = nullptr, const BIMRecordIDList& subset = {},
|
||||
std::optional<BIMRecordID> tableID = std::nullopt, std::optional<BIMRecordID> documentID = std::nullopt) const;
|
||||
/*!
|
||||
Get a specified element
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ active::container::Vector<Attribute> ArchicadAttributeDBaseEngine::getObjects(co
|
||||
--------------------------------------------------------------------*/
|
||||
void ArchicadAttributeDBaseEngine::write(Attribute& object, const BIMRecordID& objID, std::optional<BIMRecordID> objDocID,
|
||||
std::optional<BIMRecordID> tableID, std::optional<BIMRecordID> documentID) const {
|
||||
auto attributeData = object.getData();
|
||||
auto attributeData = object.getDataOut();
|
||||
//An record with no index has not been written (and needs to be created in the dbase)
|
||||
GSErrCode status = NoError;
|
||||
#ifdef ServerMainVers_2700
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return A list containing IDs of found elements (empty if none found)
|
||||
*/
|
||||
virtual ObjIDList findObjects(const Filter& filter = nullptr, const ObjIDList& subset = {},
|
||||
virtual ObjIDList findObjects(const Filter* filter = nullptr, const ObjIDList& subset = {},
|
||||
std::optional<BIMRecordID> tableID = std::nullopt,
|
||||
std::optional<BIMRecordID> documentID = std::nullopt) const override { return {}; } //Implement when required
|
||||
/*!
|
||||
|
||||
+5
-3
@@ -308,7 +308,7 @@ void ArchicadElementDBaseEngine::setDefaultTable(const BIMRecordID& tableID) con
|
||||
|
||||
return: A list containing IDs of found elements (empty if none found)
|
||||
--------------------------------------------------------------------*/
|
||||
BIMRecordIDList ArchicadElementDBaseEngine::findObjects(const Filter& filter, const BIMRecordIDList& subset, std::optional<BIMRecordID> tableID,
|
||||
BIMRecordIDList ArchicadElementDBaseEngine::findObjects(const Filter* filter, const BIMRecordIDList& subset, std::optional<BIMRecordID> tableID,
|
||||
std::optional<BIMRecordID> documentID) const {
|
||||
//Switch to the target table (when specified). Otherwise the currently active table will be used
|
||||
if (tableID)
|
||||
@@ -328,8 +328,10 @@ BIMRecordIDList ArchicadElementDBaseEngine::findObjects(const Filter& filter, co
|
||||
}
|
||||
//Run the filter on the specified elements
|
||||
for (const auto& elemID : *source) {
|
||||
if (auto element = getObject(elemID); element && filter(*element))
|
||||
result.insert(elemID);
|
||||
if (auto element = getObject(elemID); element) {
|
||||
if ((*filter)(*element))
|
||||
result.insert(elemID);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} //ArchicadElementDBaseEngine::findObjects
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return A list containing IDs of found elements (empty if none found)
|
||||
*/
|
||||
virtual BIMRecordIDList findObjects(const Filter& filter = nullptr, const BIMRecordIDList& subset = {},
|
||||
virtual BIMRecordIDList findObjects(const Filter* filter = nullptr, const BIMRecordIDList& subset = {},
|
||||
std::optional<BIMRecordID> tableID = std::nullopt,
|
||||
std::optional<BIMRecordID> documentID = std::nullopt) const override;
|
||||
/*!
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return A list containing IDs of found elements (empty if none found)
|
||||
*/
|
||||
virtual ObjIDList findObjects(const Filter& filter = nullptr, const ObjIDList& subset = {},
|
||||
virtual ObjIDList findObjects(const Filter* filter = nullptr, const ObjIDList& subset = {},
|
||||
std::optional<BIMRecordID> tableID = std::nullopt,
|
||||
std::optional<BIMRecordID> documentID = std::nullopt) const override { return {}; } //Implement when required
|
||||
/*!
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return A list containing IDs of found elements (empty if none found)
|
||||
*/
|
||||
virtual ObjIDList findObjects(const Filter& filter = nullptr, const ObjIDList& subset = {}, std::optional<BIMRecordID> tableID = std::nullopt,
|
||||
virtual ObjIDList findObjects(const Filter* filter = nullptr, const ObjIDList& subset = {}, std::optional<BIMRecordID> tableID = std::nullopt,
|
||||
std::optional<BIMRecordID> documentID = std::nullopt) const override { return {}; } //Implement when required
|
||||
/*!
|
||||
Find all property templates linked to specified classifications
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace speckle::database {
|
||||
@param documentID Optional document ID (filter for this document only - nullopt = all objects)
|
||||
@return A list containing IDs of found elements (empty if none found)
|
||||
*/
|
||||
virtual ObjIDList findObjects(const Filter& filter = nullptr, const ObjIDList& subset = {}, std::optional<RecordID> tableID = std::nullopt,
|
||||
virtual ObjIDList findObjects(const Filter* filter = nullptr, const ObjIDList& subset = {}, std::optional<RecordID> tableID = std::nullopt,
|
||||
std::optional<RecordID> documentID = std::nullopt) const override { return {}; } //Implement when required
|
||||
/*!
|
||||
Get an object by index
|
||||
|
||||
@@ -107,8 +107,8 @@ bool Host::displayConfirmation(const speckle::utility::String& question,
|
||||
const speckle::utility::String::Option negativeOption) const {
|
||||
#ifdef ARCHICAD
|
||||
String positivePrompt{positiveOption.value_or(addon()->getLocalString(titleStringLib, positiveResponseTitleID))},
|
||||
negativePrompt{positiveOption.value_or(addon()->getLocalString(titleStringLib, positiveResponseTitleID))};
|
||||
return (DGAlert(DG_WARNING, addon()->getLocalString(titleStringLib, confirmDialogTitleID), question, positivePrompt, negativePrompt) == 1);
|
||||
negativePrompt{positiveOption.value_or(addon()->getLocalString(titleStringLib, negativeResponseTitleID))};
|
||||
return (DGAlert(DG_WARNING, addon()->getLocalString(titleStringLib, confirmDialogTitleID), question, String{}, positivePrompt, negativePrompt) == 1);
|
||||
#endif
|
||||
} //Host::displayConfirmation
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ namespace speckle::interfac::browser {
|
||||
//Process any returned result into the binding value type
|
||||
auto processResult = [&, transport](Return* outgoing) -> typename Binding::ValueType {
|
||||
if constexpr(!std::is_same<Return, void>::value) {
|
||||
if (outgoing == nullptr)
|
||||
throw; //NB: Throw a system exception here in future with a defined error
|
||||
typename Binding::ValueType result;
|
||||
transport.send(std::move(*outgoing), active::serialise::Identity{}, result);
|
||||
return result;
|
||||
|
||||
@@ -117,6 +117,11 @@ namespace speckle::record::attribute {
|
||||
@return The attribute data (for internal use to populate derived classes)
|
||||
*/
|
||||
API_Attribute getData() const;
|
||||
/*!
|
||||
Get the attribute data to be written to the database
|
||||
@return The attribute data (for internal use to write to the database)
|
||||
*/
|
||||
virtual API_Attribute getDataOut() const = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -275,6 +275,20 @@ bool Finish::validate() {
|
||||
} //Finish::validate
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the attribute data to be written to the database
|
||||
|
||||
return: The attribute data (for internal use to write to the database)
|
||||
--------------------------------------------------------------------*/
|
||||
API_Attribute Finish::getDataOut() const {
|
||||
confirmData();
|
||||
API_Attribute result;
|
||||
active::utility::Memory::erase(result);
|
||||
result.material = m_data->root;
|
||||
return result;
|
||||
} //Finish::getDataOut
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
@@ -135,7 +135,14 @@ namespace speckle::record::attribute {
|
||||
@return True if the data has been validated
|
||||
*/
|
||||
bool validate() override;
|
||||
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Get the attribute data to be written to the database
|
||||
@return The attribute data (for internal use to write to the database)
|
||||
*/
|
||||
API_Attribute getDataOut() const override;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
|
||||
@@ -125,6 +125,7 @@ Layer& Layer::operator=(const Layer& source) {
|
||||
return: True if the layer is hidden
|
||||
--------------------------------------------------------------------*/
|
||||
bool Layer::isHidden() const {
|
||||
confirmData();
|
||||
return m_data->isHidden;
|
||||
} //Layer::isHidden
|
||||
|
||||
@@ -135,6 +136,7 @@ bool Layer::isHidden() const {
|
||||
return: True if the layer is locked
|
||||
--------------------------------------------------------------------*/
|
||||
bool Layer::isLocked() const {
|
||||
confirmData();
|
||||
return m_data->isLocked;
|
||||
} //Layer::isLocked
|
||||
|
||||
@@ -158,6 +160,7 @@ const API_Attr_Head& Layer::getHead() const {
|
||||
state: True if the layer is hidden
|
||||
--------------------------------------------------------------------*/
|
||||
void Layer::setHidden(bool state) {
|
||||
confirmData();
|
||||
m_data->isHidden = state;
|
||||
#ifdef ARCHICAD
|
||||
if (state)
|
||||
@@ -174,6 +177,7 @@ void Layer::setHidden(bool state) {
|
||||
state: True if the layer is locked
|
||||
--------------------------------------------------------------------*/
|
||||
void Layer::setLocked(bool state) {
|
||||
confirmData();
|
||||
m_data->isLocked = state;
|
||||
#ifdef ARCHICAD
|
||||
if (state)
|
||||
@@ -265,6 +269,20 @@ bool Layer::validate() {
|
||||
} //Layer::validate
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the attribute data to be written to the database
|
||||
|
||||
return: The attribute data (for internal use to write to the database)
|
||||
--------------------------------------------------------------------*/
|
||||
API_Attribute Layer::getDataOut() const {
|
||||
confirmData();
|
||||
API_Attribute result;
|
||||
active::utility::Memory::erase(result);
|
||||
result.layer = m_data->root;
|
||||
return result;
|
||||
} //Layer::getDataOut
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
@@ -150,7 +150,14 @@ namespace speckle::record::attribute {
|
||||
@return True if the data has been validated
|
||||
*/
|
||||
bool validate() override;
|
||||
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Get the attribute data to be written to the database
|
||||
@return The attribute data (for internal use to write to the database)
|
||||
*/
|
||||
API_Attribute getDataOut() const override;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
|
||||
@@ -186,6 +186,20 @@ void Material::setDefault() {
|
||||
} //Material::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the attribute data to be written to the database
|
||||
|
||||
return: The attribute data (for internal use to write to the database)
|
||||
--------------------------------------------------------------------*/
|
||||
API_Attribute Material::getDataOut() const {
|
||||
confirmData();
|
||||
API_Attribute result;
|
||||
active::utility::Memory::erase(result);
|
||||
result.buildingMaterial = m_data->root;
|
||||
return result;
|
||||
} //Material::getDataOut
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
@@ -126,7 +126,14 @@ namespace speckle::record::attribute {
|
||||
Set to the default package content
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Get the attribute data to be written to the database
|
||||
@return The attribute data (for internal use to write to the database)
|
||||
*/
|
||||
API_Attribute getDataOut() const override;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
|
||||
@@ -185,6 +185,18 @@ void Storey::setDefault() {
|
||||
} //Storey::setDefault
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Get the attribute data to be written to the database
|
||||
|
||||
return: The attribute data (for internal use to write to the database)
|
||||
--------------------------------------------------------------------*/
|
||||
API_Attribute Storey::getDataOut() const {
|
||||
API_Attribute result;
|
||||
active::utility::Memory::erase(result);
|
||||
return result;
|
||||
} //Storey::getDataOut
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
--------------------------------------------------------------------*/
|
||||
|
||||
@@ -104,6 +104,13 @@ namespace speckle::record::attribute {
|
||||
*/
|
||||
void setDefault() override;
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Get the attribute data to be written to the database
|
||||
@return The attribute data (for internal use to write to the database)
|
||||
*/
|
||||
API_Attribute getDataOut() const override;
|
||||
|
||||
private:
|
||||
/*!
|
||||
Confirm the internal data, either loading from the BIM application or setting a default
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace {
|
||||
isWrapperTag = !identity.name.empty() && !inventory.begin()->identity().name.empty() && (inventory.begin()->identity() != identity);
|
||||
}
|
||||
auto sequence = inventory.sequence();
|
||||
auto container = destination;
|
||||
auto container{destination};
|
||||
if (isWrapperTag) {
|
||||
auto containerType = cargo.entryType().value_or((inventory.size() == 1) && !(inventory.begin()->maximum() == 1) ?
|
||||
Entry::Type::array : Entry::Type::element);
|
||||
@@ -411,7 +411,7 @@ namespace {
|
||||
destination = container;
|
||||
}
|
||||
for (auto& entry : sequence) {
|
||||
auto item = *entry.second;
|
||||
auto item{*entry.second};
|
||||
if (!item.required)
|
||||
continue;
|
||||
//Each cargo container may contain multiple export items
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
<ClInclude Include="Speckle\Primitive\Mesh\Mesh.h" />
|
||||
<ClInclude Include="Speckle\Record\Attribute\Attribute.h" />
|
||||
<ClInclude Include="Speckle\Record\Attribute\Finish.h" />
|
||||
<ClInclude Include="Speckle\Record\Attribute\Layer.h" />
|
||||
<ClInclude Include="Speckle\Record\Attribute\Material.h" />
|
||||
<ClInclude Include="Speckle\Record\Attribute\Storey.h" />
|
||||
<ClInclude Include="Speckle\Record\Classification\Classified.h" />
|
||||
@@ -162,6 +163,7 @@
|
||||
<ClInclude Include="Speckle\Record\Element\StairStructure.h" />
|
||||
<ClInclude Include="Speckle\Record\Element\StairTread.h" />
|
||||
<ClInclude Include="Speckle\Record\Element\Wall.h" />
|
||||
<ClInclude Include="Speckle\Record\Filter\ElementVisibilityCollector.h" />
|
||||
<ClInclude Include="Speckle\Record\Property\Group.h" />
|
||||
<ClInclude Include="Speckle\Record\Property\Propertied.h" />
|
||||
<ClInclude Include="Speckle\Record\Property\Property.h" />
|
||||
@@ -228,6 +230,7 @@
|
||||
<ClCompile Include="Speckle\Primitive\Mesh\Mesh.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Attribute\Attribute.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Attribute\Finish.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Attribute\Layer.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Attribute\Material.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Attribute\Storey.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Classification\Classified.cpp" />
|
||||
@@ -267,6 +270,7 @@
|
||||
<ClCompile Include="Speckle\Record\Element\StairStructure.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Element\StairTread.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Element\Wall.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Filter\ElementVisibilityCollector.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Property\Group.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Property\Propertied.cpp" />
|
||||
<ClCompile Include="Speckle\Record\Property\Property.cpp" />
|
||||
|
||||
@@ -128,6 +128,9 @@
|
||||
<Filter Include="Speckle\Interface\Component">
|
||||
<UniqueIdentifier>{ccb4ca39-1960-4590-ad5a-8f9092924778}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Speckle\Record\Filter">
|
||||
<UniqueIdentifier>{e6e7128b-795b-441c-9ea6-051c99a0343d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Speckle\Environment\Addon.h">
|
||||
@@ -502,6 +505,12 @@
|
||||
<ClInclude Include="Speckle\Record\Element\Interface\Treads.h">
|
||||
<Filter>Speckle\Record\Element\Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Record\Attribute\Layer.h">
|
||||
<Filter>Speckle\Record\Attribute</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Speckle\Record\Filter\ElementVisibilityCollector.h">
|
||||
<Filter>Speckle\Record\Filter</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Speckle\Environment\Addon.cpp">
|
||||
@@ -783,6 +792,12 @@
|
||||
<ClCompile Include="Speckle\Record\Element\Interface\Treads.cpp">
|
||||
<Filter>Speckle\Record\Element\Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Record\Attribute\Layer.cpp">
|
||||
<Filter>Speckle\Record\Attribute</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Speckle\Record\Filter\ElementVisibilityCollector.cpp">
|
||||
<Filter>Speckle\Record\Filter</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="Speckle\CMakeLists.txt">
|
||||
|
||||
Reference in New Issue
Block a user