...
 
Commits (392)
......@@ -12,3 +12,6 @@ __pycache__/
# Exclude some Xcode stuff.
xcuserdata
project.xcworkspace
# Exclude VSCode settings and configuration folder
*.vscode*
......@@ -25,7 +25,6 @@ set(lib_srcs
vtkmlib/UnstructuredGridConverter.cxx
vtkmlib/ArrayConverters.cxx
vtkmlib/CellSetConverters.cxx
vtkmlib/DataSetConverters.cxx
vtkmlib/ImageDataConverter.cxx
vtkmlib/Storage.cxx
)
......@@ -75,6 +74,7 @@ set(cpu_accelerator_srcs
vtkmTriangleMeshPointNormals.cxx
vtkmWarpScalar.cxx
vtkmWarpVector.cxx
vtkmlib/DataSetConverters.cxx
vtkmlib/Portals.cxx
vtkmlib/ImplicitFunctionConverter.cxx
)
......@@ -102,6 +102,7 @@ set(cuda_accelerator_srcs
vtkmTriangleMeshPointNormals.cu
vtkmWarpScalar.cu
vtkmWarpVector.cu
vtkmlib/DataSetConverters.cu
vtkmlib/Portals.cu
vtkmlib/ImplicitFunctionConverter.cu
)
......
......@@ -66,7 +66,7 @@ int TestVTKMWarpScalar(int argc, char* argv[])
vtkNew<vtkmWarpScalar> xyWarpScalar;
xyWarpScalar->SetScaleFactor(2);
xyWarpScalar->XYPlaneOn();
xyWarpScalar->SetNormal(1, 0, 0); // should be igored
xyWarpScalar->SetNormal(1, 0, 0); // should be ignored
xyWarpScalar->SetInputConnection(xySource->GetOutputPort());
xyWarpScalar->Update();
vtkPointSet* points = xyWarpScalar->GetOutput();
......
......@@ -225,7 +225,7 @@ void vtkmProbe::PassAttributeData(vtkDataSet* input,
}
}
// Set active attributes in the ouput to the active attributes in the input
// Set active attributes in the output to the active attributes in the input
for (int i = 0; i < vtkDataSetAttributes::NUM_ATTRIBUTES; ++i)
{
vtkAbstractArray* da = input->GetPointData()->GetAttribute(i);
......
......@@ -332,19 +332,15 @@ struct CellSetConverter
CellInfoCopyWorklet worklet(&correctSize, connArray, this->Types,
this->Locations);
vtkm::worklet::DispatcherMapTopology<CellInfoCopyWorklet,
vtkm::cont::DeviceAdapterTagSerial>
dispatcher(worklet);
vtkm::worklet::DispatcherMapTopology<CellInfoCopyWorklet> dispatcher(worklet);
dispatcher.SetDevice(vtkm::cont::DeviceAdapterTagSerial{});
dispatcher.Invoke(cells);
}
else
{
CellConnCopyWorklet worklet(&correctSize, connArray);
vtkm::worklet::DispatcherMapTopology<CellConnCopyWorklet,
vtkm::cont::DeviceAdapterTagSerial>
dispatcher(worklet);
vtkm::worklet::DispatcherMapTopology<CellConnCopyWorklet> dispatcher(worklet);
dispatcher.SetDevice(vtkm::cont::DeviceAdapterTagSerial{});
dispatcher.Invoke(cells);
}
......
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2012 Sandia Corporation.
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
//=============================================================================
#include "DataSetConverters.cxx"
......@@ -46,6 +46,12 @@ MACRO(FFMPEG_FIND varname shortname headername)
DOC "Location of FFMPEG Headers"
)
# on windows sometimes ffmpeg is built as lib<name>.a files
if (WIN32)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a")
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "lib")
endif()
FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
NAMES ${shortname}
PATHS
......@@ -107,6 +113,7 @@ FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
FFMPEG_FIND(LIBSWRESAMPLE swresample swresample.h)
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
SET(FFMPEG_FOUND "NO")
......
......@@ -93,6 +93,8 @@
# ``yyyymm`` where ``yyyy`` and ``mm`` represents the year and month of
# the OpenMP specification implemented by the ``<lang>`` compiler.
cmake_minimum_required(VERSION 3.9)
cmake_policy(PUSH)
cmake_policy(SET CMP0012 NEW) # if() recognizes numbers and booleans
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
......
......@@ -41,6 +41,9 @@ memsetClassFloat
assertWithSideEffect
argumentSize
// Gives too many false positives with << stream operator.
shiftNegative
// There are *thousands* of these, too much to manage, so suppress all.
variableScope
......@@ -515,6 +518,9 @@ unreadVariable:Web/WebGLExporter/vtkWebGLWidget.cxx
unreadVariable:Wrapping/PythonCore/PyVTKObject.cxx
unreadVariable:Wrapping/PythonCore/vtkPythonOverload.cxx
// 48 warnings
noOperatorEq
// Many warnings
noCopyConstructor:Common/Core/Testing/Cxx/TestCxxFeatures.cxx
noCopyConstructor:Common/DataModel/vtkDataObjectTreeIterator.cxx
......@@ -606,6 +612,7 @@ uselessAssignmentPtrArg:Wrapping/Tools/vtkParse.tab.c
syntaxError:Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx
arrayIndexOutOfBoundsCond:IO/MINC/vtkMINCImageAttributes.cxx
uninitMemberVar:GUISupport/Qt/QVTKOpenGLWidget.cxx
unusedVariable:IO/SegY/vtkSegYReaderInternal.cxx
// false positive: <https://trac.cppcheck.net/ticket/8346>
syntaxError:Accelerators/Vtkm/vtkmlib/Portals.hxx
......@@ -634,6 +641,7 @@ knownConditionTrueFalse:Filters/Parallel/Testing/Cxx/UnitTestPMaskPoints.cxx
knownConditionTrueFalse:Rendering/OSPRay/vtkOSPRayRendererNode.cxx
nullPointer:Wrapping/Tools/lex.yy.c
passedByValue:Filters/General/vtkYoungsMaterialInterface.cxx
uninitMemberVar:Common/DataModel/vtkStaticPointLocator2D.cxx
// Style, not really problematic:
duplicateAssignExpression:Rendering/Context2D/vtkMarkerUtilities.cxx
......
include(CMakeDependentOption)
if(POLICY CMP0072)
cmake_policy(PUSH)
cmake_policy(SET CMP0072 NEW) # prefer GLVND
endif()
# Logic to figure out what system libraries will be used by rendering, and
# whether VTK can use OSMesa for rendering.
set(default_use_x OFF)
#-----------------------------------------------------------------------------
# GLES variables
#-----------------------------------------------------------------------------
# OpenGLES implementation
option(VTK_OPENGL_USE_GLES
"Use the OpenGL ES API" OFF)
mark_as_advanced(VTK_OPENGL_USE_GLES)
# For each platform specific API, we define VTK_USE_<API> options.
if(APPLE AND NOT APPLE_IOS)
option(VTK_USE_COCOA "Use Cocoa for VTK render windows" ON)
......@@ -116,6 +129,12 @@ if(VTK_OPENGL_HAS_OSMESA)
include_directories(SYSTEM ${OSMESA_INCLUDE_DIR})
endif()
if(VTK_OPENGL_USE_GLES)
find_path(OPENGL_INCLUDE_DIR GLES3/gl3.h)
find_library(OPENGL_gl_LIBRARY NAMES GLESv3)
find_library(OPENGL_egl_LIBRARY NAMES EGL)
endif()
if(VTK_OPENGL_HAS_EGL)
find_package(EGL REQUIRED)
endif()
......@@ -165,3 +184,7 @@ function(vtk_opengl_link target)
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS "/DELAYLOAD:opengl32.dll")
endif()
endfunction()
if(POLICY CMP0072)
cmake_policy(POP)
endif()
......@@ -60,4 +60,14 @@ int main()
}\n")
check_c_source_compiles("${_source}" VTK_FFMPEG_AVCODECID)
endif()
if (NOT DEFINED VTK_FFMPEG_AVCODEC_SEND_PACKET)
set(_source "
#include <${FFMEG_CODEC_HEADER_PATH}/avcodec.h>
int main()
{
avcode_send_packet(0, 0);
return 0;
}\n")
check_c_source_compiles("${_source}" VTK_FFMPEG_AVCODEC_SEND_PACKET)
endif()
endif()
# VTK version number components.
set(VTK_MAJOR_VERSION 9)
set(VTK_MINOR_VERSION 0)
set(VTK_MAJOR_VERSION 8)
set(VTK_MINOR_VERSION 2)
set(VTK_BUILD_VERSION 0)
......@@ -108,7 +108,6 @@ $<$<BOOL:$<TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES>>:
${TMP_INPUT}
${_args_file}
${hierarchy_depend}
IMPLICIT_DEPENDS CXX ${TMP_INPUT}
COMMAND ${VTK_WRAP_PYTHON_EXE}
@${_args_file}
-o ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Python.cxx
......
......@@ -23,6 +23,7 @@
#include "vtkContextScene.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkNew.h"
#include "vtkMath.h"
#include "vtkAxis.h"
......@@ -57,7 +58,7 @@ int TestChartDouble(int, char *[])
{
double x(i * inc + 0.2);
table->SetValue(i, 0, x);
table->SetValue(i, 1, 1.0e-80 * (cos(x - 1.0) + sin(x - 3.14 / 4.0)));
table->SetValue(i, 1, 1.0e-80 * (cos(x - 1.0) + sin(x - vtkMath::Pi() / 4.0)));
table->SetValue(i, 2, 1.0e-80 * sin(x) * 1e-12);
table->SetValue(i, 3, 1.0e-80 * sin(x - 1.0));
}
......
......@@ -27,6 +27,7 @@
#include "vtkRenderWindowInteractor.h"
#include "vtkNew.h"
#include "vtkAxis.h"
#include "vtkMath.h"
//----------------------------------------------------------------------------
int TestChartDoubleColors(int, char *[])
......@@ -62,7 +63,7 @@ int TestChartDoubleColors(int, char *[])
{
double x(i * inc + 0.2);
table->SetValue(i, 0, x);
table->SetValue(i, 1, 1.0e-80 * (cos(x - 1.0) + sin(x - 3.14 / 4.0)));
table->SetValue(i, 1, 1.0e-80 * (cos(x - 1.0) + sin(x - vtkMath::Pi() / 4.0)));
table->SetValue(i, 2, 1.0e-80 * sin(x) * 1e-12);
table->SetValue(i, 3, 1.0e-80 * sin(x - 1.0));
table->SetValue(i, 4, cos(i * inc));
......
......@@ -25,6 +25,7 @@
#include "vtkSmartPointer.h"
#include "vtkTable.h"
#include "vtkTextProperty.h"
#include "vtkMath.h"
#include <string>
......@@ -74,7 +75,7 @@ int TestChartUnicode(int argc, char *argv[])
for (int i = 0; i < numPoints; ++i)
{
table->SetValue(i, 0, i * inc);
table->SetValue(i, 1, cos(i * inc) + sin(i * (inc - 3.14)));
table->SetValue(i, 1, cos(i * inc) + sin(i * (inc - vtkMath::Pi())));
}
// Add multiple line plots, setting the colors etc
......
......@@ -36,7 +36,7 @@ int TestContextImage(int argc, char * argv [])
// Set up a 2D context view, context test object and add it to the scene
vtkNew<vtkContextView> view;
view->GetRenderWindow()->SetSize(275, 275);
view->GetRenderWindow()->SetSize(320, 181);
vtkNew<vtkImageItem> item;
view->GetScene()->AddItem(item);
......
8d4cf05a07727c251f1da3a54b92b9534cac0c9bea633e6492c67356bc423e50c7b8e32ebd2922be0cdb28fe20227fec1292832a19002871a434592baf83f538
d7dcf779de9c10500f15044ef4994ccb32ce80ab1cbd6d403d9577ce6f3782d5b1dcaed928c55094a8428ec6ad09ee983a8b001bf19bd32703edf0899e80467a
7fe7a167cfed0f4d7ac7442f6b0f44b885d03ce93b69781b9d1c05e2a227e1a3a21685eb7862648f2b60e8b0322b1e29226bcb73925b7654a0ada2d70dc0ebb8
0aa359b686a8b3ce252e756466dba2afc2f44df9f92fa60923f82978a742bd1a627402123e0cbed5e3ff3593a026c89329a74d95bdeb53dcef3680173626383c
......@@ -1322,7 +1322,7 @@ void vtkAxis::GenerateTickLabels(double min, double max)
range = mult > 0.0 ? max - min : min - max;
n = vtkContext2D::FloatToInt(range / this->TickInterval);
}
for (int i = 0; i <= n && i < 200; ++i)
for (int i = 0; i <= n; ++i)
{
double value = 0.0;
if (this->LogScaleActive)
......@@ -1440,7 +1440,7 @@ vtkStdString vtkAxis::GenerateSimpleLabel(double val)
if (regExp2.find(result))
{
vtkStdString tmp(result);
int num = vtkMath::Round(stof(regExp2.match(0)));
long num = std::lround(stof(regExp2.match(0)));
result = std::to_string(num);
vtkStdString::iterator it = tmp.begin();
for (int i = 0; i < regExp2.end() - regExp2.start(); ++i)
......
......@@ -176,7 +176,7 @@ void vtkPlotPie::SetDimensions(int arg1, int arg2, int arg3, int arg4)
}
}
void vtkPlotPie::SetDimensions(int arg[4])
void vtkPlotPie::SetDimensions(const int arg[4])
{
this->SetDimensions(arg[0],arg[1],arg[2],arg[3]);
}
......
......@@ -64,7 +64,7 @@ public:
* Set the dimensions of the pie, elements 0 and 1 are the x and y coordinate
* of the bottom corner. Elements 2 and 3 are the width and height.
*/
void SetDimensions(int arg[4]);
void SetDimensions(const int arg[4]);
//@{
/**
......
......@@ -73,8 +73,17 @@
#ifndef vtkSMPThreadLocal_h
#define vtkSMPThreadLocal_h
#ifdef _MSC_VER
# pragma push_macro("__TBB_NO_IMPLICIT_LINKAGE")
# define __TBB_NO_IMPLICIT_LINKAGE 1
#endif
#include <tbb/enumerable_thread_specific.h>
#ifdef _MSC_VER
# pragma pop_macro("__TBB_NO_IMPLICIT_LINKAGE")
#endif
template <typename T>
class vtkSMPThreadLocal
{
......
......@@ -17,8 +17,17 @@
#include "vtkCriticalSection.h"
#ifdef _MSC_VER
# pragma push_macro("__TBB_NO_IMPLICIT_LINKAGE")
# define __TBB_NO_IMPLICIT_LINKAGE 1
#endif
#include <tbb/task_scheduler_init.h>
#ifdef _MSC_VER
# pragma pop_macro("__TBB_NO_IMPLICIT_LINKAGE")
#endif
struct vtkSMPToolsInit
{
tbb::task_scheduler_init Init;
......
......@@ -14,10 +14,19 @@
=========================================================================*/
#include "vtkNew.h"
#ifdef _MSC_VER
# pragma push_macro("__TBB_NO_IMPLICIT_LINKAGE")
# define __TBB_NO_IMPLICIT_LINKAGE 1
#endif
#include <tbb/blocked_range.h>
#include <tbb/parallel_for.h>
#include <tbb/parallel_sort.h>
#ifdef _MSC_VER
# pragma pop_macro("__TBB_NO_IMPLICIT_LINKAGE")
#endif
namespace vtk
{
namespace detail
......
......@@ -9,9 +9,10 @@ function(add_data_array_test test_name array_header array_valuetype array_type)
set(VTK_TESTDATAARRAYAPI_TESTNAME "TestDataArrayAPI_${test_name}")
set(test_source "${VTK_TESTDATAARRAYAPI_TESTNAME}.cxx")
configure_file(TestDataArrayAPI.cxx.in "${test_source}")
configure_file(TestDataArrayAPI.cxx.in "${CMAKE_CURRENT_BINARY_DIR}/${test_source}")
set(data_array_tests ${data_array_tests} "${test_source}.cxx" PARENT_SCOPE)
#specify a custom test name as these files exist in the build directory
list(APPEND data_array_tests "${VTK_TESTDATAARRAYAPI_TESTNAME},${CMAKE_CURRENT_BINARY_DIR}/${test_source}" PARENT_SCOPE)
endfunction()
# Legacy -- test that the vtkDataArrayTemplate interface still works:
......
......@@ -161,7 +161,7 @@ vtkSmartPointer<vtkDataArray> CreateDataArray()
//------------------------vtkAbstactArray API-----------------------------------
// int Allocate(vtkIdType numValues, vtkIdType ext=1000)
// vtkTypeBool Allocate(vtkIdType numValues, vtkIdType ext=1000)
// Sets MaxId == -1
// Sets Size >= numValues
// If numValues == 0, delete the array.
......@@ -170,7 +170,7 @@ vtkSmartPointer<vtkDataArray> CreateDataArray()
template <typename ScalarT, typename ArrayT>
int Test_int_Allocate_numValues_ext()
{
DataArrayAPIInit("int Allocate(vtkIdType numValues, vtkIdType ext)");
DataArrayAPIInit("vtkTypeBool Allocate(vtkIdType numValues, vtkIdType ext)");
DataArrayAPICreateTestArray(array);
int success = array->Allocate(0);
......@@ -1381,13 +1381,13 @@ int Test_void_InterpolateTuple_i_id1_source1_id2_source2_t()
DataArrayAPIFinish();
}
// int Resize(vtkIdType numTuples)
// vtkTypeBool Resize(vtkIdType numTuples)
// Preserve data
// Return 1 on success, 0 otherwise
template <typename ScalarT, typename ArrayT>
int Test_int_Resize_numTuples()
{
DataArrayAPIInit("int Resize(vtkIdType numTuples)");
DataArrayAPIInit("vtkTypeBool Resize(vtkIdType numTuples)");
DataArrayAPICreateTestArray(array);
int comps = 5;
vtkIdType tuples = 0;
......
......@@ -57,8 +57,8 @@ public:
void GetTypedTuple(vtkIdType, ValueType*) const override {}
vtkIdType InsertNextValue(ValueType) override { return 0; }
void InsertValue(vtkIdType, ValueType) override {}
int Allocate(vtkIdType, vtkIdType) override { return 0; }
int Resize(vtkIdType) override { return 0; }
vtkTypeBool Allocate(vtkIdType, vtkIdType) override { return 0; }
vtkTypeBool Resize(vtkIdType) override { return 0; }
};
}
......
......@@ -134,11 +134,11 @@ int TestVariantArray(int, char*[])
vector<double> vec;
// Resizing
// * int Allocate(vtkIdType sz);
// * vtkTypeBool Allocate(vtkIdType sz);
// * void Initialize();
// * void SetNumberOfTuples(vtkIdType number);
// * void Squeeze();
// * int Resize(vtkIdType numTuples);
// * vtkTypeBool Resize(vtkIdType numTuples);
// * void SetNumberOfValues(vtkIdType number);
// * void SetVoidArray(void *arr, vtkIdType size, int save);
// * void SetArray(vtkVariant* arr, vtkIdType size, int save);
......
......@@ -8,6 +8,7 @@
#include "vtkNew.h"
#include "vtkStdString.h"
#include "vtkVariant.h"
#include "vtkMath.h"
template<typename T, typename V>
int UnitTestScalarValueKey(vtkInformation* info, T* key, const V& val)
......@@ -134,7 +135,7 @@ int UnitTestInformationKeys(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
int ok = 1;
vtkNew<vtkInformation> info;
vtkVariant tvval("foo");
double tdval = 3.14159;
double tdval = vtkMath::Pi();
vtkStdString tsval = "bar";
vtkInformationVariantKey* tvskey =
......
......@@ -24,7 +24,9 @@
static int TestPi();
static int TestDegreesFromRadians();
#ifndef VTK_LEGACY_REMOVE
static int TestRound();
#endif
static int TestFloor();
static int TestCeil();
static int TestCeilLog2();
......@@ -95,7 +97,9 @@ int UnitTestMath(int,char *[])
status += TestPi();
status += TestDegreesFromRadians();
#ifndef VTK_LEGACY_REMOVE
status += TestRound();
#endif
status += TestFloor();
status += TestCeil();
status += TestCeilLog2();
......@@ -245,6 +249,7 @@ int TestDegreesFromRadians()
return status;
}
#ifndef VTK_LEGACY_REMOVE
// Validate with http://en.wikipedia.org/wiki/Rounding#Rounding_to_integer
int TestRound()
{
......@@ -309,6 +314,7 @@ int TestRound()
}
return status;
}