From 085aba5280a005e1bdee5029fee5f2859890c21b Mon Sep 17 00:00:00 2001 From: Santiago Burbano Date: Tue, 20 Jun 2023 16:29:51 -0500 Subject: [PATCH 1/2] Added GeometryLoaded event to DrawingControl3D (WPF) --- Xbim.Presentation/DrawingControl3D.xaml.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Xbim.Presentation/DrawingControl3D.xaml.cs b/Xbim.Presentation/DrawingControl3D.xaml.cs index f5268102..0eb33c8b 100644 --- a/Xbim.Presentation/DrawingControl3D.xaml.cs +++ b/Xbim.Presentation/DrawingControl3D.xaml.cs @@ -664,11 +664,13 @@ private IPersistEntity GetClickedEntity(RayMeshGeometry3DHitTestResult hit) : (modelHit.Instances[frag.EntityLabel]); } - #endregion + public event EventHandler GeometryLoaded; + + #endregion - #region Dependency Properties + #region Dependency Properties - public double ModelOpacity + public double ModelOpacity { get { return (double)GetValue(ModelOpacityProperty); } set { SetValue(ModelOpacityProperty, value); } @@ -1518,6 +1520,8 @@ public void LoadGeometry(IfcStore model, ModelRefreshOptions options = ModelRefr } RecalculateView(options); + + GeometryLoaded?.Invoke(this, EventArgs.Empty); } private void LoadReferencedModel(IReferencedModel refModel) From df7b9a24741c8bc8511c16cecf361bdb7701263a Mon Sep 17 00:00:00 2001 From: Santiago Burbano Date: Mon, 3 Jun 2024 17:52:22 -0500 Subject: [PATCH 2/2] updated xbim packages: Xbim.Geometry -> 5.1.541 Xbim.IO.Esent -> 6.0.445 --- Xbim.Presentation/Xbim.Presentation.csproj | 2 +- Xbim.WinformsSample/Xbim.WinformsSample.csproj | 4 ++-- XbimXplorer/Commands/wdwCommands.xaml.cs | 4 ++-- XbimXplorer/XbimXplorer.csproj | 4 ++-- XbimXplorer/XplorerMainWindow.xaml.cs | 7 +++++-- XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Xbim.Presentation/Xbim.Presentation.csproj b/Xbim.Presentation/Xbim.Presentation.csproj index 6c862df6..70eb23c5 100644 --- a/Xbim.Presentation/Xbim.Presentation.csproj +++ b/Xbim.Presentation/Xbim.Presentation.csproj @@ -43,7 +43,7 @@ - + diff --git a/Xbim.WinformsSample/Xbim.WinformsSample.csproj b/Xbim.WinformsSample/Xbim.WinformsSample.csproj index 7da9346e..f7889308 100644 --- a/Xbim.WinformsSample/Xbim.WinformsSample.csproj +++ b/Xbim.WinformsSample/Xbim.WinformsSample.csproj @@ -49,8 +49,8 @@ - - + + diff --git a/XbimXplorer/Commands/wdwCommands.xaml.cs b/XbimXplorer/Commands/wdwCommands.xaml.cs index 69fff060..3434f505 100644 --- a/XbimXplorer/Commands/wdwCommands.xaml.cs +++ b/XbimXplorer/Commands/wdwCommands.xaml.cs @@ -2813,9 +2813,9 @@ private static string ReportPropValue(object propVal, ref List retIds, bool ? " [#" + propLabel + "]" : "" ); - if (pe as Xbim.Ifc2x3.Interfaces.IIfcCartesianPoint != null) + if (pe as IIfcCartesianPoint != null) { - var n = pe as Xbim.Ifc2x3.Interfaces.IIfcCartesianPoint; + var n = pe as IIfcCartesianPoint; var vals = n.Coordinates.Select(x => x.Value); ret += "\t" + string.Join("\t,\t", vals); } diff --git a/XbimXplorer/XbimXplorer.csproj b/XbimXplorer/XbimXplorer.csproj index 1cf6982e..bc783d86 100644 --- a/XbimXplorer/XbimXplorer.csproj +++ b/XbimXplorer/XbimXplorer.csproj @@ -62,8 +62,8 @@ - - + + diff --git a/XbimXplorer/XplorerMainWindow.xaml.cs b/XbimXplorer/XplorerMainWindow.xaml.cs index 60ed50e3..3eb8ca0e 100644 --- a/XbimXplorer/XplorerMainWindow.xaml.cs +++ b/XbimXplorer/XplorerMainWindow.xaml.cs @@ -47,6 +47,9 @@ using Xbim.IO; using Xbim.Geometry.Engine.Interop; using System.Windows.Media; +using Xbim.Common.Configuration; +using Microsoft.Extensions.DependencyInjection; + #endregion @@ -117,7 +120,7 @@ private void SetOpenedModelFileName(string ifcFilename) public XplorerMainWindow(bool preventPluginLoad = false) { // So we can use *.xbim files. - IfcStore.ModelProviderFactory.UseHeuristicModelProvider(); + XbimServices.Current.ConfigureServices(s => s.AddXbimToolkit(opt => opt.AddHeuristicModel())); LogSink = new InMemoryLogSink { Tag = "MainWindow" }; LogSink.Logged += LogEvent_Added; @@ -138,7 +141,7 @@ public XplorerMainWindow(bool preventPluginLoad = false) .Enrich.FromLogContext() .CreateLogger(); // Set XBIM Essentials/Geometries's LoggerFactory - so Serilog drives everything. - XbimLogging.LoggerFactory = LoggerFactory; + XbimServices.Current.ConfigureServices(s => s.AddSingleton(typeof(ILoggerFactory), LoggerFactory)); Logger = LoggerFactory.CreateLogger(); diff --git a/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj b/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj index df0e99d8..a80dcd1e 100644 --- a/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj +++ b/XplorerPlugin.Bcf/XplorerPlugin.Bcf.csproj @@ -68,6 +68,6 @@ - + \ No newline at end of file