IfcPlusPlus: Difference between revisions

From FreeCAD Documentation
(→‎Description: The example viewer uses the Qt and the OpenSceneGraph library to convert the implicit geometry in IFC files into explicit geometry on screen.)
(→‎Installation: More information about compilation)
Line 11: Line 11:
The example viewer uses Qt and the OpenSceneGraph library to convert the implicit geometry in IFC files into explicit geometry on screen.
The example viewer uses Qt and the OpenSceneGraph library to convert the implicit geometry in IFC files into explicit geometry on screen.


== Installation ==
== Installing ==


IFC++ is provided in source code so it must be compiled before being used. It is developed mostly in Window, so it includes solution files ({{incode|.snl}}) to compile the {{incode|IfcPlusPlus.dll}} library using Visual Studio. However, it can also be compiled for Linux using CMake.
IfcPlusPlus must be compiled from source.


== Compiling in Windows ==
It requires the OpenSceneGraph library for visualization, as well as the development files for Boost and Qt 5. If you have already [[Compile_on_Linux|compiled FreeCAD in Linux]], or [[IfcOpenShell|IfcOpenShell]], you may already have all the prerequisites, except for the OpenSceneGraph development files.

Follow the instructions in the official [https://github.com/ifcquery/ifcplusplus ifcplusplus] repository.

== Compiling in Linux ==

The general instructions are as follows:
# Get the source code of IFC++ from its main repository.
# Gather all dependencies for compiling, including a C++ compiler, CMake, and Make, and the development files for Boost, Qt 5, as well as the OpenSceneGraph (OSG) library for visualization.
# Run {{incode|cmake}} to generate a {{incode|Makefile}}, then start the compilation by running {{incode|make}}.
# Install the {{incode|ifcplusplus}} shared module to the appropriate library path so that it is found by the IFC++ viewer.

=== Prerequisites ===

In a Debian/Ubuntu based distribution, getting the required development files is usually simple.
</translate>
</translate>
{{Code|code=
{{Code|code=
sudo apt install qtbase5-dev qt5-qmake qttools5-dev libqt5widgets5 libqt5opengl5-dev
sudo apt install git cmake gcc g++ libboost-all-dev
sudo apt install qt5-qmake qtbase5-dev qttools5-dev libqt5widgets5 libqt5opengl5-dev

sudo apt install libopenscenegraph-3.4-dev
sudo apt install libopenscenegraph-3.4-dev
}}
}}
<translate>
<translate>


Get the source code of the project and place it in a custom directory to which you have full write access.
</translate>
</translate>
{{Code|code=
{{Code|code=
git clone https://github.com/berndhahnebach/ifcplusplus/ ifcpp
git clone https://github.com/ifcquery/ifcplusplus ifcplusplus-source
}}
}}
<translate>
<translate>

=== CMake configuration ===

It is recommended to perform the configuration and compilation in a specific build directory separate from the source directory.

</translate>
{{Code|code=
mkdir -p ifcplusplus-build
cd ifcplusplus-build

cmake ../ifcplusplus-source/
}}
<translate>

=== Actual compilation ===

If there were no error messages during configuration with CMake, a {{incode|Makefile}} should have been created in the build directory, so you can proceed to compile the libraries by running {{incode|make}}.

</translate>
{{Code|code=
make -j N
}}
<translate>

{{incode|N}} is the number of processors that you assign to the compilation process; choose at least one fewer than the total number of CPU cores that you have.


== Links ==
== Links ==

Revision as of 00:20, 20 August 2020

This page is a work in progress. Please do not edit or translate until this message is removed.
Other languages:

Description

IFC++ or IfcPlusPlus is an open source (MIT license) library for reading and viewing IFC files from the IfcQuery project.

While the library can be used for different purposes, the most useful component is the example viewer, which can be used to compare the performance of other viewers and editors of IFC data, like Blender and FreeCAD, which use IfcOpenShell.

The example viewer uses Qt and the OpenSceneGraph library to convert the implicit geometry in IFC files into explicit geometry on screen.

Installing

IFC++ is provided in source code so it must be compiled before being used. It is developed mostly in Window, so it includes solution files (.snl) to compile the IfcPlusPlus.dll library using Visual Studio. However, it can also be compiled for Linux using CMake.

Compiling in Windows

Follow the instructions in the official ifcplusplus repository.

Compiling in Linux

The general instructions are as follows:

  1. Get the source code of IFC++ from its main repository.
  2. Gather all dependencies for compiling, including a C++ compiler, CMake, and Make, and the development files for Boost, Qt 5, as well as the OpenSceneGraph (OSG) library for visualization.
  3. Run cmake to generate a Makefile, then start the compilation by running make.
  4. Install the ifcplusplus shared module to the appropriate library path so that it is found by the IFC++ viewer.

Prerequisites

In a Debian/Ubuntu based distribution, getting the required development files is usually simple.

sudo apt install git cmake gcc g++ libboost-all-dev
sudo apt install qt5-qmake qtbase5-dev qttools5-dev libqt5widgets5 libqt5opengl5-dev
sudo apt install libopenscenegraph-3.4-dev

Get the source code of the project and place it in a custom directory to which you have full write access.

git clone https://github.com/ifcquery/ifcplusplus ifcplusplus-source

CMake configuration

It is recommended to perform the configuration and compilation in a specific build directory separate from the source directory.

mkdir -p ifcplusplus-build
cd ifcplusplus-build

cmake ../ifcplusplus-source/

Actual compilation

If there were no error messages during configuration with CMake, a Makefile should have been created in the build directory, so you can proceed to compile the libraries by running make.

make -j N

N is the number of processors that you assign to the compilation process; choose at least one fewer than the total number of CPU cores that you have.

Links