Skip to content

Fix descriptions for various #3528

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

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
ada79d4
Analytical_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
b3e85ef
BHoM_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
261a471
Data_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
e90d949
Environment_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
2752862
Facade_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
3942cd3
Geometry_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
e831fca
Graphics_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
86c863d
Library_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
f5b6ff7
Matter_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
3a4b3ed
Reflection_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
1215723
Serialiser_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
5bcccf0
Spatial_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
6701d30
Structure_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
1625379
Versioning_Engine: Fix XML documentation spelling and grammar errors
peterjamesnugent Jun 20, 2025
1215f8c
Add documentation punctuation
BHoMBot Jun 20, 2025
85bcd92
Reinstate whitespace changes and fix some headings
peterjamesnugent Jun 26, 2025
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
42 changes: 11 additions & 31 deletions Analytical_Engine/Modify/SetOutlineElements1D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System;
using BH.oM.Dimensional;
using BH.oM.Geometry;
Expand All @@ -31,77 +30,65 @@
using BH.Engine.Geometry;
using BH.Engine.Base;


namespace BH.Engine.Analytical
{
public static partial class Modify
{
/***************************************************/
/**** Public Methods ****/
/***************************************************/

[Description("Sets the Outline Element1Ds of an opening, i.e. the Edges of an Opening. Method required for all IElement2Ds.")]
[Input("opening", "The Opening to update the Edges of.")]
[Input("edges", "A list of IElement1Ds which all should be of a type of Edge accepted by the Opening or Geometrical ICurve. \n" +
"ICurve will default the outlines properties.")]
[Input("edges", "A list of IElement1Ds which all should be of a type of Edge accepted by the Opening or Geometrical ICurve. \n" + "ICurve will default the outlines properties.")]
[Output("opening", "The opening with updated Edges.")]
public static IOpening<TEdge> SetOutlineElements1D<TEdge>(this IOpening<TEdge> opening, IEnumerable<IElement1D> edges)

Check warning on line 44 in Analytical_Engine/Modify/SetOutlineElements1D.cs

View check run for this annotation

BHoMBot-CI / code-compliance

Analytical_Engine/Modify/SetOutlineElements1D.cs#L44

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
where TEdge : IEdge
where TEdge : IEdge
{
IOpening<TEdge> o = opening.ShallowClone();

o.Edges = ConvertToEdges<TEdge>(edges);
return o;
}

/***************************************************/

[Description("Sets the outline Element1Ds of a IPanel, i.e. the ExternalEdges of a IPanel. Method required for all IElement2Ds.")]
[Input("panel", "The IPanel to update the ExternalEdges of.")]
[Input("edges", "A list of IElement1Ds which all should be of a type of Edge accepted by the IPanel or Geometrical ICurve. \n" +
"ICurve will default the outlines properties.")]
[Input("edges", "A list of IElement1Ds which all should be of a type of Edge accepted by the IPanel or Geometrical ICurve. \n" + "ICurve will default the outlines properties.")]
[Output("panel", "The IPanel with updated ExternalEdges.")]
public static IPanel<TEdge, TOpening> SetOutlineElements1D<TEdge, TOpening>(this IPanel<TEdge, TOpening> panel, IEnumerable<IElement1D> edges)

Check warning on line 57 in Analytical_Engine/Modify/SetOutlineElements1D.cs

View check run for this annotation

BHoMBot-CI / code-compliance

Analytical_Engine/Modify/SetOutlineElements1D.cs#L57

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
where TEdge : IEdge
where TOpening : IOpening<TEdge>
where TEdge : IEdge where TOpening : IOpening<TEdge>
{
IPanel<TEdge, TOpening> pp = panel.ShallowClone();

pp.ExternalEdges = ConvertToEdges<TEdge>(edges);
return pp;
}

/***************************************************/

[Description("Sets the Outline Element1Ds of an IRegion, i.e. the perimiter. Method required for all IElement2Ds.")]
[Description("Sets the Outline Element1Ds of an IRegion, i.e. the perimeter. Method required for all IElement2Ds.")]
[Input("region", "The IRegion to update the Perimeter of.")]
[Input("outlineElements", "A list of IElement1Ds which all should be Geometrical ICurves.")]
[Output("region", "The region with updated perimiter.")]
[Output("region", "The region with updated perimeter.")]
public static IRegion SetOutlineElements1D(this IRegion region, IEnumerable<IElement1D> outlineElements)

Check warning on line 70 in Analytical_Engine/Modify/SetOutlineElements1D.cs

View check run for this annotation

BHoMBot-CI / code-compliance

Analytical_Engine/Modify/SetOutlineElements1D.cs#L70

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(region == null)
if (region == null)
{
BH.Engine.Base.Compute.RecordError("Cannot set the outline 1D elements of a null region.");
return null;
}

IRegion r = region.ShallowClone();

IEnumerable<ICurve> joinedCurves = outlineElements.Cast<ICurve>();
if (outlineElements.Count() != 1)
joinedCurves = Engine.Geometry.Compute.IJoin(outlineElements.Cast<ICurve>().ToList());

if (joinedCurves.Count() == 1)
{
if (!joinedCurves.First().IIsClosed())
Engine.Base.Compute.RecordWarning("The outline elements assigned to the region do not form a closed loop.");

r.Perimeter = joinedCurves.First();
}
else
{
Engine.Base.Compute.RecordWarning("The outline elements assigned to the region are disjointed.");
r.Perimeter = new PolyCurve { Curves = outlineElements.Cast<ICurve>().ToList() };
r.Perimeter = new PolyCurve{Curves = outlineElements.Cast<ICurve>().ToList()};
}

return r;
Expand All @@ -110,7 +97,6 @@
/***************************************************/
/**** Private Methods ****/
/***************************************************/

[Description("Takes a list of IElement1D and returns a TEdge for each element. If the IElement1D is a curve a new TEdge is created and assigned the curve. If not, the IElement1D is cast to the TEdge.")]
private static List<TEdge> ConvertToEdges<TEdge>(IEnumerable<IElement1D> element1ds)
where TEdge : IEdge
Expand All @@ -127,17 +113,11 @@
}
else
edge = (TEdge)element1D;

edges.Add(edge);
}

