Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VTK Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VTK
VTK Examples
Commits
3b9ff012
Commit
3b9ff012
authored
4 years ago
by
Andrew Maclean
Browse files
Options
Downloads
Patches
Plain Diff
Updating CheckVTKVersion
parent
34b227fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Cxx/Utilities/CheckVTKVersion.cxx
+81
-4
81 additions, 4 deletions
src/Cxx/Utilities/CheckVTKVersion.cxx
with
81 additions
and
4 deletions
src/Cxx/Utilities/CheckVTKVersion.cxx
+
81
−
4
View file @
3b9ff012
#include
<vtkVersion.h>
int
main
(
int
,
char
*
[])
#ifdef VTK_VERSION_NUMBER
#if VTK_VERSION_NUMBER >= 90000000000ULL
#define VTK_VER_GE_90 1
#endif
#else
#define VTK_VERSION_NUMBER_NOT_DEFINED 1
#endif
namespace
{
/**
* Check the VTK version.
*
* @param major: Major version.
* @param major: Minor version.
* @param major: Build version.
*
* @return True if the requested VTK version is greater or equal to the actual
* VTK version.
*/
bool
VTKVersionOk
(
unsigned
long
long
const
&
major
,
unsigned
long
long
const
&
minor
,
unsigned
long
long
const
&
build
);
}
// namespace
int
main
(
int
,
char
*
[])
{
std
::
cout
<<
vtkVersion
::
GetVTKSourceVersion
()
<<
std
::
endl
;
std
::
cout
<<
vtkVersion
::
GetVTKMajorVersion
()
<<
std
::
endl
;
std
::
cout
<<
vtkVersion
::
GetVTKMinorVersion
()
<<
std
::
endl
;
#ifdef VTK_VERSION_NUMBER
std
::
cout
<<
"Source version: "
<<
vtkVersion
::
GetVTKSourceVersion
()
<<
std
::
endl
;
std
::
cout
<<
"Major Version : "
<<
vtkVersion
::
GetVTKMajorVersion
()
<<
std
::
endl
;
std
::
cout
<<
"Minor Version : "
<<
vtkVersion
::
GetVTKMinorVersion
()
<<
std
::
endl
;
#elif VTK_VERSION_NUMBER_NOT_DEFINED
std
::
cout
<<
"VTK VTK_VERSION_NUMBER is not defined."
<<
std
::
endl
;
std
::
cout
<<
"VTK Major Version: "
<<
VTK_MAJOR_VERSION
<<
std
::
endl
;
std
::
cout
<<
"VTK Minor Version: "
<<
VTK_MINOR_VERSION
<<
std
::
endl
;
#endif
#ifdef VTK_VER_GE_90
std
::
cout
<<
"VTK Version is >= "
<<
VTK_VERSION_NUMBER
<<
std
::
endl
;
#endif
if
(
!
VTKVersionOk
(
8
,
90
,
0
))
{
std
::
cerr
<<
"You need VTK version 8.90 or greater to run this program."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
else
{
std
::
cout
<<
"You have the needed VTK version"
<<
endl
;
}
return
EXIT_SUCCESS
;
}
namespace
{
bool
VTKVersionOk
(
unsigned
long
long
const
&
major
,
unsigned
long
long
const
&
minor
,
unsigned
long
long
const
&
build
)
{
unsigned
long
long
neededVersion
=
10000000000ULL
*
major
+
100000000ULL
*
minor
+
build
;
#ifndef VTK_VERSION_NUMBER
auto
ver
=
vtkSmartPointer
<
vtkVersion
>
();
unsigned
long
long
vtk_version_number
=
10000000000ULL
*
ver
->
GetVTKMajorVersion
()
+
100000000ULL
*
ver
->
GetVTKMinorVersion
()
+
ver
->
GetVTKBuildVersion
();
if
(
vtk_version_number
>=
neededVersion
)
{
return
true
;
}
return
false
;
#else
if
(
VTK_VERSION_NUMBER
>=
neededVersion
)
{
return
true
;
}
return
false
;
#endif
}
}
// namespace
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment