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

IFC 4x3 integration (including .NET6 port) #196

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile Condition=" '$(IsTestProject)' != 'true' ">true</GenerateDocumentationFile>
<NoWarn>CS1591</NoWarn>
<NoWarn>CS1591;NU1603</NoWarn>
</PropertyGroup>

<PropertyGroup>
<Version>5.1.0.0</Version>
<Version>6.0.0.0</Version>
<Copyright>Copyright © XBIM Ltd</Copyright>
<Company>Xbim Ltd.</Company>
<Authors>Steve Lockley, Martin Cerny and XBIMTeam Contributors</Authors>
Expand All @@ -17,14 +17,14 @@
<PackageProjectUrl>https://github.com/xBimTeam/XbimWindowsUI</PackageProjectUrl>
<PackageIconUrl>https://avatars1.githubusercontent.com/u/2284875?v=3&amp;amp;s=240</PackageIconUrl>
<PackageReleaseNotes>
Now built on XBIM v5. Migrated from log4net to Microsoft.Extensions.Logging.
Now built on XBIM v6 to support netCore and IFC4x3
</PackageReleaseNotes>
<PackageTags>BIM, IFC, IfcXml, IfcZip, Ifc4, COBie, BuildingSmart</PackageTags>
<RepositoryUrl>https://github.com/xBimTeam/XbimWindowsUI/tree/master</RepositoryUrl>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<SignAssembly>true</SignAssembly>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>..\XbimOpenSourceKeyFile.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
</PropertyGroup>
Expand Down
16 changes: 5 additions & 11 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472</TargetFrameworks>
<TargetFrameworks>net6.0-windows</TargetFrameworks>
<Title>Xbim Presentation Tests</Title>
<Description>Unit Tests for Xbim.Presentation</Description>
<Platforms>AnyCPU;x86</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Xbim.Presentation\Xbim.Presentation.csproj" />
Expand Down
22 changes: 15 additions & 7 deletions Xbim.Presentation/DrawingControl3D.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Windows.Threading;
using HelixToolkit.Wpf;
using Xbim.Common;
using Xbim.Common.Configuration;
using Xbim.Common.Federation;
using Xbim.Common.Geometry;
using Xbim.Common.Metadata;
Expand Down Expand Up @@ -231,9 +232,12 @@ protected void ClipPlaneHandlesHide()
{
typeof(Ifc2x3.ProductExtension.IfcSpace),
typeof(Ifc4.ProductExtension.IfcSpace),
typeof(Ifc2x3.ProductExtension.IfcFeatureElement),
typeof(Ifc4.ProductExtension.IfcFeatureElement)
};
typeof(Ifc4x3.ProductExtension.IfcSpace),

typeof(Ifc2x3.ProductExtension.IfcFeatureElement),
typeof(Ifc4.ProductExtension.IfcFeatureElement),
typeof(Ifc4x3.ProductExtension.IfcFeatureElement)
};