return edges;
}

/***************************************************/
/***************************************************/
}
}





}
71 changes: 18 additions & 53 deletions Analytical_Engine/Query/Geometry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/


using BH.Engine.Geometry;
using BH.oM.Geometry;
using BH.oM.Analytical.Elements;
Expand All @@ -43,7 +41,6 @@ public static partial class Query
/***************************************************/
/**** Public Methods ****/
/***************************************************/

[Description("Gets the geometry of a INode as a Point. Method required for automatic display in UI packages.")]
[Input("node", "INode to get the Point from.")]
[Output("point", "The geometry of the INode.")]
Expand All @@ -53,19 +50,17 @@ public static Point Geometry(this INode node)
}

/***************************************************/

[PreviousInputNames("link", "bar")]
[Description("Gets the geometry of a ILink as its centreline. Method required for automatic display in UI packages.")]
[Input("link", "ILink to get the centreline geometry from.")]
[Output("line", "The geometry of the ILink as its centreline.")]
public static Line Geometry<TNode>(this ILink<TNode> link)
where TNode : INode
{
return new Line { Start = link?.Start?.Position, End = link?.End?.Position };
return new Line{Start = link?.Start?.Position, End = link?.End?.Position};
}

/***************************************************/

[Description("Gets the geometry of a IEdge as its Curve. Method required for automatic display in UI packages.")]
[Input("edge", "IEdge to get the curve geometry from.")]
[Output("curve", "The geometry of the IEdge as its Curve.")]
Expand All @@ -75,33 +70,26 @@ public static ICurve Geometry(this IEdge edge)
}

/***************************************************/

[Description("Gets the geometry of a analytical IPanel at its centre. Method required for automatic display in UI packages.")]
[Input("panel", "IPanel to get the planar surface geometry from.")]
[Output("surface", "The geometry of the analytical IPanel at its centre.")]
public static PlanarSurface Geometry<TEdge, TOpening>(this IPanel<TEdge, TOpening> panel)
where TEdge : IEdge
where TOpening : IOpening<TEdge>
where TEdge : IEdge where TOpening : IOpening<TEdge>
{
return Engine.Geometry.Create.PlanarSurface(
Engine.Geometry.Compute.IJoin(panel?.ExternalEdges?.Select(x => x?.Curve).ToList()).FirstOrDefault(),
panel?.Openings.SelectMany(x => Engine.Geometry.Compute.IJoin(x?.Edges.Select(y => y?.Curve).ToList())).Cast<ICurve>().ToList());
return Engine.Geometry.Create.PlanarSurface(Engine.Geometry.Compute.IJoin(panel?.ExternalEdges?.Select(x => x?.Curve).ToList()).FirstOrDefault(), panel?.Openings.SelectMany(x => Engine.Geometry.Compute.IJoin(x?.Edges.Select(y => y?.Curve).ToList())).Cast<ICurve>().ToList());
}

