Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create representations for content instances #70

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.22" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
<!-- <PackageReference Include="Hypar.Space.LayoutFunctionCommon" Version="1.4.0" /> -->
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace ClassroomLayout

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public class ClassroomLayoutInputs : S3Args
public class ClassroomLayoutInputs : ArgsBase

{
[Newtonsoft.Json.JsonConstructor]

public ClassroomLayoutInputs(bool @createWalls, Overrides @overrides, string bucketName, string uploadsBucket, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
public ClassroomLayoutInputs(bool @createWalls, Overrides @overrides, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(modelInputKeys, gltfKey, elementsKey, ifcKey)
{
var validator = Validator.Instance.GetFirstValidatorForType<ClassroomLayoutInputs>();
if(validator != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,22 @@ public class ClassroomLayoutOutputs: SystemResults
/// Total count of seats
/// </summary>
[JsonProperty("Total count of desk seats")]
public double TotalCountOfDeskSeats {get; set;}


public double TotalCountOfDeskSeats { get; set; }

/// <summary>
/// Construct a ClassroomLayoutOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public ClassroomLayoutOutputs() : base()
{

}


/// <summary>
/// Construct a ClassroomLayoutOutputs specifying all inputs.
/// </summary>
/// <returns></returns>
[JsonConstructor]
public ClassroomLayoutOutputs(double totalCountOfDeskSeats): base()
public ClassroomLayoutOutputs(double totalCountOfDeskSeats) : base()
{
this.TotalCountOfDeskSeats = totalCountOfDeskSeats;

Expand Down
16 changes: 4 additions & 12 deletions LayoutFunctions/ClassroomLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<ClassroomLayoutInputs> store;
private UrlModelStore<ClassroomLayoutInputs> store;

public async Task<ClassroomLayoutOutputs> Handler(ClassroomLayoutInputs args, ILambdaContext context)
public async Task<ClassroomLayoutOutputs> Handler(ClassroomLayoutInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -61,15 +60,8 @@ public async Task<ClassroomLayoutOutputs> Handler(ClassroomLayoutInputs args, IL
Console.WriteLine($"Time to load assemblies: {sw.Elapsed.TotalSeconds})");

if(this.store == null)
{
if (args.SignedResourceUrls == null)
{
this.store = new S3ModelStore<ClassroomLayoutInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
}
else
{
this.store = new UrlModelStore<ClassroomLayoutInputs>();
}
{
this.store = new UrlModelStore<ClassroomLayoutInputs>();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public CirculationSegment(ThickenedPolyline @geometry, Profile @profile, double
this.Geometry = @geometry;
}


// Empty constructor
public CirculationSegment()
: base()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.22" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
<PackageReference Include="Hypar.Elements.Components" Version="2.0.0" />
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Elements.Components" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace CustomSpaceType

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public class CustomSpaceTypeInputs : S3Args
public class CustomSpaceTypeInputs : ArgsBase

{
[Newtonsoft.Json.JsonConstructor]

public CustomSpaceTypeInputs(IList<Layouts> @layouts, Overrides @overrides, string bucketName, string uploadsBucket, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
public CustomSpaceTypeInputs(IList<Layouts> @layouts, Overrides @overrides, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(modelInputKeys, gltfKey, elementsKey, ifcKey)
{
var validator = Validator.Instance.GetFirstValidatorForType<CustomSpaceTypeInputs>();
if(validator != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ namespace CustomSpaceType
public class CustomSpaceTypeOutputs: SystemResults
{


/// <summary>
/// Construct a CustomSpaceTypeOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public CustomSpaceTypeOutputs() : base()
{

}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public LevelElements(IList<Element> @elements, System.Guid @level, System.Guid @
this.Level = @level;
}


// Empty constructor
public LevelElements()
: base()
Expand Down
8 changes: 7 additions & 1 deletion LayoutFunctions/CustomLayout/dependencies/LevelVolume.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class LevelVolume : GeometricElement
{
[JsonConstructor]
public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, IList<Profile> @profiles, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Profile = @profile;
Expand All @@ -37,8 +37,10 @@ public LevelVolume(Profile @profile, double @height, double @area, string @build
this.Level = @level;
this.Mass = @mass;
this.PlanView = @planView;
this.Profiles = @profiles;
}


// Empty constructor
public LevelVolume()
: base()
Expand Down Expand Up @@ -73,6 +75,10 @@ public LevelVolume()
[JsonProperty("Plan View", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? PlanView { get; set; }

/// <summary>Multiple profiles used for a collection of volumes</summary>
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public IList<Profile> Profiles { get; set; }


}
}
14 changes: 12 additions & 2 deletions LayoutFunctions/CustomLayout/dependencies/SpaceBoundary.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class SpaceBoundary : GeometricElement
{
[JsonConstructor]
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, string @defaultWallType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Boundary = @boundary;
Expand All @@ -38,11 +38,14 @@ public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, dou
this.Height = @height;
this.ProgramGroup = @programGroup;
this.ProgramType = @programType;
this.ProgramRequirement = @programRequirement;
this.Level = @level;
this.LevelLayout = @levelLayout;
this.HyparSpaceType = @hyparSpaceType;
this.DefaultWallType = @defaultWallType;
}


// Empty constructor
public SpaceBoundary()
: base()
Expand Down Expand Up @@ -78,9 +81,12 @@ public SpaceBoundary()
public string ProgramGroup { get; set; }

/// <summary>The name of the program type assigned to this space (like "Open Office" or "Meeting Room")</summary>
[JsonProperty("Program Type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonProperty("Program Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string ProgramType { get; set; }

[JsonProperty("Program Requirement", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? ProgramRequirement { get; set; }

[JsonProperty("Level", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? Level { get; set; }

Expand All @@ -92,6 +98,10 @@ public SpaceBoundary()
[JsonProperty("Hypar Space Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string HyparSpaceType { get; set; }

/// <summary>What wall type should generally be created for this space type? This may get overridden later on for a specific wall.</summary>
[JsonProperty("Default Wall Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string DefaultWallType { get; set; }


}
}
63 changes: 0 additions & 63 deletions LayoutFunctions/CustomLayout/dependencies/ThickenedPolyline.g.cs

This file was deleted.

10 changes: 5 additions & 5 deletions LayoutFunctions/CustomLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<CustomSpaceTypeInputs> store;
private UrlModelStore<CustomSpaceTypeInputs> store;

public async Task<CustomSpaceTypeOutputs> Handler(CustomSpaceTypeInputs args, ILambdaContext context)
public async Task<CustomSpaceTypeOutputs> Handler(CustomSpaceTypeInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -61,9 +60,10 @@ public async Task<CustomSpaceTypeOutputs> Handler(CustomSpaceTypeInputs args, IL
Console.WriteLine($"Time to load assemblies: {sw.Elapsed.TotalSeconds})");

if(this.store == null)
{
this.store = new S3ModelStore<CustomSpaceTypeInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
{
this.store = new UrlModelStore<CustomSpaceTypeInputs>();
}


var l = new InvocationWrapper<CustomSpaceTypeInputs,CustomSpaceTypeOutputs> (store, CustomSpaceType.Execute);
var output = await l.InvokeAsync(args);
Expand Down
6 changes: 3 additions & 3 deletions LayoutFunctions/Doors/dependencies/Doors.Dependencies.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.22" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectReference Include="..\..\LayoutFunctionCommon\LayoutFunctionCommon.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0-alpha.22" />
<PackageReference Include="Hypar.Functions" Version="1.9.0-alpha.3" />
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace InteriorPartitions

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public class InteriorPartitionsInputs : S3Args
public class InteriorPartitionsInputs : ArgsBase

{
[Newtonsoft.Json.JsonConstructor]

public InteriorPartitionsInputs(string bucketName, string uploadsBucket, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
public InteriorPartitionsInputs(Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(modelInputKeys, gltfKey, elementsKey, ifcKey)
{
var validator = Validator.Instance.GetFirstValidatorForType<InteriorPartitionsInputs>();
if(validator != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ namespace InteriorPartitions
public class InteriorPartitionsOutputs: SystemResults
{


/// <summary>
/// Construct a InteriorPartitionsOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public InteriorPartitionsOutputs() : base()
{

}


}
}
Loading
Loading