Skip to content

Commit

Permalink
add first version of georefchecker
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Kaiser committed Mar 3, 2023
1 parent 30daeb6 commit 887f2e2
Show file tree
Hide file tree
Showing 37 changed files with 1,763 additions and 0 deletions.
19 changes: 19 additions & 0 deletions IFCGeoRefCheckerCommand/IFCGeoRefCheckerCommand.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Xbim.Common" Version="5.1.341" />
<PackageReference Include="Xbim.Ifc" Version="5.1.341" />
</ItemGroup>

<Import Project="..\IFCGeorefShared\IFCGeorefShared.projitems" Label="Shared" />

</Project>
23 changes: 23 additions & 0 deletions IFCGeoRefCheckerCommand/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using IFCGeorefShared;
using Xbim.Ifc;

namespace IFCGeoRefCheckerCommand
{
internal class Program
{
static void Main(string[] args)
{
string ifcFilePath = @"D:\Testdaten\GeoRefChecker\Buerogebaeude.ifc";
//string ifcFilePath = @"D:\Testdaten\GeoRefChecker\301110Gebaeude-Gruppe.ifc";

using (var model = IfcStore.Open(ifcFilePath))
{
var checker = new GeoRefChecker(model);

checker.WriteProtocoll(@"D:\TestDaten\GeoRefChecker\IfcGeoRefChecker");
}

Console.WriteLine("Check finished");
}
}
}
9 changes: 9 additions & 0 deletions IFCGeoRefCheckerGUI/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="IFCGeoRefCheckerGUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:IFCGeoRefCheckerGUI"
StartupUri="MainWindowAllInOne.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions IFCGeoRefCheckerGUI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace IFCGeoRefCheckerGUI
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
10 changes: 10 additions & 0 deletions IFCGeoRefCheckerGUI/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
30 changes: 30 additions & 0 deletions IFCGeoRefCheckerGUI/DelegateCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Windows.Input;

namespace IFCGeoRefCheckerGUI
{
public class DelegateCommand : ICommand
{
readonly Action<object>? execute;
readonly Predicate<object>? canExecute;

public DelegateCommand(Action<object>? execute, Predicate<object>? canExecute)
{
this.execute = execute;
this.canExecute = canExecute;
}

public DelegateCommand(Action<object> excute) : this(excute, null) { }

public event EventHandler? CanExecuteChanged;

public void RaiseCanExecuteChanged() => this.CanExecuteChanged?.Invoke(this, EventArgs.Empty);

public bool CanExecute(object? parameter) => this.canExecute?.Invoke(parameter!) ?? true;

public void Execute(object? parameter)
{
this.execute?.Invoke(parameter!);
}
}
}
34 changes: 34 additions & 0 deletions IFCGeoRefCheckerGUI/IFCGeoRefCheckerGUI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
<None Remove="images\DD-BIM-LOGO.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.Sinks.RichTextBox.Wpf" Version="1.1.0" />
<PackageReference Include="Xbim.Common" Version="5.1.341" />
<PackageReference Include="Xbim.Essentials" Version="5.1.341" />
<PackageReference Include="Xbim.Ifc" Version="5.1.341" />
</ItemGroup>

<ItemGroup>
<Resource Include="images\DD-BIM-LOGO.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>

<ItemGroup>
<Folder Include="ValueConverters\" />
</ItemGroup>

<Import Project="..\IFCGeorefShared\IFCGeorefShared.projitems" Label="Shared" />

</Project>
25 changes: 25 additions & 0 deletions IFCGeoRefCheckerGUI/IfcCheckerService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xbim.Ifc;

using IFCGeorefShared;


namespace IFCGeoRefCheckerGUI
{
class IfcCheckerService
{
public GeoRefChecker CheckIFC(string filePath)
{
using (var model = IfcStore.Open(filePath))
{
var checker = new GeoRefChecker(model);
return checker;
}
}
}
}
55 changes: 55 additions & 0 deletions IFCGeoRefCheckerGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:IFCGeoRefCheckerGUI"
xmlns:uc="clr-namespace:IFCGeoRefCheckerGUI.UserController"
xmlns:vm="clr-namespace:IFCGeoRefCheckerGUI.ViewModels" x:Class="IFCGeoRefCheckerGUI.MainWindow"
mc:Ignorable="d"
Title="IfcGeoRefChecker" Height="750" Width="620" MinWidth="620">
<Window.DataContext>
<vm:MainWindowViewModel></vm:MainWindowViewModel>
</Window.DataContext>

<Grid Margin="10,10,10,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>


<uc:SetWorkingDirectory x:Name="setWorkingDirectory" Grid.Row="0" DataContext="{Binding workingDirViewModel}"/>


<!--
<uc:FilePanel Grid.Row="1"/>
-->
</Grid>


<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>

<Image Source="/IFCGeorefCheckerGUI;component/images/DD-BIM-LOGO.png" Margin="5,5,5,5"/>

<Button x:Name="LoadFilesBtn" Grid.Row="1" Content="Load IFC-Files" Margin="10,10,10,10" Padding="1,5,1,5" Command="{Binding workingDirViewModel.DirChooseCommand}">
</Button>

</Grid>



</Grid>
</Window>
29 changes: 29 additions & 0 deletions IFCGeoRefCheckerGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using IFCGeoRefCheckerGUI.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace IFCGeoRefCheckerGUI
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
Loading

0 comments on commit 887f2e2

Please sign in to comment.