/***************************************************/

[Description("Gets the geometry of a analytical IOpening as an outline curve. Method required for automatic display in UI packages.")]
[Input("opening", "IOpening to get the outline geometry from.")]
[Output("outline", "The geometry of the analytical IOpening.")]
public static PolyCurve Geometry<TEdge>(this IOpening<TEdge> opening)
where TEdge : IEdge

{
return new PolyCurve { Curves = opening?.Edges?.Select(x => x?.Curve).ToList() };
return new PolyCurve{Curves = opening?.Edges?.Select(x => x?.Curve).ToList()};
}

/***************************************************/

[Description("Gets the geometry of a analytical ISurface at its centre. Method required for automatic display in UI packages.")]
[Input("surface", "Analytical ISurface to get the geometrical Surface geometry from.")]
[Output("surface", "The underlying surface geometry of the analytical ISurface at its centre.")]
Expand All @@ -111,26 +99,20 @@ public static IGeometry Geometry(this BH.oM.Analytical.Elements.ISurface surface
}

/***************************************************/

[PreviousInputNames("mesh", "feMesh")]
[Description("Gets the geometry of a analytical IMesh as a geometrical Mesh. A geometrical mesh only supports 3 and 4 nodes faces, while a FEMesh does not have this limitation. For FEMeshFaces with more than 4 nodes or less than 3 this operation is therefore not possible. Method required for automatic display in UI packages.")]
[Input("mesh", "Analytical IMesh to get the mesh geometry from.")]
[Output("mesh", "The geometry of the IMesh as a geometrical Mesh.")]
public static Mesh Geometry<TNode, TFace>(this IMesh<TNode, TFace> mesh)
where TNode : INode
where TFace : IFace
where TNode : INode where TFace : IFace
{
Mesh geoMesh = new Mesh();

geoMesh.Vertices = mesh?.Nodes?.Select(x => x?.Position).ToList();

geoMesh.Faces.AddRange(mesh?.Faces?.Geometry());

return geoMesh;
}

/***************************************************/

[PreviousInputNames("faces", "feFaces")]
[Description("Gets the geometry of a collection of IFaces as a geometrical Mesh's Faces. A geometrical mesh face only supports 3 and 4 nodes faces, while a FEMeshFace does not have this limitation. For FEMeshFaces with more than 4 nodes or less than 3 this operation is therefore not possible. Method required for automatic display in UI packages.")]
[Input("faces", "Analytical IFaces to get the mesh faces geometry from.")]
Expand All @@ -145,11 +127,11 @@ public static IEnumerable<Face> Geometry<TFace>(this IEnumerable<TFace> faces)
if (face != null)
result.Add(face);
}

return result;
}

/***************************************************/

[PreviousInputNames("face", "feFace")]
[Description("Gets the geometry of a analytical IFace as a geometrical Mesh's Face. A geometrical mesh face only supports 3 and 4 nodes faces, while a FEMeshFace does not have this limitation. For FEMeshFaces with more than 4 nodes or less than 3 this operation is therefore not possible. Method required for automatic display in UI packages.")]
[Input("face", "Analytical IFace to get the mesh face geometry from.")]
Expand All @@ -158,55 +140,49 @@ public static Face Geometry(this IFace face)
{
if (face?.NodeListIndices == null)
return null;

if (face.NodeListIndices.Count < 3)
{
Base.Compute.RecordError("Insuffiecient node indices");
return null;
}

if (face.NodeListIndices.Count > 4)
{
Base.Compute.RecordError("To high number of node indices. Can only handle triangular and quads");
return null;
}

Face geomFace = new Face();

geomFace.A = face.NodeListIndices[0];
geomFace.B = face.NodeListIndices[1];
geomFace.C = face.NodeListIndices[2];

if (face.NodeListIndices.Count == 4)
geomFace.D = face.NodeListIndices[3];

return geomFace;
}