/// <summary>
/// The list of types that the engine will not consider in the generation of the scene, the exclusion code needs to be correctly implemented in the
Expand Down Expand Up @@ -1159,7 +1163,7 @@ private WpfMeshGeometry3D GetSelectionGeometry(IPersistEntity newVal, WpfMateria
var gri = newVal as IIfcGeometricRepresentationItem;
if (gri != null)
{
var engine = new XbimGeometryEngine();
var engine = new XbimGeometryEngine(Model, XbimServices.Current.GetLoggerFactory());
var solid = engine.Create(gri, null);
if (solid != null)
{
Expand Down Expand Up @@ -1360,10 +1364,14 @@ private void ClearGraphics(ModelRefreshOptions options = ModelRefreshOptions.Non
Materials.Clear();
OriginalOpacities.Clear();

Opaques.Children.Clear();
Transparents.Children.Clear();
if(Opaques != null)
Opaques.Children.Clear();
if(Transparents != null)
Transparents.Children.Clear();
if(Extras != null)
Extras.Children.Clear();
Overlays.Children.Clear();
if(Overlays != null)
Overlays.Children.Clear();

if (!options.HasFlag(ModelRefreshOptions.ViewPreserveSelection))
{
Expand Down
2 changes: 1 addition & 1 deletion Xbim.Presentation/DynamicProductSelectionControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private void btnPerform_Click(object sender, RoutedEventArgs e)
compilerParams.ReferencedAssemblies.Add("System.Xml.dll");
compilerParams.ReferencedAssemblies.Add("System.Xml.Linq.dll");
compilerParams.ReferencedAssemblies.Add("Xbim.Common.dll");
compilerParams.ReferencedAssemblies.Add("Xbim.Ifc2x3.dll");
compilerParams.ReferencedAssemblies.Add("Xbim.Ifc2x3.dll"); // TODO: handle newer schemas
compilerParams.ReferencedAssemblies.Add("Xbim.IO.dll");
compilerParams.ReferencedAssemblies.Add("Xbim.Ifc.Extensions.dll");

Expand Down
4 changes: 2 additions & 2 deletions Xbim.Presentation/Extensions/ObservableMeshVisual3D.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel;
using HelixToolkit.Wpf;
using System.ComponentModel;
using System.Windows.Media.Media3D;
using HelixToolkit.Wpf;
using Xbim.Presentation.Extensions.Utility;

namespace Xbim.Presentation.Extensions
Expand Down
7 changes: 6 additions & 1 deletion Xbim.Presentation/FederatedModel/FederatedModelViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ public string Project
var x4 = project as Ifc4.Kernel.IfcProject;
x4.Name = value;
}

else if (project is Ifc4x3.Kernel.IfcProject)
{
var x4 = project as Ifc4.Kernel.IfcProject;
x4.Name = value;
}

txn.Commit();
}
OnPropertyChanged("Project");
Expand Down
3 changes: 2 additions & 1 deletion Xbim.Presentation/LayerStyling/BoundingBoxStyler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Windows;
using System.Windows.Media.Media3D;
using Xbim.Common;
using Xbim.Common.Configuration;
using Xbim.Common.Federation;
using Xbim.Common.Geometry;
using Xbim.Ifc;
Expand All @@ -28,7 +29,7 @@ public class BoundingBoxStyler : ILayerStyler, IProgressiveLayerStyler

public BoundingBoxStyler(ILogger logger = null)
{
Logger = logger ?? XbimLogging.CreateLogger<BoundingBoxStyler>();
Logger = logger ?? XbimServices.Current.CreateLogger<BoundingBoxStyler>();
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion Xbim.Presentation/LayerStyling/IndividualElementStyler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Windows.Media;
using System.Windows.Media.Media3D;
using Xbim.Common;
using Xbim.Common.Configuration;
using Xbim.Common.Federation;
using Xbim.Common.Geometry;
using Xbim.Ifc;
Expand Down Expand Up @@ -176,7 +177,7 @@ private void animationEvent(object sender, EventArgs e)

public IndividualElementStyler(ILogger logger = null)
{
Logger = logger ?? XbimLogging.CreateLogger<SurfaceLayerStyler>();
Logger = logger ?? XbimServices.Current.CreateLogger<SurfaceLayerStyler>();
}

ModelVisual3D op;
Expand Down
3 changes: 2 additions & 1 deletion Xbim.Presentation/LayerStyling/RandomColorStyler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Windows;
using System.Windows.Media.Media3D;
using Xbim.Common;
using Xbim.Common.Configuration;
using Xbim.Common.Federation;
using Xbim.Common.Geometry;
using Xbim.Ifc;
Expand All @@ -24,7 +25,7 @@ public class RandomColorStyler : ILayerStyler, IProgressiveLayerStyler

public RandomColorStyler(ILogger logger = null)
{
Logger = logger ?? XbimLogging.CreateLogger<RandomColorStyler>();
Logger = logger ?? XbimServices.Current.CreateLogger<RandomColorStyler>();
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion Xbim.Presentation/LayerStyling/SurfaceLayerStyler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Windows;
using System.Windows.Media.Media3D;
using Xbim.Common;
using Xbim.Common.Configuration;
using Xbim.Common.Federation;
using Xbim.Common.Geometry;
using Xbim.Ifc;
Expand All @@ -26,7 +27,7 @@ public class SurfaceLayerStyler : ILayerStyler, IProgressiveLayerStyler

public SurfaceLayerStyler(ILogger logger = null)
{
Logger = logger ?? XbimLogging.CreateLogger<SurfaceLayerStyler>();
Logger = logger ?? XbimServices.Current.CreateLogger<SurfaceLayerStyler>();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Xbim.Presentation/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
[assembly: Guid("603a1283-949b-4733-bb77-0c622e46346d")]

[assembly: XmlnsDefinition("http://schemas.Xbim.com/Presentation", "Xbim.Presentation")]
[assembly: InternalsVisibleTo("Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010029a3c6da60efcb3ebe48c3ce14a169b5fa08ffbf5f276392ffb2006a9a2d596f5929cf0e68568d14ac7cbe334440ca0b182be7fa6896d2a73036f24bca081b2427a8dec5689a97f3d62547acd5d471ee9f379540f338bbb0ae6a165b44b1ae34405624baa4388404bce6d3e30de128cec379147af363ce9c5845f4f92d405ed0")]
[assembly: InternalsVisibleTo("Tests")]

[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
Expand Down
38 changes: 19 additions & 19 deletions Xbim.Presentation/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Xbim.Presentation/Properties/Resources.de.Designer.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Xbim.Presentation/Themes/Generic.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xbim.Presentation"
xmlns:helixToolkit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"
xmlns:helixToolkit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Core.Wpf"
xmlns:extensions="clr-namespace:Xbim.Presentation.Extensions">
<Style x:Key="{x:Type local:DrawingControl3D}" TargetType="{x:Type local:DrawingControl3D}">
<Setter Property="Template">
Expand Down
Loading