Skip to content

Commit

Permalink
Update main with changes from dev (#2739)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanRynne authored Jul 7, 2023
2 parents 15f0a8c + b5bc2a6 commit f7f6f6e
Show file tree
Hide file tree
Showing 473 changed files with 54,723 additions and 49,890 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,5 @@ speckle-sharp-ci-tools
.circleci/contiuation-config.yml
ConnectorNavisworks/ConnectorNavisworks/Sample Models
ConnectorArchicad/AddOn/Build*
ConnectorArchicad/ConnectorArchicad/Properties
**/dist/

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "Objects/Converters/ConverterRevit/ConverterRevitTests/xUnitRevit"]
path = Objects/Converters/ConverterRevit/ConverterRevitTests/xUnitRevit
url = https://github.com/specklesystems/xUnitRevit.git
353 changes: 351 additions & 2 deletions All.sln

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion All.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@


<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">Speckle:Cleanup</s:String>
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue">ExternalToolData|CSharpier|csharpier||csharpier|$FILE$</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GQL/@EntryIndexedValue">GQL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QL/@EntryIndexedValue">QL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String>
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue">ExternalToolData|CSharpier|csharpier||csharpier|$FILE$</s:String>
<s:String x:Key="/Default/Environment/StructuredLogging/PropertyNamingType/@EntryValue">CamelCase</s:String></wpf:ResourceDictionary>
7 changes: 5 additions & 2 deletions ConnectorArchicad/AddOn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ function (SetCompilerOptions target)
-Wno-reorder
-Wno-overloaded-virtual
-Wno-unused-parameter
-Wno-deprecated-copy
-Wno-deprecated # HashTable.hpp:1752 error: 'sprintf' is deprecated
-Wno-unknown-pragmas
-Wno-missing-braces
-Wno-unused-private-field)
-Wno-unused-private-field
-Wno-shorten-64-to-32 # BrepExternalBufferArray.hpp:34: error: implicit conversion loses integer precision: 'long long' to 'const GS::USize' (aka 'const unsigned int')
)
endif ()
endfunction ()

Expand All @@ -48,6 +50,7 @@ set_property (GLOBAL PROPERTY USE_FOLDERS ON)

set (CMAKE_SUPPRESS_REGENERATION 1)
set (CMAKE_CONFIGURATION_TYPES Debug;Release;RelWithDebInfo)
set (CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
set (AC_API_DEVKIT_DIR $ENV{AC_API_DEVKIT_DIR} CACHE PATH "API DevKit directory.")
set (AC_ADDON_NAME "Speckle Connector" CACHE STRING "Add-On name.")
set (AC_ADDON_LANGUAGE "INT" CACHE STRING "Add-On language code.")
Expand Down
6 changes: 6 additions & 0 deletions ConnectorArchicad/AddOn/Sources/AddOn/AddOnMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Commands/GetWindowData.hpp"
#include "Commands/GetBeamData.hpp"
#include "Commands/GetColumnData.hpp"
#include "Commands/GetElementBaseData.hpp"
#include "Commands/GetObjectData.hpp"
#include "Commands/GetSlabData.hpp"
#include "Commands/GetRoomData.hpp"
Expand Down Expand Up @@ -120,7 +121,11 @@ class AvaloniaProcessManager {

location.AppendToLocal (IO::Name (FolderName));
location.AppendToLocal (IO::Name ("bin"));
#ifdef DEBUG
location.AppendToLocal (IO::Name ("Debug"));
#else
location.AppendToLocal (IO::Name ("Release"));
#endif
location.AppendToLocal (IO::Name ("net6.0"));
location.AppendToLocal (IO::Name (FileName));
}
Expand Down Expand Up @@ -191,6 +196,7 @@ static GSErrCode RegisterAddOnCommands ()
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetSubElementInfo> ()));
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetBeamData> ()));
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetColumnData> ()));
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetElementBaseData> ()));
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetObjectData> ()));
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetRoomData> ()));
CHECKERROR (ACAPI_Install_AddOnCommandHandler (NewOwned<AddOnCommands::GetRoofData> ()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#include "ClassificationImportManager.hpp"


ClassificationImportManager* ClassificationImportManager::instance = nullptr;

ClassificationImportManager* ClassificationImportManager::GetInstance ()
{
if (nullptr == instance) {
instance = new ClassificationImportManager;
}
return instance;
}


void ClassificationImportManager::DeleteInstance ()
{
if (nullptr != instance) {
delete instance;
instance = nullptr;
}
}


ClassificationImportManager::ClassificationImportManager () {}


GSErrCode AddToCache (GS::Array<API_ClassificationItem> items, GS::HashTable<GS::UniString, API_Guid>& cache)
{
for (auto& item : items) {
cache.Add (item.id, item.guid);

GS::Array<API_ClassificationItem> childrenItems;
GSErrCode err = ACAPI_Classification_GetClassificationItemChildren (item.guid, childrenItems);
if (err != NoError)
return err;

AddToCache (childrenItems, cache);
}

return NoError;
}


GSErrCode ClassificationImportManager::GetItem (const GS::UniString& systemName, const GS::UniString& code, API_Guid& itemGuid)
{
GS::ErrCode err = NoError;

if (!cache.ContainsKey (systemName)) {
API_ClassificationSystem targetSystem{};
{
GS::Array<API_ClassificationSystem> systems;
err = ACAPI_Classification_GetClassificationSystems (systems);
if (err != NoError)
return err;

err = Cancel;
for (auto& system : systems) {
if (system.name == systemName) {
targetSystem = system;
err = NoError;
break;
}
}

if (err != NoError)
return err;
}

GS::Array<API_ClassificationItem> rootItems;
err = ACAPI_Classification_GetClassificationSystemRootItems (targetSystem.guid, rootItems);
if (err != NoError)
return err;

GS::HashTable<GS::UniString, API_Guid> systemCache;
AddToCache (rootItems, systemCache);
cache.Add(systemName, systemCache);
}

if (cache[systemName].Get (code, &itemGuid))
return NoError;

return Error;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef CLASSIFICATION_IMPORT_MANAGER_HPP
#define CLASSIFICATION_IMPORT_MANAGER_HPP

#include "ModelInfo.hpp"

class ClassificationImportManager {
private:
static ClassificationImportManager* instance;

GS::HashTable< GS::UniString, GS::HashTable<GS::UniString, API_Guid>> cache;

protected:
ClassificationImportManager ();

public:
ClassificationImportManager (ClassificationImportManager&) = delete;
void operator=(const ClassificationImportManager&) = delete;
static ClassificationImportManager* GetInstance ();
static void DeleteInstance ();

GSErrCode GetItem (const GS::UniString& systemName, const GS::UniString& itemID, API_Guid& itemGuid);
};

#endif
Loading

0 comments on commit f7f6f6e

Please sign in to comment.