/***************************************************/

[Description("Gets the geometry of a IRegion as its Perimiter curve. Method required for automatic display in UI packages.")]
[Description("Gets the geometry of a IRegion as its Perimeter curve. Method required for automatic display in UI packages.")]
[Input("region", "IRegion to get the curve geometry from.")]
[Output("curve", "The geometry of the IRegion as its Perimiter curve.")]
[Output("curve", "The geometry of the IRegion as its Perimeter curve.")]
public static ICurve Geometry(this IRegion region)
{
return region?.Perimeter;
}

/***************************************************/

[Description("Gets the geometry of a Graph as its relation curve arrows. For relations between entities of IElement0D types and outmatic curve is created if it does not exist. Method required for automatic display in UI packages.")]
[Description("Gets the geometry of a Graph as its relation curve arrows. For relations between entities of IElement0D types and automatic curve is created if it does not exist. Method required for automatic display in UI packages.")]
[Input("graph", "Graph to get the geometry from.")]
[Output("Composite Geometry", "The CompositeGeometry geometry of the Graph.")]
public static CompositeGeometry Geometry(this Graph graph)
{
if(graph == null)
if (graph == null)
{
BH.Engine.Base.Compute.RecordError("Cannot query the geometry of a null graph.");
return null;
}

Dictionary<Guid, Point> element0DGeoms = graph.Entities.Where(x => x.Value is IElement0D).ToDictionary(x => x.Key, x => ((IElement0D)x.Value).IGeometry());

bool relNoGeom = false;
List<IGeometry> geometries = new List<IGeometry>();
foreach (Relation relation in graph.Relations)
Expand All @@ -215,30 +191,19 @@ public static CompositeGeometry Geometry(this Graph graph)
{
Point sourcePt, targetPt;
if (relation.Curve != null)
geometries.Add(relation.RelationArrow()); //If Relation have a curve defined, use it to display
geometries.Add(relation.RelationArrow()); //If Relation have a curve defined, use it to display
else if (element0DGeoms.TryGetValue(relation.Source, out sourcePt) && element0DGeoms.TryGetValue(relation.Target, out targetPt))
geometries.Add(new Relation { Curve = new Line { Start = sourcePt, End = targetPt } }.RelationArrow()); //Relation between two IElement0Ds - Generate a curve between them and draw arrow
geometries.Add(new Relation{Curve = new Line{Start = sourcePt, End = targetPt}}.RelationArrow()); //Relation between two IElement0Ds - Generate a curve between them and draw arrow
else
relNoGeom = true; //Some relations can not be displayed automatically, flag to raise warning
relNoGeom = true; //Some relations can not be displayed automatically, flag to raise warning
}
}

geometries.AddRange(element0DGeoms.Values); //Add Points representing IElement0Ds to the list

if(relNoGeom) //Raise warning if relations that could not be displayed was found
if (relNoGeom) //Raise warning if relations that could not be displayed was found
Base.Compute.RecordWarning("Geometry is only displayed for Relations that either have their Curve set or span between entities that are IElement0D.");


return new CompositeGeometry { Elements = geometries };

return new CompositeGeometry{Elements = geometries};
}

/***************************************************/


/***************************************************/
}
}




}
20 changes: 4 additions & 16 deletions Analytical_Engine/Query/IsOutlineTrianglular.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using BH.oM.Analytical.Elements;
using BH.oM.Geometry;
using BH.oM.Base.Attributes;
using BH.Engine.Geometry;
using BH.Engine.Reflection;

using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -38,25 +36,15 @@ public static partial class Query
/***************************************************/
/**** Public Methods ****/
/***************************************************/

[Description("Determines whether a Panel's outline is triangular.")]
[Input("panel", "The IPanel to check if the outline is a triangular.")]
[Input("panel", "The IPanel to check if the outline is triangular.")]
[Output("bool", "True for Panels with a triangular outline or false for Panels with a non-triangular outline.")]
public static bool IsOutlineTriangular<TEdge, TOpening>(this IPanel<TEdge, TOpening> panel)
where TEdge : IEdge
where TOpening : IOpening<TEdge>
where TEdge : IEdge where TOpening : IOpening<TEdge>
{
PolyCurve polycurve = ExternalPolyCurve(panel);

return polycurve.IsTriangular();

}

/***************************************************/

/***************************************************/
}
}




}
Loading