├── core.txt ├── dependants.txt ├── lib ├── Script.dll └── Interop.Gsa_8_7.dll ├── dependencies.txt ├── Grasshopper_UI ├── Properties │ └── Resources │ │ ├── DOF.png │ │ ├── Data.png │ │ ├── Enum.png │ │ ├── Move.png │ │ ├── Pull.png │ │ ├── Push.png │ │ ├── Type.png │ │ ├── bar.png │ │ ├── node.png │ │ ├── Delete.png │ │ ├── Modify.png │ │ ├── Query.png │ │ ├── ToJson.png │ │ ├── gator.png │ │ ├── Adapter.png │ │ ├── BHoM_Logo.png │ │ ├── BS_Script.png │ │ ├── Compute.png │ │ ├── Convert.png │ │ ├── Execute.png │ │ ├── Explode.png │ │ ├── FromJson.png │ │ ├── VS_Script.png │ │ ├── skeleton.png │ │ ├── BHoM_Filter.png │ │ ├── BHoM_ToJSON.png │ │ ├── CreateBHoM.png │ │ ├── Dictionary.png │ │ ├── Enum_Param.png │ │ ├── ItemAccess.png │ │ ├── ListAccess.png │ │ ├── TreeAccess.png │ │ ├── Type_Param.png │ │ ├── UISettings.png │ │ ├── VBH_Script.png │ │ ├── BHoM_App_Clean.png │ │ ├── BHoM_App_Close.png │ │ ├── BHoM_App_Run.png │ │ ├── BHoM_App_Save.png │ │ ├── BHoM_FromJSON.png │ │ ├── BHoM_Material.png │ │ ├── ClusterToNode.png │ │ ├── CustomObject.png │ │ ├── IObject_Param.png │ │ ├── QueryAdapter.png │ │ ├── UpdateProperty.png │ │ ├── Variable_Param.png │ │ ├── BHoMObject_Param.png │ │ ├── BHoM_BHoM_Object.png │ │ ├── BHoM_GetProperty.png │ │ ├── BHoM_SetProperty.png │ │ ├── Dictionary_Param.png │ │ ├── BHoMAdapter_Param.png │ │ ├── BHoM_Run_Analasis.png │ │ ├── IBHoMGeometry_Param.png │ │ ├── BHoM_GetPropertyNames.png │ │ ├── BHoM_Grasshopper_Icon.png │ │ ├── BHoM_Read _CustomData.png │ │ └── BHoM_Create_CustomData.png ├── Components │ ├── Engine │ │ ├── External.cs │ │ ├── Query.cs │ │ ├── Compute.cs │ │ ├── Convert.cs │ │ ├── GetInfo.cs │ │ ├── Modify.cs │ │ ├── ToJson.cs │ │ ├── FromJson.cs │ │ ├── GetEvents.cs │ │ ├── GetProperty.cs │ │ ├── SetProperty.cs │ │ └── Explode.cs │ ├── Adapter │ │ ├── Move.cs │ │ ├── Pull.cs │ │ ├── Execute.cs │ │ ├── Remove.cs │ │ ├── CreateAdapter.cs │ │ ├── CreateRequest.cs │ │ └── Push.cs │ ├── UI │ │ ├── UnitTest.cs │ │ └── FalseStartToggle.cs │ ├── oM │ │ ├── CreateDictionary.cs │ │ ├── CreateObject.cs │ │ ├── CreateCustom.cs │ │ ├── CreateEnum.cs │ │ ├── CreateData.cs │ │ └── CreateType.cs │ └── Parameters │ │ ├── Param_Enum.cs │ │ ├── Param_Type.cs │ │ ├── Param_Dictionary.cs │ │ ├── Param_BHoMAdapter.cs │ │ ├── Param_IObject.cs │ │ ├── Param_BHoMGeometry.cs │ │ └── Param_BHoMObject.cs ├── Templates │ ├── IBHoMParam.cs │ └── BakeableParam.cs ├── CustomAttributes │ ├── FalseStartToggleAttributes.cs │ └── PrototypeAttribute.cs ├── Render │ ├── RenderColour.cs │ └── RenderMaterial.cs ├── Hints │ ├── TypeHint.cs │ ├── EnumHint.cs │ ├── DictionaryHint.cs │ ├── BHomObjectHint.cs │ └── IGeometryHint.cs ├── Global │ └── WireInfo.cs ├── CallerComponent │ ├── IGH_InitCodeAware.cs │ └── OnGHParamChanged.cs ├── Helpers │ └── AvailableHints.cs └── Goos │ ├── GH_Dictionary.cs │ ├── GH_IObject.cs │ ├── GH_BHoMAdapter.cs │ ├── GH_BHoMObject.cs │ ├── GH_Enum.cs │ └── GH_BHoMGoo.cs ├── GHManipulator_Alligator ├── packages.config ├── app.config └── AssemblyInfo.cs ├── .github ├── ISSUE_TEMPLATE │ ├── 03_documentation.md │ ├── 01_feature_request.md │ ├── 02_test_script.md │ ├── 04_compliance.md │ ├── 06_question.md │ ├── 00_bug.md │ └── 05_external_api_changes.md └── PULL_REQUEST_TEMPLATE.md ├── .ci ├── CloneTest.ps1 ├── check-installer.yml ├── check-core.yml ├── run-compliance-tests.yml ├── check-all-depandants.yml └── testSettings.runsettings ├── Grasshopper_Engine ├── app.config ├── Query │ ├── CanvasFilePath.cs │ └── CanvasID.cs ├── Convert │ ├── ToRhino.cs │ ├── ToType.cs │ └── ToNodeParam.cs ├── Create │ └── DataTree.cs └── Grasshopper_Engine.csproj ├── .gitignore ├── Grasshopper_oM ├── Grasshopper_oM.csproj └── UISettings.cs ├── Grasshopper_UI.sln └── README.md /core.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dependants.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Script.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/lib/Script.dll -------------------------------------------------------------------------------- /lib/Interop.Gsa_8_7.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/lib/Interop.Gsa_8_7.dll -------------------------------------------------------------------------------- /dependencies.txt: -------------------------------------------------------------------------------- 1 | BHoM/BHoM 2 | BHoM/BHoM_Engine 3 | BHoM/BHoM_Adapter 4 | BHoM/CSharp_Toolkit 5 | BHoM/BHoM_UI 6 | BHoM/Rhinoceros_Toolkit -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/DOF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/DOF.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Data.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Enum.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Move.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Pull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Pull.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Push.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Type.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/bar.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/node.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Delete.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Modify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Modify.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Query.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/ToJson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/ToJson.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/gator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/gator.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Adapter.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Logo.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BS_Script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BS_Script.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Compute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Compute.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Convert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Convert.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Execute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Execute.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Explode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Explode.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/FromJson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/FromJson.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/VS_Script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/VS_Script.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/skeleton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/skeleton.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Filter.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_ToJSON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_ToJSON.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/CreateBHoM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/CreateBHoM.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Dictionary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Dictionary.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Enum_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Enum_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/ItemAccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/ItemAccess.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/ListAccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/ListAccess.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/TreeAccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/TreeAccess.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Type_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Type_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/UISettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/UISettings.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/VBH_Script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/VBH_Script.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_App_Clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_App_Clean.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_App_Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_App_Close.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_App_Run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_App_Run.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_App_Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_App_Save.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_FromJSON.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_FromJSON.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Material.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/ClusterToNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/ClusterToNode.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/CustomObject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/CustomObject.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/IObject_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/IObject_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/QueryAdapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/QueryAdapter.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/UpdateProperty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/UpdateProperty.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Variable_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Variable_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoMObject_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoMObject_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_BHoM_Object.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_BHoM_Object.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_GetProperty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_GetProperty.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_SetProperty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_SetProperty.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/Dictionary_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/Dictionary_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoMAdapter_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoMAdapter_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Run_Analasis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Run_Analasis.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/IBHoMGeometry_Param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/IBHoMGeometry_Param.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_GetPropertyNames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_GetPropertyNames.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Grasshopper_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Grasshopper_Icon.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Read _CustomData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Read _CustomData.png -------------------------------------------------------------------------------- /Grasshopper_UI/Properties/Resources/BHoM_Create_CustomData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BHoM/Grasshopper_UI/HEAD/Grasshopper_UI/Properties/Resources/BHoM_Create_CustomData.png -------------------------------------------------------------------------------- /GHManipulator_Alligator/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /GHManipulator_Alligator/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/03_documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation 3 | about: Highlight missing or incorrect documentation in the code or in the website and wiki. 4 | labels: "type:documentation" 5 | 6 | --- 7 | 8 | 9 | 10 | #### What is missing/incorrect? 11 | 12 | -------------------------------------------------------------------------------- /.ci/CloneTest.ps1: -------------------------------------------------------------------------------- 1 | Param([string]$repo) 2 | 3 | # **** Cloning BHoM Test_Toolkit **** 4 | $repo = "Test_Toolkit" 5 | 6 | # **** Defining Paths **** 7 | $slnPath = "$ENV:BUILD_SOURCESDIRECTORY\$repo\$repo.sln" 8 | 9 | # **** Cloning Repo **** 10 | Write-Output ("Cloning " + $repo + " to " + $ENV:BUILD_SOURCESDIRECTORY + "\" + $repo) 11 | git clone -q --branch=master https://github.com/BHoM/$repo.git $ENV:BUILD_SOURCESDIRECTORY\$repo 12 | 13 | # **** Restore NuGet **** 14 | Write-Output ("Restoring NuGet packages for " + $repo) 15 | & NuGet.exe restore $slnPath -------------------------------------------------------------------------------- /Grasshopper_Engine/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/01_feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest ideas for new functionality, or enhancement of existing. 4 | labels: "type:feature" 5 | 6 | --- 7 | 8 | 9 | 10 | #### Description: 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/02_test_script.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Test Script 3 | about: Creation of a unit test is required to check functionality, test use cases or validity of a specific part of the code. 4 | labels: "type:test-script" 5 | 6 | --- 7 | 8 | 9 | 10 | #### Definition of the test : 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/04_compliance.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Compliance 3 | about: Report code that doesn't follow the BHoM guidelines. 4 | labels: "type:compliance" 5 | 6 | --- 7 | 8 | 9 | 10 | #### Broken rules: 11 | 12 | 13 | 14 | #### Suggestions to restore compliance: 15 | 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/06_question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about any aspect of the BHoM code or toolkits. Equally do feel free to reach out on Slack with queries and for wider discussions. Link and open invite can be found on https://bhom.xyz 4 | labels: "type:question" 5 | 6 | --- 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/00_bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Report an error, performance issue or unexpected behaviour. 4 | labels: "type:bug" 5 | 6 | --- 7 | 8 | 9 | 10 | #### Description: 11 | 12 | 13 | 14 | #### Steps to reproduce: 15 | 16 | 17 | 18 | #### Expected behaviour: 19 | 20 | 21 | 22 | #### Test file(s): 23 | 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/05_external_api_changes.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: External API Changes 3 | about: Modifications to the code are required due to changes to the API of a referenced library. This includes changes imposed from references to other BHoM projects. 4 | labels: "type:external-api-changes" 5 | 6 | --- 7 | 8 | 9 | 10 | #### Parent issue(s) or Pull Request(s) causing the changes: 11 | 12 | 13 | # 14 | 15 | #### Description: 16 | 17 | 18 | 19 | #### Test file(s): 20 | 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### NOTE: Depends on 5 | 6 | 7 | 8 | 9 | ### Issues addressed by this PR 10 | 11 | 12 | Closes # 13 | 14 | 15 | 16 | 17 | ### Test files 18 | 19 | 20 | 21 | ### Changelog 22 | 23 | 24 | 25 | 26 | ### Additional comments 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.exe 6 | *.o 7 | *.so 8 | 9 | # Packages # 10 | ############ 11 | # it's better to unpack these files and commit the raw source 12 | # git has its own built in compression methods 13 | *.7z 14 | *.dmg 15 | *.gz 16 | *.iso 17 | *.jar 18 | *.rar 19 | *.tar 20 | *.zip 21 | 22 | # Logs and databases # 23 | ###################### 24 | *.log 25 | *.sql 26 | *.sqlite 27 | 28 | # OS generated files # 29 | ###################### 30 | .DS_Store 31 | .DS_Store? 32 | ._* 33 | .Spotlight-V100 34 | .Trashes 35 | ehthumbs.db 36 | Thumbs.db 37 | 38 | 39 | # build folders # 40 | ############### 41 | [Dd]ebug/ 42 | [Dd]ebugPublic/ 43 | [Rr]elease/ 44 | [Rr]eleases/ 45 | x64/ 46 | x86/ 47 | bld/ 48 | [Bb]in/ 49 | [Oo]bj/ 50 | [Ll]og/ 51 | [Bb]uild/ 52 | [Pp]ackages/ 53 | 54 | # Visual Studio User File # 55 | ########################### 56 | *.suo 57 | *.user 58 | .vs/ 59 | Alligator/Alligator.csproj.orig 60 | Alligator/Alligator_BACKUP_9848.csproj 61 | Alligator/Alligator_BASE_9848.csproj 62 | Alligator/Alligator_LOCAL_9848.csproj 63 | Alligator/Alligator_REMOTE_9848.csproj 64 | 65 | # Exceptions # 66 | ############## 67 | !/lib/*.dll 68 | -------------------------------------------------------------------------------- /.ci/check-installer.yml: -------------------------------------------------------------------------------- 1 | # ASP.NET Core (.NET Framework) 2 | # Build and test ASP.NET Core projects targeting the full .NET Framework. 3 | # Add steps that publish symbols, save build artifacts, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core 5 | 6 | trigger: 7 | - master 8 | pr: 9 | - master 10 | 11 | pool: 12 | vmImage: 'vs2017-win2016' 13 | 14 | variables: 15 | solution: '**/Grasshopper_Toolkit.sln' 16 | buildPlatform: 'Any CPU' 17 | buildConfiguration: 'Release' 18 | projectName: 'Grasshopper_Toolkit' 19 | 20 | steps: 21 | - checkout: self 22 | persistCredentials: true 23 | 24 | - task: DeleteFiles@1 25 | displayName: 'Clean Up After Moving Cloned Files' 26 | inputs: 27 | SourceFolder: '$(Build.SourcesDirectory)' 28 | Contents: '**.sln' 29 | 30 | - task: NuGetToolInstaller@1 31 | 32 | - task: PowerShell@2 33 | displayName: 'Clone Test Toolkit' 34 | inputs: 35 | filePath: '.ci/CloneTest.ps1' 36 | 37 | - task: PowerShell@2 38 | displayName: 'Clone BHoM_Installer' 39 | inputs: 40 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneInstaller.ps1' 41 | 42 | - task: PowerShell@2 43 | displayName: 'Run BHoM_Installer tasks' 44 | inputs: 45 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildInstaller.ps1' 46 | -------------------------------------------------------------------------------- /Grasshopper_oM/Grasshopper_oM.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net472 5 | 9.0.0.0 6 | https://github.com/BHoM/Grasshopper_UI 7 | 5.0.0 8 | BHoM 9 | Copyright © https://github.com/BHoM 10 | BH.oM.Grasshopper 11 | 9.1.0.0 12 | ..\Build\ 13 | false 14 | 15 | 16 | 17 | $(ProgramData)\BHoM\Assemblies\BHoM.dll 18 | False 19 | False 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.ci/check-core.yml: -------------------------------------------------------------------------------- 1 | # ASP.NET Core (.NET Framework) 2 | # Build and test ASP.NET Core projects targeting the full .NET Framework. 3 | # Add steps that publish symbols, save build artifacts, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core 5 | 6 | trigger: 7 | - master 8 | pr: 9 | - master 10 | 11 | pool: 12 | vmImage: 'vs2017-win2016' 13 | 14 | variables: 15 | solution: '**/Grasshopper_Toolkit.sln' 16 | buildPlatform: 'Any CPU' 17 | buildConfiguration: 'Release' 18 | projectName: 'Grasshopper_Toolkit' 19 | 20 | steps: 21 | - checkout: self 22 | persistCredentials: true 23 | 24 | - task: CopyFiles@2 25 | displayName: 'Move Cloned Files to Correct Toolkit Folder' 26 | inputs: 27 | SourceFolder: '$(Build.SourcesDirectory)' 28 | Contents: '**' 29 | TargetFolder: '$(Build.SourcesDirectory)/$(projectName)' 30 | 31 | - task: DeleteFiles@1 32 | displayName: 'Clean Up After Moving Cloned Files' 33 | inputs: 34 | SourceFolder: '$(Build.SourcesDirectory)' 35 | Contents: '**.sln' 36 | 37 | - task: NuGetToolInstaller@1 38 | 39 | - task: PowerShell@2 40 | displayName: 'Clone Test Toolkit' 41 | inputs: 42 | filePath: '.ci/CloneTest.ps1' 43 | 44 | - task: PowerShell@2 45 | displayName: 'Clone and Build Dependencies' 46 | inputs: 47 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1' 48 | 49 | - task: NuGetCommand@2 50 | displayName: 'Restore NuGets for Primary Solution' 51 | inputs: 52 | restoreSolution: '$(solution)' 53 | 54 | - task: PowerShell@2 55 | displayName: 'Build Primary Solution' 56 | inputs: 57 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildPrimarySolution.ps1' 58 | 59 | - task: PowerShell@2 60 | displayName: 'Clone and Build Core Dependencies' 61 | inputs: 62 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildCore.ps1' 63 | -------------------------------------------------------------------------------- /.ci/run-compliance-tests.yml: -------------------------------------------------------------------------------- 1 | # ASP.NET Core (.NET Framework) 2 | # Build and test ASP.NET Core projects targeting the full .NET Framework. 3 | # Add steps that publish symbols, save build artifacts, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core 5 | 6 | trigger: 7 | - master 8 | pr: 9 | - master 10 | 11 | pool: 12 | vmImage: 'vs2017-win2016' 13 | 14 | variables: 15 | solution: '**/Grasshopper_Toolkit.sln' 16 | buildPlatform: 'Any CPU' 17 | buildConfiguration: 'Release' 18 | projectName: 'Grasshopper_Toolkit' 19 | 20 | steps: 21 | - checkout: self 22 | persistCredentials: true 23 | 24 | - task: CopyFiles@2 25 | displayName: 'Move Cloned Files to Correct Toolkit Folder' 26 | inputs: 27 | SourceFolder: '$(Build.SourcesDirectory)' 28 | Contents: '**' 29 | TargetFolder: '$(Build.SourcesDirectory)/$(projectName)' 30 | 31 | - task: DeleteFiles@1 32 | displayName: 'Clean Up After Moving Cloned Files' 33 | inputs: 34 | SourceFolder: '$(Build.SourcesDirectory)' 35 | Contents: '**.sln' 36 | 37 | - task: NuGetToolInstaller@1 38 | 39 | - task: PowerShell@2 40 | displayName: 'Clone Test Toolkit' 41 | inputs: 42 | filePath: '.ci/CloneTest.ps1' 43 | 44 | - task: PowerShell@2 45 | displayName: 'Clone and Build Dependencies' 46 | inputs: 47 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1' 48 | 49 | - task: PowerShell@2 50 | displayName: 'Build Test Toolkit' 51 | inputs: 52 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildTest.ps1' 53 | 54 | - task: PowerShell@2 55 | displayName: 'Copy changed files' 56 | inputs: 57 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/MovePRFiles.ps1' 58 | 59 | - task: VSTest@2 60 | inputs: 61 | testSelector: 'testAssemblies' 62 | testAssemblyVer2: '$(Build.SourcesDirectory)/Test_Toolkit/Build/CodeComplianceTest_Test.dll' 63 | runSettingsFile: '.ci/testSettings.runsettings' 64 | -------------------------------------------------------------------------------- /Grasshopper_oM/UISettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.oM.Base; 24 | using System; 25 | using System.Collections.Generic; 26 | using System.ComponentModel; 27 | using System.Linq; 28 | using System.Text; 29 | using System.Threading.Tasks; 30 | 31 | namespace BH.oM.Grasshopper 32 | { 33 | [Description("Settings for the Grasshopper UI.")] 34 | public class UISettings : BHoMObject, ISettings 35 | { 36 | public virtual bool UseWireMenu { get; set; } = true; 37 | } 38 | } 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /.ci/check-all-depandants.yml: -------------------------------------------------------------------------------- 1 | # ASP.NET Core (.NET Framework) 2 | # Build and test ASP.NET Core projects targeting the full .NET Framework. 3 | # Add steps that publish symbols, save build artifacts, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core 5 | 6 | trigger: 7 | - master 8 | pr: 9 | - master 10 | 11 | pool: 12 | vmImage: 'vs2017-win2016' 13 | 14 | variables: 15 | solution: '**/Grasshopper_Toolkit.sln' 16 | buildPlatform: 'Any CPU' 17 | buildConfiguration: 'Release' 18 | projectName: 'Grasshopper_Toolkit' 19 | 20 | steps: 21 | - checkout: self 22 | persistCredentials: true 23 | 24 | - task: CopyFiles@2 25 | displayName: 'Move Cloned Files to Correct Toolkit Folder' 26 | inputs: 27 | SourceFolder: '$(Build.SourcesDirectory)' 28 | Contents: '**' 29 | TargetFolder: '$(Build.SourcesDirectory)/$(projectName)' 30 | 31 | - task: DeleteFiles@1 32 | displayName: 'Clean Up After Moving Cloned Files' 33 | inputs: 34 | SourceFolder: '$(Build.SourcesDirectory)' 35 | Contents: '**.sln' 36 | 37 | - task: NuGetToolInstaller@1 38 | 39 | - task: PowerShell@2 40 | displayName: 'Clone Test Toolkit' 41 | inputs: 42 | filePath: '.ci/CloneTest.ps1' 43 | 44 | - task: PowerShell@2 45 | displayName: 'Clone and Build Dependencies' 46 | inputs: 47 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1' 48 | 49 | - task: NuGetCommand@2 50 | displayName: 'Restore NuGets for Primary Solution' 51 | inputs: 52 | restoreSolution: '$(solution)' 53 | 54 | - task: PowerShell@2 55 | displayName: 'Build Primary Solution' 56 | inputs: 57 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildPrimarySolution.ps1' 58 | 59 | - task: PowerShell@2 60 | displayName: 'Clone and Build Core Dependencies' 61 | inputs: 62 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildCore.ps1' 63 | 64 | - task: PowerShell@2 65 | displayName: 'Clone and Build all Dependencies' 66 | inputs: 67 | filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1' 68 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/External.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Templates; 24 | using BH.UI.Base; 25 | using BH.UI.Base.Components; 26 | 27 | namespace BH.UI.Grasshopper.Components 28 | { 29 | public class ExternalComponent : CallerComponent 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public override Caller Caller { get; } = new ExternalCaller(); 36 | 37 | 38 | /*******************************************/ 39 | } 40 | } 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Grasshopper_UI/Templates/IBHoMParam.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using System; 25 | using System.Collections.Generic; 26 | using System.Linq; 27 | using System.Text; 28 | using System.Threading.Tasks; 29 | 30 | namespace BH.UI.Grasshopper.Templates 31 | { 32 | public interface IBHoMParam 33 | { 34 | Guid ComponentGuid { get; } 35 | 36 | string TypeName { get; } 37 | 38 | GH_Exposure Exposure { get; } 39 | 40 | bool Hidden { get; set; } 41 | 42 | bool IsPreviewCapable { get; } 43 | 44 | Rhino.Geometry.BoundingBox ClippingBox { get; } 45 | 46 | Type ObjectType { get; set; } 47 | } 48 | } 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/Move.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class MoveComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new MoveCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/Pull.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class PullComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new PullCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/Query.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class QueryComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new QueryCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/UI/UnitTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class UnitTestComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new UnitTestCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/Execute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class ExecuteComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new ExecuteCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/Remove.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class RemoveComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new RemoveCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/Compute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class ComputeComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new ComputeCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/Convert.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class ConvertComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new ConvertCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/GetInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class GetInfoComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new GetInfoCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/Modify.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class ModifyComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new ModifyCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/ToJson.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class ToJsonComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new ToJsonCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/FromJson.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class FromJsonComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new FromJsonCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/GetEvents.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class GetEventsComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new GetEventsCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/GetProperty.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class GetPropertyComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new GetPropertyCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/SetProperty.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using BH.UI.Grasshopper.Templates; 25 | using BH.UI.Base; 26 | using BH.UI.Base.Components; 27 | using Grasshopper.Kernel.Parameters; 28 | 29 | namespace BH.UI.Grasshopper.Components 30 | { 31 | public class SetPropertyComponent : CallerComponent 32 | { 33 | /*******************************************/ 34 | /**** Properties ****/ 35 | /*******************************************/ 36 | 37 | public override Caller Caller { get; } = new SetPropertyCaller(); 38 | 39 | 40 | /*******************************************/ 41 | } 42 | } 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/CreateAdapter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class CreateAdapterComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new CreateAdapterCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/CreateRequest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class CreateRequestComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new CreateRequestCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/oM/CreateDictionary.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class CreateDictionaryComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new CreateDictionaryCaller(); 39 | 40 | 41 | /*******************************************/ 42 | } 43 | } 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Grasshopper_UI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35707.178 d17.12 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grasshopper_UI", "Grasshopper_UI\Grasshopper_UI.csproj", "{2E3B219E-7BD2-4F75-BFAF-9B7735827ED4}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grasshopper_Engine", "Grasshopper_Engine\Grasshopper_Engine.csproj", "{DDE47285-E709-4752-9AFD-6FA03B449364}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Grasshopper_oM", "Grasshopper_oM\Grasshopper_oM.csproj", "{D18CBD7A-566D-48F7-AFAE-62F1E2AA0536}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {2E3B219E-7BD2-4F75-BFAF-9B7735827ED4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {2E3B219E-7BD2-4F75-BFAF-9B7735827ED4}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {2E3B219E-7BD2-4F75-BFAF-9B7735827ED4}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {2E3B219E-7BD2-4F75-BFAF-9B7735827ED4}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {DDE47285-E709-4752-9AFD-6FA03B449364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {DDE47285-E709-4752-9AFD-6FA03B449364}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {DDE47285-E709-4752-9AFD-6FA03B449364}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {DDE47285-E709-4752-9AFD-6FA03B449364}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {D18CBD7A-566D-48F7-AFAE-62F1E2AA0536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {D18CBD7A-566D-48F7-AFAE-62F1E2AA0536}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {D18CBD7A-566D-48F7-AFAE-62F1E2AA0536}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {D18CBD7A-566D-48F7-AFAE-62F1E2AA0536}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {5968F103-0D77-484F-88E5-28ED1BF9FD92} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/oM/CreateObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | using System.Reflection; 30 | using BH.oM.UI; 31 | using System.Linq; 32 | 33 | namespace BH.UI.Grasshopper.Components 34 | { 35 | public class CreateObjectComponent : CallerComponent, IGH_VariableParameterComponent 36 | { 37 | /*******************************************/ 38 | /**** Properties ****/ 39 | /*******************************************/ 40 | 41 | public override Caller Caller { get; } = new CreateObjectCaller(); 42 | 43 | 44 | /*******************************************/ 45 | } 46 | } 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/oM/CreateCustom.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using BH.UI.Grasshopper.Templates; 25 | using BH.UI.Base; 26 | using BH.UI.Base.Components; 27 | using Grasshopper.Kernel.Parameters; 28 | using Grasshopper.Kernel.Parameters.Hints; 29 | using BH.Engine.Grasshopper; 30 | 31 | namespace BH.UI.Grasshopper.Components 32 | { 33 | public class CreateCustomComponent : CallerComponent, IGH_VariableParameterComponent 34 | { 35 | /*******************************************/ 36 | /**** Properties ****/ 37 | /*******************************************/ 38 | 39 | public override Caller Caller { get; } = new CreateCustomCaller(); 40 | 41 | 42 | /*******************************************/ 43 | } 44 | } 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) [![Build status](https://ci.appveyor.com/api/projects/status/rw19y8e78jxd0r0d/branch/master?svg=true)](https://ci.appveyor.com/api/projects/status/grasshopper_toolkit/branch/master) [![Build Status](https://dev.azure.com/BHoMBot/BHoM/_apis/build/status/Grasshopper_Toolkit/Grasshopper_Toolkit.CheckCore?branchName=master)](https://dev.azure.com/BHoMBot/BHoM/_build/latest?definitionId=117&branchName=master) 2 | 3 | # Grasshopper_Toolkit 4 | 5 | The Grasshopper_Toolkit provides a plugin that exposes the BHoM functionality inside Grasshopper. 6 | 7 | 8 | ### Known Versions of Software Supported 9 | Grasshopper for Rhino 5 10 | Grasshopper for Rhino 6 11 | 12 | ### Documentation 13 | For more information about functionality see [the Grasshopper_Toolkit wiki](https://github.com/BHoM/Grasshopper_Toolkit/wiki) 14 | 15 | --- 16 | This toolkit is part of the Buildings and Habitats object Model. Find out more on our [wiki](https://github.com/BHoM/documentation/wiki) or at [https://bhom.xyz](https://bhom.xyz/) 17 | 18 | ## Quick Start 🚀 19 | 20 | Grab the [latest installer](https://bhom.xyz/) and a selection of [sample scripts](https://github.com/BHoM/samples). 21 | 22 | 23 | ## Getting Started for Developers 🤖 24 | 25 | If you want to build the BHoM and the Toolkits from source, it's hopefully easy! 😄 26 | Do take a look at our specific wiki pages here: [Getting Started for Developers](https://bhom.xyz/documentation/Guides-and-Tutorials/Coding-with-BHoM/) 27 | 28 | 29 | ## Want to Contribute? ## 30 | 31 | BHoM is an open-source project and would be nothing without its community. Take a look at our contributing guidelines and tips [here](https://github.com/BHoM/BHoM/blob/main/CONTRIBUTING.md). 32 | 33 | 34 | ## Licence ## 35 | 36 | BHoM is free software licenced under GNU Lesser General Public Licence - [https://www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html) 37 | Each contributor holds copyright over their respective contributions. 38 | The project versioning (Git) records all such contribution source information. 39 | See [LICENSE](https://github.com/BHoM/BHoM/blob/main/LICENSE) and [COPYRIGHT_HEADER](https://github.com/BHoM/BHoM/blob/main/COPYRIGHT_HEADER.txt). 40 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Engine/Explode.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using GH = Grasshopper; 25 | using Grasshopper.Kernel; 26 | using BH.oM.Base; 27 | using BH.UI.Grasshopper.Templates; 28 | using BH.UI.Base; 29 | using BH.UI.Base.Components; 30 | using System.Collections.Generic; 31 | using System.Linq; 32 | using System.Windows.Forms; 33 | using BH.oM.UI; 34 | 35 | namespace BH.UI.Grasshopper.Components 36 | { 37 | public class ExplodeComponent : CallerComponent 38 | { 39 | /*******************************************/ 40 | /**** Properties ****/ 41 | /*******************************************/ 42 | 43 | public override Caller Caller { get; } = new ExplodeCaller(); 44 | 45 | 46 | /*******************************************/ 47 | } 48 | } 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/oM/CreateEnum.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | using BH.Engine.Reflection; 30 | using Grasshopper.Kernel.Special; 31 | using System.Collections.Generic; 32 | using Grasshopper.Kernel.Data; 33 | using Grasshopper.Kernel.Types; 34 | 35 | namespace BH.UI.Grasshopper.Components 36 | { 37 | public class CreateEnumComponent : CallerValueList 38 | { 39 | /*******************************************/ 40 | /**** Properties ****/ 41 | /*******************************************/ 42 | 43 | public override MultiChoiceCaller Caller { get; } = new CreateEnumCaller(); 44 | 45 | /*******************************************/ 46 | } 47 | } 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/oM/CreateData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | using BH.Engine.Reflection; 30 | using Grasshopper.Kernel.Special; 31 | using System.Collections.Generic; 32 | using Grasshopper.Kernel.Data; 33 | using Grasshopper.Kernel.Types; 34 | 35 | namespace BH.UI.Grasshopper.Components 36 | { 37 | public class CreateDataComponent : CallerValueList 38 | { 39 | /*******************************************/ 40 | /**** Properties ****/ 41 | /*******************************************/ 42 | 43 | public override MultiChoiceCaller Caller { get; } = new CreateDataCaller(); 44 | 45 | 46 | /*******************************************/ 47 | } 48 | } 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Query/CanvasFilePath.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Linq; 26 | using System.Text; 27 | using System.Threading.Tasks; 28 | 29 | using GH = Grasshopper; 30 | using Grasshopper.Kernel; 31 | using System.ComponentModel; 32 | using BH.oM.Base.Attributes; 33 | 34 | namespace BH.Engine.Grasshopper 35 | { 36 | public static partial class Query 37 | { 38 | [Description("Gets the saved file path of the currently open Grasshopper Document for the active canvas.")] 39 | [Output("filePath", "The local file path for the active canvas.")] 40 | public static string CanvasFilePath() 41 | { 42 | var ghDoc = GH.Instances.ActiveCanvas.Document; 43 | if (ghDoc != null && ghDoc.IsFilePathDefined) 44 | return ghDoc.FilePath; 45 | 46 | BH.Engine.Base.Compute.RecordWarning("Document has not been saved and does not yet have a file path defined."); 47 | return ""; 48 | } 49 | } 50 | } 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Grasshopper_UI/CustomAttributes/FalseStartToggleAttributes.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using Grasshopper.Kernel.Attributes; 26 | using BH.oM.Base; 27 | using BH.UI.Grasshopper.Templates; 28 | using BH.UI.Base; 29 | using BH.UI.Base.Components; 30 | using Grasshopper.GUI.Canvas; 31 | using System.Drawing; 32 | using Grasshopper.GUI; 33 | using System.Drawing.Drawing2D; 34 | using BH.UI.Grasshopper.Components; 35 | 36 | namespace BH.UI.Grasshopper.CustomAttributes 37 | { 38 | public class FalseStartToggleAttributes : GH_ComponentAttributes 39 | { 40 | public FalseStartToggleAttributes(IGH_Component component) : base(component) 41 | { 42 | } 43 | 44 | /*******************************************/ 45 | 46 | public override GH_ObjectResponse RespondToMouseDoubleClick(GH_Canvas sender, GH_CanvasMouseEvent e) 47 | { 48 | ((FalseStartToggleComponent)Owner).UpdateComponent(); 49 | 50 | return GH_ObjectResponse.Handled; 51 | } 52 | } 53 | } 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Grasshopper_UI/Render/RenderColour.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using GH = Grasshopper; 24 | using System.Drawing; 25 | 26 | namespace BH.UI.Grasshopper 27 | { 28 | public static partial class Render 29 | { 30 | /***************************************************/ 31 | /**** Public Methods ****/ 32 | /***************************************************/ 33 | 34 | public static Color RenderColour(Color ghColour, Color custom) 35 | { 36 | Color pColour = GH.Instances.ActiveCanvas.Document.PreviewColour; 37 | if (ghColour.R == pColour.R & // If the color sent by PreviewArgs is the default object PreviewColour 38 | ghColour.G == pColour.G & 39 | ghColour.B == pColour.B) // Excluding Alpha channel from comparison 40 | { 41 | return custom; 42 | } 43 | else 44 | { 45 | return ghColour; 46 | } 47 | } 48 | 49 | /***************************************************/ 50 | } 51 | } 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_Enum.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Goos; 24 | using BH.UI.Grasshopper.Properties; 25 | using BH.UI.Grasshopper.Templates; 26 | using System; 27 | 28 | namespace BH.UI.Grasshopper.Parameters 29 | { 30 | public class Param_Enum : BHoMParam 31 | { 32 | /*******************************************/ 33 | /**** Properties ****/ 34 | /*******************************************/ 35 | 36 | protected override System.Drawing.Bitmap Icon { get; } = Resources.Enum_Param; 37 | 38 | public override Guid ComponentGuid { get; } = new Guid("C62F4BD6-9B7F-4A81-94DD-CA16B2D8D3EC"); 39 | 40 | public override string TypeName { get; } = "Enum"; 41 | 42 | 43 | /*******************************************/ 44 | /**** Constructors ****/ 45 | /*******************************************/ 46 | 47 | public Param_Enum() : base("Enum", "Enum", "Represents an enum", "Params", "Primitive") 48 | { 49 | } 50 | 51 | /*******************************************/ 52 | } 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_Type.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Properties; 24 | using BH.UI.Grasshopper.Templates; 25 | using BH.UI.Grasshopper.Goos; 26 | using System; 27 | 28 | namespace BH.UI.Grasshopper.Parameters 29 | { 30 | public class Param_Type : BHoMParam 31 | { 32 | /*******************************************/ 33 | /**** Properties ****/ 34 | /*******************************************/ 35 | 36 | protected override System.Drawing.Bitmap Icon { get; } = Resources.Type_Param; 37 | 38 | public override Guid ComponentGuid { get; } = new Guid("AA7DDCDC-2789-4A23-88AD-E1E4CD84FB37"); 39 | 40 | public override string TypeName { get; } = "Type"; 41 | 42 | 43 | /*******************************************/ 44 | /**** Constructors ****/ 45 | /*******************************************/ 46 | 47 | public Param_Type() : base("Object Type", "Type", "Represents the type of an object", "Params", "Primitive") 48 | { 49 | } 50 | 51 | /*******************************************/ 52 | } 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Grasshopper_UI/Hints/TypeHint.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel.Parameters; 25 | using BH.UI.Grasshopper.Goos; 26 | 27 | namespace BH.UI.Grasshopper.Hints 28 | { 29 | public class TypeHint : IGH_TypeHint 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public Guid HintID { get; } = new Guid("8ECF16E7-F71B-4813-AD63-C4AECC246A26"); 36 | 37 | public string TypeName { get; } = "System.Type"; 38 | 39 | 40 | /*******************************************/ 41 | /**** Constructors ****/ 42 | /*******************************************/ 43 | 44 | public bool Cast(object data, out object target) 45 | { 46 | GH_Type type = new GH_Type() { Value = null }; 47 | type.CastFrom(data); 48 | if (type.Value == null) 49 | target = data; 50 | else 51 | target = type.Value; 52 | return true; 53 | } 54 | 55 | /*******************************************/ 56 | } 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_Dictionary.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Goos; 24 | using BH.UI.Grasshopper.Properties; 25 | using BH.UI.Grasshopper.Templates; 26 | using System; 27 | 28 | namespace BH.UI.Grasshopper.Parameters 29 | { 30 | public class Param_Dictionary : BHoMParam 31 | { 32 | /*******************************************/ 33 | /**** Properties ****/ 34 | /*******************************************/ 35 | 36 | protected override System.Drawing.Bitmap Icon { get; } = Resources.Dictionary_Param; 37 | 38 | public override Guid ComponentGuid { get; } = new Guid("82AA94FD-F2D9-4DBD-9425-F4C9EA8A1C37"); 39 | 40 | public override string TypeName { get; } = "Dictionary"; 41 | 42 | 43 | /*******************************************/ 44 | /**** Constructors ****/ 45 | /*******************************************/ 46 | 47 | public Param_Dictionary(): base("Dictionary", "Dictionary", "Represents an Dictionary", "Params", "Primitive") 48 | { 49 | } 50 | 51 | /*******************************************/ 52 | } 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Grasshopper_UI/Hints/EnumHint.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel.Parameters; 25 | using BH.UI.Grasshopper.Goos; 26 | 27 | namespace BH.UI.Grasshopper.Hints 28 | { 29 | public class EnumHint : IGH_TypeHint 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public Guid HintID { get; } = new Guid("50201E4F-F9F3-4BE5-A927-98AE2EE03530"); 36 | public string TypeName { get; } = "System.Enum"; 37 | 38 | 39 | /*******************************************/ 40 | /**** Constructors ****/ 41 | /*******************************************/ 42 | 43 | public bool Cast(object data, out object target) 44 | { 45 | GH_Enum enumer = new GH_Enum() { Value = null }; 46 | enumer.CastFrom(data); 47 | if (enumer.Value == null) 48 | target = data; 49 | else 50 | target = enumer.Value; 51 | return true; 52 | } 53 | 54 | /*******************************************/ 55 | } 56 | } 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Grasshopper_UI/Global/WireInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Serialiser; 24 | using BH.oM.Base; 25 | using BH.UI.Grasshopper.Components; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base.Global; 28 | using BH.UI.Base; 29 | using Grasshopper.GUI.Canvas; 30 | using System; 31 | using System.Collections.Generic; 32 | using System.Linq; 33 | using System.Reflection; 34 | using System.Text; 35 | using System.Threading.Tasks; 36 | using GH = Grasshopper; 37 | using Grasshopper.GUI.Canvas.Interaction; 38 | using Grasshopper.Kernel; 39 | 40 | namespace BH.UI.Grasshopper.Global 41 | { 42 | public class WireInfo 43 | { 44 | /*******************************************/ 45 | /**** Public Properties ****/ 46 | /*******************************************/ 47 | 48 | public GH_WireInteraction Wire { get; set; } = null; 49 | 50 | public IGH_Param Source { get; set; } = null; 51 | 52 | public Type SourceType { get; set; } = null; 53 | 54 | public bool IsInput { get; set; } = false; 55 | 56 | public HashSet Tags { get; set; } = new HashSet(); 57 | 58 | /*******************************************/ 59 | } 60 | } 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_BHoMAdapter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Goos; 24 | using BH.UI.Grasshopper.Properties; 25 | using BH.UI.Grasshopper.Templates; 26 | using System; 27 | 28 | namespace BH.UI.Grasshopper.Parameters 29 | { 30 | public class Param_BHoMAdapter : BHoMParam 31 | { 32 | /*******************************************/ 33 | /**** Properties ****/ 34 | /*******************************************/ 35 | 36 | protected override System.Drawing.Bitmap Icon { get; } = Resources.BHoMAdapter_Param; 37 | 38 | public override Guid ComponentGuid { get; } = new Guid("72194041-4E06-4E8C-BBEB-36FD484907E0"); 39 | 40 | public override string TypeName { get; } = "BHoM Adapter"; 41 | 42 | 43 | /*******************************************/ 44 | /**** Constructors ****/ 45 | /*******************************************/ 46 | 47 | public Param_BHoMAdapter() : base("BHoM Adapter", "Adapter", "Represents a collection of BHoM adapters", "Params", "Primitive") 48 | { 49 | } 50 | } 51 | 52 | /*******************************************/ 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Grasshopper_UI/Hints/DictionaryHint.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel.Parameters; 25 | using BH.UI.Grasshopper.Goos; 26 | 27 | namespace BH.UI.Grasshopper.Hints 28 | { 29 | public class DictionaryHint : IGH_TypeHint 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public Guid HintID { get; } = new Guid("1574563B-80AC-486D-B175-A4F2E5EC76D5"); 36 | public string TypeName { get; } = "Dictionary"; 37 | 38 | 39 | /*******************************************/ 40 | /**** Constructors ****/ 41 | /*******************************************/ 42 | 43 | public bool Cast(object data, out object target) 44 | { 45 | GH_Dictionary dict = new GH_Dictionary() { Value = null }; 46 | dict.CastFrom(data); 47 | if (dict.Value == null) 48 | target = data; 49 | else 50 | target = dict.Value; 51 | return true; 52 | } 53 | 54 | /*******************************************/ 55 | } 56 | } 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Adapter/Push.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | 30 | namespace BH.UI.Grasshopper.Components 31 | { 32 | public class PushComponent : CallerComponent 33 | { 34 | /*******************************************/ 35 | /**** Properties ****/ 36 | /*******************************************/ 37 | 38 | public override Caller Caller { get; } = new PushCaller(); 39 | 40 | 41 | /*******************************************/ 42 | /**** Override Methods ****/ 43 | /*******************************************/ 44 | 45 | protected override void RegisterInputParams(GH_InputParamManager pManager = null) 46 | { 47 | base.RegisterInputParams(pManager); 48 | 49 | // Set the object input as flatten by default 50 | if (pManager != null && Params.Input.Count > 1) 51 | pManager[1].DataMapping = GH_DataMapping.Flatten; 52 | } 53 | 54 | /*******************************************/ 55 | } 56 | } 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Grasshopper_UI/Hints/BHomObjectHint.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using BH.UI.Grasshopper.Goos; 25 | using Grasshopper.Kernel.Parameters; 26 | 27 | namespace BH.UI.Grasshopper.Hints 28 | { 29 | public class BHoMObjectHint : IGH_TypeHint 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public Guid HintID { get; } = new Guid("0977C35E-92DD-4933-8835-8B2C8A37C8CF"); 36 | 37 | public string TypeName { get; } = "BH.oM.Base.BHoMObject"; 38 | 39 | 40 | /*******************************************/ 41 | /**** Constructors ****/ 42 | /*******************************************/ 43 | 44 | public bool Cast(object data, out object target) 45 | { 46 | GH_BHoMObject obj = new GH_BHoMObject() { Value = null }; 47 | obj.CastFrom(data); 48 | if (obj.Value == null) 49 | target = data; 50 | else 51 | target = obj.Value; 52 | return true; 53 | } 54 | 55 | /*******************************************/ 56 | } 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Grasshopper_UI/Hints/IGeometryHint.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel.Parameters; 25 | using BH.UI.Grasshopper.Goos; 26 | 27 | namespace BH.UI.Grasshopper.Hints 28 | { 29 | public class IGeometryHint : IGH_TypeHint 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public Guid HintID { get; } = new Guid("CC64E37E-C6B8-44F4-9C85-05B19849F4D6"); 36 | 37 | public string TypeName { get; } = "BH.oM.Geometry.IGeometry"; 38 | 39 | 40 | /*******************************************/ 41 | /**** Constructors ****/ 42 | /*******************************************/ 43 | 44 | public bool Cast(object data, out object target) 45 | { 46 | GH_IBHoMGeometry geom = new GH_IBHoMGeometry() { Value = null }; 47 | geom.CastFrom(data); 48 | if (geom.Value == null) 49 | target = data; 50 | else 51 | target = geom.Value; 52 | return true; 53 | } 54 | 55 | /*******************************************/ 56 | } 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Grasshopper_UI/CallerComponent/IGH_InitCodeAware.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using System.Linq; 25 | using Grasshopper.Kernel; 26 | using BH.oM.Base; 27 | using BH.oM.UI; 28 | using System.Collections.Generic; 29 | using System.Windows.Forms; 30 | using BH.UI.Grasshopper.Global; 31 | using Grasshopper.Kernel.Parameters; 32 | using BH.UI.Grasshopper.Parameters; 33 | using BH.Engine.Reflection; 34 | using BH.oM.Geometry; 35 | using BH.Engine.Grasshopper; 36 | using BH.UI.Grasshopper.Components; 37 | using System.Collections; 38 | using BH.Adapter; 39 | using BH.oM.Base.Debugging; 40 | using BH.UI.Base; 41 | 42 | namespace BH.UI.Grasshopper.Templates 43 | { 44 | public abstract partial class CallerComponent : GH_Component, IGH_VariableParameterComponent, IGH_InitCodeAware 45 | { 46 | /*******************************************/ 47 | /**** Interface Methods ****/ 48 | /*******************************************/ 49 | 50 | public void SetInitCode(string code) 51 | { 52 | object item = BH.Engine.Serialiser.Convert.FromJson(code); 53 | if (item != null) 54 | Caller.SetItem(item); 55 | } 56 | 57 | /*******************************************/ 58 | } 59 | } 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_IObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Grasshopper; 24 | using BH.UI.Grasshopper.Properties; 25 | using BH.UI.Grasshopper.Templates; 26 | using BH.UI.Grasshopper.Goos; 27 | using Grasshopper.Kernel; 28 | using System; 29 | using System.Collections.Generic; 30 | 31 | 32 | namespace BH.UI.Grasshopper.Parameters 33 | { 34 | public class Param_IObject : BakeableParam 35 | { 36 | /*******************************************/ 37 | /**** Properties ****/ 38 | /*******************************************/ 39 | 40 | protected override System.Drawing.Bitmap Icon { get; } = Resources.IObject_Param; 41 | 42 | public override Guid ComponentGuid { get; } = new Guid("FFE324E7-1FC0-4818-9FCB-43A0202CC974"); 43 | 44 | public override string TypeName { get; } = "IObject"; 45 | 46 | 47 | /*******************************************/ 48 | /**** Constructors ****/ 49 | /*******************************************/ 50 | 51 | public Param_IObject() : base("BH IObject", "IObject", "Represents a collection of generic BH IObjects", "Params", "Primitive") 52 | { 53 | } 54 | 55 | /*******************************************/ 56 | } 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Grasshopper_UI/Helpers/AvailableHints.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Hints; 24 | using Grasshopper.Kernel.Parameters; 25 | using Grasshopper.Kernel.Parameters.Hints; 26 | using System.Collections.Generic; 27 | 28 | namespace BH.UI.Grasshopper 29 | { 30 | public static partial class Helpers 31 | { 32 | /***************************************************/ 33 | /**** Public Fields ****/ 34 | /***************************************************/ 35 | 36 | public static List AvailableHints = new List() 37 | { 38 | new GH_NullHint(), 39 | new GH_HintSeparator(), 40 | new BHoMObjectHint(), 41 | new IGeometryHint(), 42 | new DictionaryHint(), 43 | new EnumHint(), 44 | new TypeHint(), 45 | new GH_HintSeparator(), 46 | new GH_BooleanHint_CS(), 47 | new GH_IntegerHint_CS(), 48 | new GH_DoubleHint_CS(), 49 | new GH_StringHint_CS(), 50 | new GH_HintSeparator(), 51 | new GH_DateTimeHint(), 52 | new GH_ColorHint(), 53 | new GH_GuidHint() 54 | }; 55 | 56 | /***************************************************/ 57 | } 58 | } 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Convert/ToRhino.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Base; 24 | using BH.Engine.Adapters.Rhinoceros; 25 | using BH.oM.Geometry; 26 | using System; 27 | using System.Collections.Generic; 28 | using System.Linq; 29 | using System.Text; 30 | using System.Threading.Tasks; 31 | 32 | namespace BH.Engine.Grasshopper 33 | { 34 | public static partial class Convert 35 | { 36 | /*******************************************/ 37 | /**** Public Methods ****/ 38 | /*******************************************/ 39 | 40 | public static object ToRhino(object x) 41 | { 42 | try 43 | { 44 | if (x == null) 45 | return null; 46 | else if (BH.Engine.Adapters.Rhinoceros.Query.IsRhinoEquivalent(x.GetType())) 47 | return ((IGeometry)x).IToRhino(); 48 | else 49 | return x; 50 | } 51 | catch (Exception e) 52 | { 53 | BH.Engine.Base.Compute.RecordError("Object of type " + x.GetType().IToText() + " failed to convert to a Rhino geometry\nError: " + e.Message); 54 | return null; 55 | } 56 | } 57 | 58 | /*******************************************/ 59 | } 60 | } 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /.ci/testSettings.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | 7 | ..\TestResults 8 | 9 | 11 | x86 12 | 13 | 14 | Framework40 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .*CPPUnitTestFramework.* 29 | 30 | 31 | 32 | 33 | True 34 | True 35 | True 36 | False 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | True 58 | false 59 | False 60 | False 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_BHoMGeometry.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Properties; 24 | using BH.UI.Grasshopper.Templates; 25 | using Grasshopper.Kernel; 26 | using System; 27 | using Rhino; 28 | using Rhino.DocObjects; 29 | using System.Collections.Generic; 30 | using BH.UI.Grasshopper.Goos; 31 | 32 | namespace BH.UI.Grasshopper.Parameters 33 | { 34 | public class Param_BHoMGeometry : BakeableParam 35 | { 36 | /*******************************************/ 37 | /**** Properties ****/ 38 | /*******************************************/ 39 | 40 | protected override System.Drawing.Bitmap Icon { get; } = Resources.IBHoMGeometry_Param; 41 | 42 | public override Guid ComponentGuid { get; } = new Guid("EFD86C1F-D674-4905-A660-28C81A807080"); 43 | 44 | public override string TypeName { get; } = "BHoM Geometry"; 45 | 46 | 47 | /*******************************************/ 48 | /**** Constructors ****/ 49 | /*******************************************/ 50 | 51 | public Param_BHoMGeometry() : base("BHoM geometry", "BHoMGeo", "Represents a collection of generic BHoM geometries", "Params", "Geometry") 52 | { 53 | } 54 | 55 | /*******************************************/ 56 | } 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/Parameters/Param_BHoMObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.UI.Grasshopper.Properties; 24 | using BH.UI.Grasshopper.Templates; 25 | using BH.UI.Grasshopper.Goos; 26 | using Grasshopper.Kernel; 27 | using System; 28 | using Rhino; 29 | using Rhino.DocObjects; 30 | using System.Collections.Generic; 31 | 32 | namespace BH.UI.Grasshopper.Parameters 33 | { 34 | public class Param_BHoMObject : BakeableParam 35 | { 36 | /*******************************************/ 37 | /**** Properties ****/ 38 | /*******************************************/ 39 | 40 | protected override System.Drawing.Bitmap Icon { get; } = Resources.BHoMObject_Param; 41 | 42 | public override Guid ComponentGuid { get; } = new Guid("1DEF3710-FD5B-4617-BCF6-B6293C5C6530"); 43 | 44 | public override string TypeName { get; } = "BHoM Object"; 45 | 46 | 47 | /*******************************************/ 48 | /**** Constructors ****/ 49 | /*******************************************/ 50 | 51 | public Param_BHoMObject() : base("BHoM object", "BHoM", "Represents a collection of generic BHoM objects", "Params", "Primitive") 52 | { 53 | } 54 | 55 | /*******************************************/ 56 | 57 | } 58 | 59 | } 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Grasshopper_UI/Goos/GH_Dictionary.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel.Types; 24 | using System.Collections; 25 | using BH.Engine.Reflection; 26 | 27 | namespace BH.UI.Grasshopper.Goos 28 | { 29 | public class GH_Dictionary : GH_BHoMGoo 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public override string TypeName { get; } = "Dictionary"; 36 | 37 | public override string TypeDescription { get; } = "Defines an Dictionary"; 38 | 39 | public override bool IsValid { get { return Value != null; } } 40 | 41 | 42 | /*******************************************/ 43 | /**** Constructors ****/ 44 | /*******************************************/ 45 | 46 | public GH_Dictionary() : base() { } 47 | 48 | /***************************************************/ 49 | 50 | public GH_Dictionary(IDictionary val) : base(val) { } 51 | 52 | 53 | /*******************************************/ 54 | /**** Override Methods ****/ 55 | /*******************************************/ 56 | 57 | public override IGH_Goo Duplicate() 58 | { 59 | return new GH_Dictionary { Value = Value }; 60 | } 61 | 62 | /*******************************************/ 63 | } 64 | } 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Grasshopper_UI/Goos/GH_IObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using Grasshopper.Kernel.Types; 25 | using BH.oM.Base; 26 | using BH.oM.Geometry; 27 | using BH.Engine.Geometry; 28 | using System; 29 | using BH.Engine.Base; 30 | using BH.Engine.Adapters.Rhinoceros; 31 | using Rhino; 32 | using Rhino.DocObjects; 33 | using GH_IO; 34 | using GH_IO.Serialization; 35 | using BH.Engine.Serialiser; 36 | 37 | namespace BH.UI.Grasshopper.Goos 38 | { 39 | public class GH_IObject : GH_BakeableObject 40 | { 41 | /*******************************************/ 42 | /**** Properties ****/ 43 | /*******************************************/ 44 | 45 | public override string TypeName { get; } = "IObject"; 46 | 47 | public override string TypeDescription { get; } = "Contains a generic BHoM IObject"; 48 | 49 | 50 | /*******************************************/ 51 | /**** Constructors ****/ 52 | /*******************************************/ 53 | 54 | public GH_IObject() : base() { } 55 | 56 | /***************************************************/ 57 | 58 | public GH_IObject(IObject val) : base(val) { } 59 | 60 | 61 | /*******************************************/ 62 | /**** Override Methods ****/ 63 | /*******************************************/ 64 | 65 | public override IGH_Goo Duplicate() 66 | { 67 | return new GH_IObject { Value = Value }; 68 | } 69 | 70 | /***************************************************/ 71 | } 72 | } 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Grasshopper_UI/Goos/GH_BHoMAdapter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using Grasshopper.Kernel.Types; 25 | using BH.oM.Base; 26 | using BH.oM.Geometry; 27 | using BH.Engine.Geometry; 28 | using System; 29 | using BH.Engine.Base; 30 | using BH.Adapter; 31 | 32 | namespace BH.UI.Grasshopper.Goos 33 | { 34 | public class GH_BHoMAdapter : GH_BHoMGoo // Cannot reference BHoMAdapter for now as we are in the Engine 35 | { 36 | /*******************************************/ 37 | /**** Properties ****/ 38 | /*******************************************/ 39 | 40 | public override string TypeName { get; } = "BHoMAdapter"; 41 | 42 | public override string TypeDescription { get; } = "Contains a BHoM Adapter"; 43 | 44 | public override bool IsValid { get { return Value != null; } } 45 | 46 | 47 | /*******************************************/ 48 | /**** Constructors ****/ 49 | /*******************************************/ 50 | 51 | public GH_BHoMAdapter() : base() { } 52 | 53 | /***************************************************/ 54 | 55 | public GH_BHoMAdapter(BHoMAdapter val) : base(val) { } 56 | 57 | 58 | /*******************************************/ 59 | /**** Override Methods ****/ 60 | /*******************************************/ 61 | 62 | public override IGH_Goo Duplicate() 63 | { 64 | return new GH_BHoMAdapter { Value = Value }; 65 | } 66 | 67 | /***************************************************/ 68 | } 69 | } 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Grasshopper_UI/Goos/GH_BHoMObject.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using Grasshopper.Kernel.Types; 25 | using BH.oM.Base; 26 | using BH.oM.Geometry; 27 | using BH.Engine.Geometry; 28 | using System; 29 | using BH.Engine.Base; 30 | using BH.Engine.Adapters.Rhinoceros; 31 | using Rhino; 32 | using Rhino.DocObjects; 33 | using GH_IO; 34 | using GH_IO.Serialization; 35 | using BH.Engine.Serialiser; 36 | 37 | namespace BH.UI.Grasshopper.Goos 38 | { 39 | public class GH_BHoMObject : GH_BakeableObject 40 | { 41 | /*******************************************/ 42 | /**** Properties ****/ 43 | /*******************************************/ 44 | 45 | public override string TypeName { get; } = "BHoMObject"; 46 | 47 | public override string TypeDescription { get; } = "Contains a BHoM IObject"; 48 | 49 | 50 | /*******************************************/ 51 | /**** Constructors ****/ 52 | /*******************************************/ 53 | 54 | public GH_BHoMObject() : base() { } 55 | 56 | /***************************************************/ 57 | 58 | public GH_BHoMObject(BHoMObject val) : base(val) { } 59 | 60 | 61 | /*******************************************/ 62 | /**** Override Methods ****/ 63 | /*******************************************/ 64 | 65 | public override IGH_Goo Duplicate() 66 | { 67 | return new GH_BHoMObject { Value = Value }; 68 | } 69 | 70 | /***************************************************/ 71 | } 72 | } 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/oM/CreateType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using BH.oM.Base; 26 | using BH.UI.Grasshopper.Templates; 27 | using BH.UI.Base; 28 | using BH.UI.Base.Components; 29 | using BH.Engine.Base; 30 | using GH_IO.Serialization; 31 | using BH.oM.UI; 32 | 33 | namespace BH.UI.Grasshopper.Components 34 | { 35 | public class CreateTypeComponent : CallerComponent 36 | { 37 | /*******************************************/ 38 | /**** Properties ****/ 39 | /*******************************************/ 40 | 41 | public override Caller Caller { get; } = new CreateTypeCaller(); 42 | 43 | 44 | /*******************************************/ 45 | /**** Override Methods ****/ 46 | /*******************************************/ 47 | 48 | protected override void OnCallerModified(object sender, CallerUpdate update) 49 | { 50 | base.OnCallerModified(sender, update); 51 | 52 | // Adding a tag under the component 53 | Type type = Caller.SelectedItem as Type; 54 | if (type != null) 55 | Message = type.ToText(); 56 | } 57 | 58 | /*******************************************/ 59 | 60 | public override bool Read(GH_IReader reader) 61 | { 62 | bool success = base.Read(reader); 63 | 64 | // Adding a tag under the component 65 | Type type = Caller.SelectedItem as Type; 66 | if (type != null) 67 | Message = type.ToText(); 68 | 69 | return success; 70 | } 71 | 72 | /*******************************************/ 73 | } 74 | } 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /GHManipulator_Alligator/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper.Kernel; 24 | using System.Reflection; 25 | using System.Runtime.CompilerServices; 26 | using System.Runtime.InteropServices; 27 | 28 | // General Information about an assembly is controlled through the following 29 | // set of attributes. Change these attribute values to modify the information 30 | // associated with an assembly. 31 | [assembly: AssemblyTitle("GH_Manipulator")] 32 | [assembly: AssemblyDescription("https://github.com/BHoM/Grasshopper_UI")] 33 | [assembly: AssemblyConfiguration("")] 34 | [assembly: AssemblyCompany("")] 35 | [assembly: AssemblyProduct("GH_Manipulator")] 36 | [assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] 37 | [assembly: AssemblyTrademark("")] 38 | [assembly: AssemblyCulture("")] 39 | [assembly: Grasshopper.Kernel.GH_Loading(GH_LoadingDemand.ForceDirect)] 40 | 41 | // Setting ComVisible to false makes the types in this assembly not visible 42 | // to COM components. If you need to access a type in this assembly from 43 | // COM, set the ComVisible attribute to true on that type. 44 | [assembly: ComVisible(false)] 45 | 46 | // The following GUID is for the ID of the typelib if this project is exposed to COM 47 | [assembly: Guid("215bd43e-2500-4a6c-b56a-38abf9c6e7a0")] 48 | 49 | // Version information for an assembly consists of the following four values: 50 | // 51 | // Major Version 52 | // Minor Version 53 | // Build Number 54 | // Revision 55 | // 56 | // You can specify all the values or you can default the Build and Revision Numbers 57 | // by using the '*' as shown below: 58 | // [assembly: AssemblyVersion("1.0.*")] 59 | [assembly: AssemblyVersion("9.0.0.0")] 60 | [assembly: AssemblyFileVersion("9.1.0.0")] 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Convert/ToType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Adapters.Rhinoceros; 24 | using BH.oM.Geometry; 25 | using System; 26 | using System.Collections.Generic; 27 | using System.Linq; 28 | using System.Text; 29 | using System.Threading.Tasks; 30 | 31 | namespace BH.Engine.Grasshopper 32 | { 33 | public static partial class Convert 34 | { 35 | /*******************************************/ 36 | /**** Public Methods ****/ 37 | /*******************************************/ 38 | 39 | public static Type ToType(this string typeString) 40 | { 41 | // Try to get teh type from assembly name 42 | Type type = Type.GetType(typeString); 43 | if (type != null) 44 | return type; 45 | 46 | if (typeString.Contains("[[") && typeString.Contains("]]")) 47 | { 48 | int outerSplit = typeString.IndexOf("[["); 49 | int innerLength = typeString.LastIndexOf("]]") - outerSplit - 2; 50 | 51 | Type outer = typeString.Substring(0, outerSplit).ToType(); 52 | Type inner = typeString.Substring(outerSplit + 2, innerLength).ToType(); 53 | 54 | return outer.MakeGenericType(new Type[] { inner }); 55 | } 56 | 57 | // Try get to recover type from full name 58 | string[] parts = typeString.Split(new char[] { ',' }); 59 | if (parts.Length == 0) 60 | return null; 61 | else 62 | { 63 | try 64 | { 65 | type = BH.Engine.Base.Create.Type(parts[0]); 66 | } 67 | catch 68 | { 69 | type = null; 70 | } 71 | return type; 72 | } 73 | } 74 | 75 | /*******************************************/ 76 | } 77 | } 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Create/DataTree.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using Grasshopper; 24 | using Grasshopper.Kernel.Data; 25 | using System; 26 | using System.Collections.Generic; 27 | using System.Linq; 28 | using System.Text; 29 | using System.Threading.Tasks; 30 | 31 | namespace BH.Engine.Grasshopper 32 | { 33 | public static partial class Create 34 | { 35 | /*******************************************/ 36 | /**** Public Methods ****/ 37 | /*******************************************/ 38 | 39 | public static DataTree DataTree(List> data, int iteration) 40 | { 41 | DataTree tree = new DataTree(); 42 | 43 | if (data.Count == 0) 44 | tree.EnsurePath(new GH_Path(iteration)); 45 | 46 | for (int i = 0; i < data.Count; i++) 47 | { 48 | tree.AddRange(data[i], new GH_Path(iteration, i)); 49 | } 50 | 51 | return tree; 52 | } 53 | 54 | /*******************************************/ 55 | 56 | public static DataTree DataTree(List> data, int iteration, IList paths) 57 | { 58 | DataTree master = new DataTree(); 59 | if (data.Count == 0) 60 | { 61 | master.EnsurePath(0); 62 | return new DataTree(); 63 | } 64 | else 65 | { 66 | for (int i = 0; i < data.Count; i++) 67 | { 68 | DataTree local = new DataTree(data[i], paths[iteration]); 69 | GH_Path path = paths[iteration].AppendElement(i); 70 | master.EnsurePath(path); 71 | master.AddRange(data[i], path); 72 | } 73 | } 74 | return master; 75 | } 76 | 77 | /*******************************************/ 78 | } 79 | } 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Query/CanvasID.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Linq; 26 | using System.Text; 27 | using System.Threading.Tasks; 28 | 29 | using GH = Grasshopper; 30 | using Grasshopper.Kernel; 31 | using System.ComponentModel; 32 | using BH.oM.Base.Attributes; 33 | 34 | namespace BH.Engine.Grasshopper 35 | { 36 | public static partial class Query 37 | { 38 | [Description("Gets a unique ID for a Grasshopper document based on the runtime ID of the document linked to a GUID. Valid only for the active session and will not be the same across sessions. Reloading Grasshopper will produce new IDs for the same files on a new load. This is predominantly used for Analytics.")] 39 | [Input("document", "A Grasshopper document to obtain a unique GUID from for the given runtime ID.")] 40 | [Output("canvasID", "A GUID set as a string to uniquely identify the session instance of the canvas.")] 41 | public static string CanvasID(this GH_Document document) 42 | { 43 | if (document == null) 44 | document = GH.Instances.ActiveCanvas.Document; 45 | if (document == null) 46 | return null; 47 | 48 | ulong documentKey = GetDocumentID(document); 49 | 50 | if (m_CanvasRunTimeIDs.ContainsKey(documentKey)) 51 | return m_CanvasRunTimeIDs[documentKey]; 52 | 53 | string newID = Guid.NewGuid().ToString(); 54 | m_CanvasRunTimeIDs.Add(documentKey, newID); 55 | return newID; 56 | } 57 | 58 | private static ulong GetDocumentID(GH_Document document) 59 | { 60 | if (document.Owner != null) 61 | return GetDocumentID(document.Owner.OwnerDocument()); //Recursive up to the highest level of a document 62 | 63 | return document.RuntimeID; 64 | } 65 | 66 | private static Dictionary m_CanvasRunTimeIDs = new Dictionary(); 67 | } 68 | } 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Convert/ToNodeParam.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Adapters.Rhinoceros; 24 | using BH.oM.Geometry; 25 | using System; 26 | using System.Collections.Generic; 27 | using System.Linq; 28 | using Grasshopper.Kernel; 29 | using System.Text; 30 | using System.Threading.Tasks; 31 | using BH.oM.Programming; 32 | using System.Reflection; 33 | 34 | namespace BH.Engine.Grasshopper 35 | { 36 | public static partial class Convert 37 | { 38 | /*******************************************/ 39 | /**** Public Methods ****/ 40 | /*******************************************/ 41 | 42 | public static INodeParam ToNodeParam(this IGH_Param param) 43 | { 44 | switch (param.Kind) 45 | { 46 | case GH_ParamKind.input: 47 | return ToReceiverParam(param); 48 | case GH_ParamKind.output: 49 | return ToDataParam(param); 50 | default: 51 | return null; 52 | } 53 | } 54 | 55 | /*******************************************/ 56 | 57 | public static ReceiverParam ToReceiverParam(this IGH_Param param) 58 | { 59 | return new ReceiverParam 60 | { 61 | Name = param.NickName, 62 | Description = param.Description, 63 | SourceId = param.SourceCount == 0 ? Guid.Empty : param.Sources.First().InstanceGuid, 64 | BHoM_Guid = param.InstanceGuid 65 | }; 66 | } 67 | 68 | /*******************************************/ 69 | 70 | public static DataParam ToDataParam(this IGH_Param param) 71 | { 72 | return new DataParam 73 | { 74 | Name = param.NickName, 75 | Description = param.Description, 76 | BHoM_Guid = param.InstanceGuid, 77 | TargetIds = param.Recipients.Select(r => r.InstanceGuid).ToList() 78 | }; 79 | } 80 | 81 | /*******************************************/ 82 | } 83 | } 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Grasshopper_UI/Render/RenderMaterial.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using GH = Grasshopper; 24 | using System.Drawing; 25 | using Rhino.Display; 26 | 27 | namespace BH.UI.Grasshopper 28 | { 29 | public static partial class Render 30 | { 31 | /***************************************************/ 32 | /**** Public Methods ****/ 33 | /***************************************************/ 34 | 35 | public static DisplayMaterial RenderMaterial(DisplayMaterial material, Color custom) 36 | { 37 | Color pColour = GH.Instances.ActiveCanvas.Document.PreviewColour; 38 | Color ghColour = material.Diffuse; 39 | if (ghColour.R == pColour.R && // If the color sent by PreviewArgs is the default object PreviewColour 40 | ghColour.G == pColour.G && 41 | ghColour.B == pColour.B) // Excluding Alpha channel from comparison 42 | { 43 | double transparency = (255 - custom.A) / (double)255; 44 | return new DisplayMaterial(custom, transparency); 45 | } 46 | else 47 | { 48 | return material; 49 | } 50 | } 51 | 52 | /***************************************************/ 53 | 54 | public static DisplayMaterial RenderMaterial(DisplayMaterial material, DisplayMaterial custom) 55 | { 56 | if (custom == null) 57 | return material; 58 | 59 | Color pColour = GH.Instances.ActiveCanvas.Document.PreviewColour; 60 | Color ghColour = material.Diffuse; 61 | if (ghColour.R == pColour.R && // If the color sent by PreviewArgs is the default object PreviewColour 62 | ghColour.G == pColour.G && 63 | ghColour.B == pColour.B) // Excluding Alpha channel from comparison 64 | { 65 | return custom; 66 | } 67 | else 68 | { 69 | return material; 70 | } 71 | } 72 | 73 | /***************************************************/ 74 | } 75 | } 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Grasshopper_UI/Goos/GH_Enum.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Serialiser; 24 | using GH_IO; 25 | using GH_IO.Serialization; 26 | using Grasshopper.Kernel.Types; 27 | using System; 28 | 29 | namespace BH.UI.Grasshopper.Goos 30 | { 31 | public class GH_Enum : GH_BHoMGoo, GH_ISerializable 32 | { 33 | /*******************************************/ 34 | /**** Properties ****/ 35 | /*******************************************/ 36 | 37 | public override string TypeName { get; } = "Enum"; 38 | 39 | public override string TypeDescription { get; } = "Defines an enum"; 40 | 41 | public override bool IsValid { get { return Value != null; } } 42 | 43 | 44 | /*******************************************/ 45 | /**** Constructors ****/ 46 | /*******************************************/ 47 | 48 | public GH_Enum() : base() { } 49 | 50 | /***************************************************/ 51 | 52 | public GH_Enum(Enum val) : base(val) { } 53 | 54 | 55 | /*******************************************/ 56 | /**** Override Methods ****/ 57 | /*******************************************/ 58 | 59 | public override IGH_Goo Duplicate() 60 | { 61 | return new GH_Enum { Value = Value }; 62 | } 63 | 64 | /***************************************************/ 65 | 66 | public override bool Read(GH_IReader reader) 67 | { 68 | string json = ""; 69 | reader.TryGetString("Json", ref json); 70 | 71 | if (json != null && json.Length > 0) 72 | Value = (Enum)BH.Engine.Serialiser.Convert.FromJson(json); 73 | 74 | return true; 75 | } 76 | 77 | /***************************************************/ 78 | 79 | public override bool Write(GH_IWriter writer) 80 | { 81 | if (Value != null) 82 | writer.SetString("Json", Value.ToJson()); 83 | return true; 84 | } 85 | 86 | /*******************************************/ 87 | } 88 | } 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Grasshopper_UI/CallerComponent/OnGHParamChanged.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using System.Linq; 25 | using Grasshopper.Kernel; 26 | using BH.oM.Base; 27 | using BH.oM.UI; 28 | using System.Collections.Generic; 29 | using System.Windows.Forms; 30 | using BH.UI.Grasshopper.Global; 31 | using Grasshopper.Kernel.Parameters; 32 | using BH.UI.Grasshopper.Parameters; 33 | using BH.oM.Geometry; 34 | using BH.Engine.Grasshopper; 35 | using BH.UI.Grasshopper.Components; 36 | using System.Collections; 37 | using BH.Adapter; 38 | using BH.oM.Base.Debugging; 39 | using BH.UI.Base; 40 | 41 | namespace BH.UI.Grasshopper.Templates 42 | { 43 | public abstract partial class CallerComponent : GH_Component, IGH_VariableParameterComponent, IGH_InitCodeAware 44 | { 45 | /*******************************************/ 46 | /**** Interface Methods ****/ 47 | /*******************************************/ 48 | 49 | protected virtual void OnGHParamChanged(object sender, GH_ParamServerEventArgs e) 50 | { 51 | if (Caller == null) 52 | return; 53 | 54 | if (e?.Parameter == null || e?.ParameterIndex == -1 || e?.ParameterSide == GH_ParameterSide.Output || Caller?.InputParams.Count - 1 < e.ParameterIndex) 55 | return; 56 | 57 | // Updating Caller.InputParams based on the new Grasshopper parameter just received 58 | // We update the InputParams with the new type or name 59 | if (m_NotifyChanges) 60 | { 61 | bool newName = Caller.InputParams.Count > e.ParameterIndex && Caller.InputParams[e.ParameterIndex].Name != e.Parameter.NickName; 62 | Caller.UpdateInput(e.ParameterIndex, e.Parameter.NickName, e.Parameter.Type(Caller)); 63 | 64 | if (newName) 65 | ExpireSolution(true); // It would be great to only expire the solution when the input menu closes to avoid doing it on each key stroke but there doesn't seem to be a way to access the menu 66 | } 67 | 68 | return; 69 | } 70 | 71 | 72 | /*******************************************/ 73 | /**** Private Fields ****/ 74 | /*******************************************/ 75 | 76 | protected bool m_NotifyChanges = true; 77 | 78 | /*******************************************/ 79 | } 80 | } 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Grasshopper_UI/CustomAttributes/PrototypeAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using Grasshopper.Kernel; 25 | using Grasshopper.Kernel.Attributes; 26 | using BH.oM.Base; 27 | using BH.UI.Grasshopper.Templates; 28 | using BH.UI.Base; 29 | using BH.UI.Base.Components; 30 | using Grasshopper.GUI.Canvas; 31 | using System.Drawing; 32 | using Grasshopper.GUI; 33 | using System.Drawing.Drawing2D; 34 | 35 | namespace BH.UI.Grasshopper.Components 36 | { 37 | public class PrototypeAttribute : GH_ComponentAttributes​ 38 | { 39 | /*******************************************/ 40 | /**** Properties ****/ 41 | /*******************************************/ 42 | 43 | public bool Visible { get; set; } = false; 44 | 45 | 46 | /*******************************************/ 47 | /**** Constructors ****/ 48 | /*******************************************/ 49 | 50 | public PrototypeAttribute(GH_Component owner) : base(owner) { } 51 | 52 | 53 | /*******************************************/ 54 | /**** Override Methods ****/ 55 | /*******************************************/ 56 | 57 | protected override void Layout() 58 | { 59 | base.Layout(); 60 | 61 | if (Visible) 62 | { 63 | m_LabelBounds = new RectangleF(Bounds.X, Bounds.Bottom, Bounds.Width, m_LabelHeight); 64 | Bounds = new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height + m_LabelHeight); 65 | } 66 | } 67 | 68 | /*******************************************/ 69 | 70 | protected override void Render(GH_Canvas canvas, Graphics graphics, GH_CanvasChannel channel) 71 | { 72 | base.Render(canvas, graphics, channel); 73 | 74 | // Only draw if visible and on hte correct channel 75 | if (!Visible || channel != GH_CanvasChannel.Objects) 76 | return; 77 | 78 | this.RenderPrototypeLabel(graphics, m_LabelBounds, this.Owner.Params.Input.Count == 0, this.Owner.Params.Output.Count == 0, m_DrawStrips); 79 | } 80 | 81 | /*******************************************/ 82 | /**** Private Fields ****/ 83 | /*******************************************/ 84 | 85 | RectangleF m_LabelBounds; 86 | int m_LabelHeight = 17; 87 | bool m_DrawStrips = true; 88 | 89 | /*******************************************/ 90 | } 91 | } 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /Grasshopper_UI/Components/UI/FalseStartToggle.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using System; 24 | using System.Drawing; 25 | using Grasshopper.Kernel; 26 | using Grasshopper.GUI; 27 | using BH.oM.Base; 28 | using BH.UI.Grasshopper.Templates; 29 | using BH.UI.Base; 30 | using BH.UI.Base.Components; 31 | using GH = Grasshopper; 32 | using System.Windows.Forms; 33 | using GH_IO.Serialization; 34 | using BH.Engine.Reflection; 35 | using BH.oM.UI; 36 | using Grasshopper.GUI.RemotePanel; 37 | using Grasshopper.Kernel.Attributes; 38 | using Grasshopper.GUI.Canvas; 39 | using Rhino.Runtime; 40 | using BH.Engine.Base; 41 | using BH.UI.Grasshopper.CustomAttributes; 42 | 43 | namespace BH.UI.Grasshopper.Components 44 | { 45 | public class FalseStartToggleComponent : CallerComponent 46 | { 47 | /*******************************************/ 48 | /**** Properties ****/ 49 | /*******************************************/ 50 | 51 | public override Caller Caller { get; } = new FalseStartToggleCaller(); 52 | 53 | /*******************************************/ 54 | 55 | public FalseStartToggleComponent() 56 | { 57 | UpdateComponentDisplay(); 58 | } 59 | 60 | /*******************************************/ 61 | 62 | public override bool Read(GH_IReader reader) 63 | { 64 | bool success = base.Read(reader); 65 | 66 | //Ensure the component is defaulting to false on load 67 | Caller.SetItem(false); 68 | UpdateComponentDisplay(); 69 | 70 | return success; 71 | } 72 | 73 | /*******************************************/ 74 | 75 | public override void CreateAttributes() 76 | { 77 | m_attributes = new FalseStartToggleAttributes(this); 78 | } 79 | 80 | /*******************************************/ 81 | 82 | public void UpdateComponent() 83 | { 84 | (Caller as FalseStartToggleCaller).SetItem(!(Caller as FalseStartToggleCaller).Value); 85 | } 86 | 87 | /*******************************************/ 88 | 89 | protected override void OnCallerModified(object sender, CallerUpdate update) 90 | { 91 | UpdateComponentDisplay(); 92 | 93 | base.OnCallerModified(sender, update); 94 | } 95 | 96 | /*******************************************/ 97 | 98 | private void UpdateComponentDisplay() 99 | { 100 | // Adding a tag under the component 101 | bool value = (bool)Caller.SelectedItem; 102 | Message = value.ToString(); 103 | 104 | SetIconOverride((Caller as FalseStartToggleCaller).Icon_24x24); 105 | } 106 | } 107 | } 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Grasshopper_UI/Goos/GH_BHoMGoo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Base; 24 | using Grasshopper.Kernel.Types; 25 | using System; 26 | 27 | namespace BH.UI.Grasshopper.Goos 28 | { 29 | public abstract class GH_BHoMGoo : GH_Goo 30 | { 31 | /*******************************************/ 32 | /**** Properties ****/ 33 | /*******************************************/ 34 | 35 | public override bool IsValid { get { return Value != null; } } 36 | 37 | 38 | /*******************************************/ 39 | /**** Constructors ****/ 40 | /*******************************************/ 41 | 42 | public GH_BHoMGoo() 43 | { 44 | this.Value = default(T); 45 | } 46 | 47 | /***************************************************/ 48 | 49 | public GH_BHoMGoo(T val) 50 | { 51 | this.Value = val; 52 | } 53 | 54 | 55 | /*******************************************/ 56 | /**** Override Methods ****/ 57 | /*******************************************/ 58 | 59 | public override string ToString() 60 | { 61 | if (Value == null) 62 | return "null"; 63 | return Value.IToText(); 64 | } 65 | 66 | /*******************************************/ 67 | 68 | public override bool CastTo(ref Q target) 69 | { 70 | try 71 | { 72 | object ptr = this.Value; 73 | target = (Q)ptr; 74 | return true; 75 | } 76 | catch (Exception) 77 | { 78 | string message = string.Format("Impossible to convert {0} into {1}. Check the input description for more details on the type of object that need to be provided", Value.GetType().FullName, typeof(Q).FullName); 79 | Engine.Base.Compute.RecordError(message); 80 | return false; 81 | } 82 | } 83 | 84 | /***************************************************/ 85 | 86 | public override bool CastFrom(object source) 87 | { 88 | try 89 | { 90 | if(source == null) 91 | return false; 92 | else if (source.GetType() == typeof(GH_Goo)) 93 | this.Value = ((GH_Goo)source).Value; 94 | else 95 | this.Value = (T)source; 96 | 97 | return true; 98 | } 99 | catch 100 | { 101 | string message = $"Impossible to convert {source.GetType().IToText()} into {typeof(T)}. Check the description of each input for more details on the type of object that need to be provided"; 102 | BH.Engine.Base.Compute.RecordError(message); 103 | return false; 104 | } 105 | } 106 | 107 | /*******************************************/ 108 | } 109 | } 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Grasshopper_Engine/Grasshopper_Engine.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net472 5 | 9.0.0.0 6 | https://github.com/BHoM/Grasshopper_UI 7 | 5.0.0 8 | BHoM 9 | Copyright © https://github.com/BHoM 10 | BH.Engine.Grasshopper 11 | 9.1.0.0 12 | ..\Build\ 13 | false 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | False 22 | $(ProgramData)\BHoM\Assemblies\BHoM.dll 23 | False 24 | 25 | 26 | False 27 | $(ProgramData)\BHoM\Assemblies\BHoM_Engine.dll 28 | False 29 | 30 | 31 | $(ProgramData)\BHoM\Assemblies\BHoM_UI.dll 32 | False 33 | False 34 | 35 | 36 | $(ProgramData)\BHoM\Assemblies\Data_Engine.dll 37 | False 38 | False 39 | 40 | 41 | $(ProgramData)\BHoM\Assemblies\Dimensional_oM.dll 42 | False 43 | False 44 | 45 | 46 | False 47 | $(ProgramData)\BHoM\Assemblies\Geometry_Engine.dll 48 | False 49 | 50 | 51 | $(ProgramData)\BHoM\Assemblies\Geometry_oM.dll 52 | False 53 | False 54 | 55 | 56 | $(ProgramData)\BHoM\Assemblies\Graphics_oM.dll 57 | False 58 | False 59 | 60 | 61 | $(ProgramData)\BHoM\Assemblies\Programming_oM.dll 62 | False 63 | False 64 | 65 | 66 | False 67 | $(ProgramData)\BHoM\Assemblies\Reflection_Engine.dll 68 | False 69 | 70 | 71 | False 72 | $(ProgramData)\BHoM\Assemblies\Rhinoceros_Engine.dll 73 | False 74 | 75 | 76 | False 77 | $(ProgramData)\BHoM\Assemblies\Serialiser_Engine.dll 78 | False 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | $(ProgramData)\BHoM\Assemblies\UI_Engine.dll 91 | False 92 | False 93 | 94 | 95 | $(ProgramData)\BHoM\Assemblies\UI_oM.dll 96 | False 97 | False 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /Grasshopper_UI/Templates/BakeableParam.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Buildings and Habitats object Model (BHoM) 3 | * Copyright (c) 2015 - 2026, the respective contributors. All rights reserved. 4 | * 5 | * Each contributor holds copyright over their respective contributions. 6 | * The project versioning (Git) records all such contribution source information. 7 | * 8 | * 9 | * The BHoM is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3.0 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The BHoM is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this code. If not, see . 21 | */ 22 | 23 | using BH.Engine.Grasshopper; 24 | using BH.UI.Grasshopper.Properties; 25 | using BH.UI.Grasshopper.Templates; 26 | using Grasshopper.Kernel; 27 | using System; 28 | using Rhino; 29 | using Rhino.DocObjects; 30 | using System.Collections.Generic; 31 | using Grasshopper.Kernel.Types; 32 | using System.Linq; 33 | 34 | namespace BH.UI.Grasshopper.Templates 35 | { 36 | public abstract class BakeableParam : BHoMParam, IGH_BakeAwareObject where T : class, IGH_Goo 37 | { 38 | /*******************************************/ 39 | /**** Properties ****/ 40 | /*******************************************/ 41 | 42 | public override bool IsPreviewCapable 43 | { 44 | get 45 | { 46 | if (VolatileDataCount < m_MaxItemsPreview || m_ForcePreview && !Hidden) 47 | { 48 | // Setting IsPreviewCapable from true to false clears the grasshopper geometry cache 49 | // be mindful to use m_ForcePreview and Hidden variables only in case the number of objects 50 | // to display is actually high 51 | //this.ClearRuntimeMessages(); 52 | return base.IsPreviewCapable; 53 | } 54 | Engine.Base.Compute.RecordNote("Preview has been disabled to prevent a slowdown due to the high number of objects." + 55 | "Right click and set the a new items limit to force the preview at your own risk."); 56 | Helpers.ShowEvents(this, Engine.Base.Query.CurrentEvents()); 57 | return false; 58 | } 59 | } 60 | 61 | public bool IsBakeCapable { get; } = true; 62 | 63 | 64 | /***************************************************/ 65 | /**** IGH_BakeAwareObject methods ****/ 66 | /***************************************************/ 67 | 68 | public void BakeGeometry(RhinoDoc doc, List obj_ids) 69 | { 70 | foreach (IGH_BakeAwareData item in this.VolatileData.AllData(true).OfType()) 71 | { 72 | Guid guid; 73 | if (item.BakeGeometry(doc, null, out guid)) 74 | obj_ids.Add(guid); 75 | } 76 | } 77 | 78 | /*******************************************/ 79 | 80 | public void BakeGeometry(RhinoDoc doc, ObjectAttributes att, List obj_ids) 81 | { 82 | foreach (IGH_BakeAwareData item in this.VolatileData.AllData(true).OfType()) 83 | { 84 | Guid guid; 85 | if (item.BakeGeometry(doc, att, out guid)) 86 | obj_ids.Add(guid); 87 | } 88 | } 89 | 90 | /*******************************************/ 91 | /**** Constructors ****/ 92 | /*******************************************/ 93 | 94 | public BakeableParam(string name, string nickname, string description, string category, string subcategory) 95 | : base(name, nickname, description, category, subcategory) 96 | { 97 | } 98 | 99 | /*******************************************/ 100 | } 101 | } 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | --------------------------------------------------------------------------------