Skip to content

Qt Tools for 3D Software Development Kits

ADMIN | 04-05-2015

Qt is arguably the most popular toolkit for making applications that can run on Windows, Mac or Linux with little additional effort.

Hexagon pattern 1

Qt Tools for 3D Software Development Kits

When software developers opt for tools that are cross platform, they often turn to Qt. Qt is arguably the most popular toolkit for making applications that can run on Windows, Mac or Linux with little additional effort. Spatial’s 3D software development kits can be paired with Qt to produce enterprise quality applications that are platform agnostic.

To help developers get started in this environment, here we present a small collection of files that can be used with qmake for generating makefiles and IDE workspaces that are configured to use software components from Spatial. We’ve also included a simple project that illustrates the use of these add-ons.

Prerequisites

Qt 5.4 is the current version available, but these scripts should work with earlier and future versions as well.  You’ll also need an installation of the Spatial software components for each platform you want to support. To take advantage of the qmake scripts provided here, install your Spatial components in a common root directory and name the product folders according to the following naming convention:

prerequisites for 3D software development kits Qt 3D ACIS, 3D InterOp, HOOPS


By using a network share as the installation location, all Spatial components for all supported platforms can be installed to the same location. The qmake system has support for prefix headers (sometimes called pre-compiled headers) which can be used dramatically decrease build times when third party software components such as ACIS are shared on a network drive.


* If you don’t install your components this way, you can specify their locations individually by setting the variables in your shell environment or in your qmake project file prior to using the pri files provided here.

Usage

In order to add support for Spatial components, edit your product’s .pro file and add the following variables:

Usage for Qt tools for 3D Software Development Kits

With this information, your environment is completely specified, and all that’s left to do is include the components you want to build into your application.

QT .Pri & .Pro Files

Here is an example of a .pro file that takes advantage of this build configuration:

 

# Specify default values for versions
SPA_MAJOR_VERSION=25
SPA_SERVICE_PACK=1

# Allow local configuration file to specify SPA_ROOT
# and to override default versions as needed.
# config-local.pri should not be kept in revision control
# but created and modified by the developer in their working copy
exists(config-local.pri):include(config-local.pri)

isEmpty(SPA_ROOT):error(Edit config-local.pri to set SPA_ROOT)
!include($$SPA_ROOT/spa_pri/acis.pri):error(Unable to include acis.pri)
!include($$SPA_ROOT/spa_pri/iop.pri):error(Unable to include iop.pri)

message(A3DT: $$A3DT)
message(X3DT: $$X3DT)
message(ARCH: $$ARCH)

TARGET=hello_world
CONFIG*=thread console
macx:CONFIG-=app_bundle
SOURCES += main.cpp

 

After including any of the .pri files provided, you can access the values they define. This can be useful for automatically writing a batch file that augments your PATH environment variable, which makes dynamic loading of the libraries much easier. For example:

win32 {
  bs_a3dt = $$replace(A3DT, '/', '\\')
  cmd = echo 'set PATH=$${bs_a3dt}\\$${ARCH}$${d}\\code\\bin;^%PATH^%' > acisPath.bat
  message($${cmd})
  system($${cmd})
   
  cmd = echo 'set A3DT=$${bs_a3dt}'>> acisPath.bat
  message($${cmd})
  system($${cmd})
   
  cmd = echo 'set ARCH=$${ARCH}'>> acisPath.bat
  message($${cmd})
  system($${cmd})
}

The variables A3DT and ARCH are defined by including acis.pri. The forward slash to backslash conversion is done because all paths in the qmake environment use forward slashes, while the windows command prompt expects backslashes.

In addition to modifying your PATH variable, the batch file created by the above snippet sets A3DT and ARCH shell environment variables. This can be useful when opening and building visual studio solutions that ship with Spatial’s software components.

Link to Zip File

Summary

By pairing Spatial’s software components with the power of Qt, you can create applications quickly and easily that run on all the major platforms. By using .pri and .pro files, configuring a build environment is easy, reliable, and flexible. Even if you choose not to use Qt as your GUI toolkit, you can use qmake as a platform independent build tool for easily generating makefiles and IDE workspaces.
 

 

You might also like...

2 Min read
3D InterOp
Software developers in the manufacturing field are often tasked with implementing expert-level algorithms for 3D...
CNC Routing Software 1
7 Min read
3D InterOp
CNC routing software is an indispensable tool that gives manufacturers new levels of precision and speed in product...
Application Lifecycle Management Flow
4 Min read
CGM Modeler
When you hear the term, Application Lifecycle Management (ALM), you likely think about the process that a software...
8 Min read
CGM Modeler
What is Computer Aided Manufacturing The CAM Market Who Uses CAM Software? Trends in CAM What do CAM Software...
7 Min read
3D InterOp
Table of Contents Why industrial automation is important Advantages and Disadvantages of Industrial Automation The...
8 Min read
CGM Modeler
What do you do? What Exactly is FEM? What You Need to Know About Choosing a FEM Modeler FEM and Partial Differential...
5 Min read
CGM Modeler
Computational Fluid Dynamics (CFD) is a type of analysis that provides insight into solving complex problems, and...
2 Min read
CGM Modeler
WRL files are an extension of the Virtual Reality Modeling Language (VRML) format . VRML file types enable browser...
Voxel model example
3 Min read
CGM Modeler
Voxels are to 3D what pixels are to 2D. Firstly -- let’s examine what pixels actually are. Everything you see on your...
Point_cloud_torus
2 Min read
CGM Modeler
Point-cloud modeling is typically used in the process of 3D scanning objects. Rather than defining surfaces through...
Polygonal Modeling
2 Min read
CGM Modeler
Polygonal (or polyhedral) modeling is the most common type of modeling for video games and animation studios. This type...
BREP Model example
2 Min read
CGM Modeler
BRep modeling, or Boundary Representation modeling, is, in CAD applications, the most common type of modeling. BRep is...
4 Min read
3D InterOp
(Stratasys V650 Flex. Source: Javelin-Tech) 3D printing has emerged as a popular 3D model fabrication option. Be it...
CAD System Components
4 Min read
CGM Modeler
Effective computer-aided design (CAD) and computer-aided manufacturing (CAM) programs include the following main...
Voxeldance and Spatial
2 Min read
3D InterOp
To the uninitiated, 3D printing may seem a simple process — download your CAD file and hit print. But the world of...
29556
4 Min read
3D InterOp
Due to different workflows, it is not uncommon to find companies collaborating with one another (e.g. a...
dimension-image.jpg
2 Min read
3D InterOp
Recently I was asked a question about one of the standard test files generated by NIST (National Institute for...
4 Min read
3D InterOp
Part and parcel with model-based engineering is model translation. Because the model is now the specification, accurate...