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

Environmental_Engine: Removed AddOpening method #3172

Merged
Merged
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
35 changes: 6 additions & 29 deletions Environment_Engine/Modify/AddOpening.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,14 @@
/**** Public Methods ****/
/***************************************************/

[Description("Returns a single Environment Panel with the provided opening. Opening is added to the provided panel regardless of geometric association")]
[Input("panel", "A single Environment Panel to add the opening to")]
[Input("opening", "The Environment Opening to add to the panel")]
[Output("panel", "A modified Environment Panel with the provided opening added")]
public static Panel AddOpening(this Panel panel, Opening opening)
{
if(panel == null)
{
BH.Engine.Base.Compute.RecordError("Cannot add an opening to a null panel.");
return panel;
}

if(opening == null)
{
BH.Engine.Base.Compute.RecordError("Cannot add a null opening to a panel.");
return panel;
}

Panel clone = panel.DeepClone<Panel>();
if (clone.Openings == null) clone.Openings = new List<Opening>();
clone.Openings.Add(opening);
return clone;
}

[Description("Returns a list of Environment Panel with the provided openings added. Openings are added to the panels which contain them geometrically.")]
[Input("panels", "A collection of Environment Panels to add the opening to")]
[Input("openings", "A collection of Environment Openings to add to the panels")]
[Input("centroidTolerance", "Set the tolerance for obtaining the centroid of openings, default is set to BH.oM.Geometry.Tolerance.Distance")]
[Input("containingTolerance", "Set the tolerance for determining geometric association of openings to panels, default is set to BH.oM.Geometry.Tolerance.Distance")]
[Output("panels", "A collection of modified Environment Panels with the provided openings added")]
[Input("panels", "A collection of Environment Panels to add the opening to.")]
[Input("openings", "A collection of Environment Openings to add to the panels.")]
[Input("centroidTolerance", "Set the tolerance for obtaining the centroid of openings, default is set to BH.oM.Geometry.Tolerance.Distance.")]
[Input("containingTolerance", "Set the tolerance for determining geometric association of openings to panels, default is set to BH.oM.Geometry.Tolerance.Distance.")]
[Output("panels", "A collection of modified Environment Panels with the provided openings added.")]
[PreviousVersion("6.3", "BH.Engine.Environment.Modify.AddOpening(BH.oM.Environment.Elements.Panel, BH.oM.Environment.Elements.Opening)")]
public static List<Panel> AddOpenings(this List<Panel> panels, List<Opening> openings, double centroidTolerance = BH.oM.Geometry.Tolerance.Distance, double containingTolerance = BH.oM.Geometry.Tolerance.Distance)

Check warning on line 48 in Environment_Engine/Modify/AddOpening.cs

View check run for this annotation

BHoMBot-CI / code-compliance

Environment_Engine/Modify/AddOpening.cs#L48

Modify methods should return void, or their return type should be different to the input type of their first parameter - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/ModifyReturnsDifferentType
{
if (panels == null)
{
Expand Down