Skip to content

Commit d80558b

Browse files
authored
Merge pull request #2417 from SCIInstitute/fix_vtk_9.5_patch
Fix vtk patch for 9.5
2 parents 5e33c32 + 62246b3 commit d80558b

File tree

2 files changed

+8
-31
lines changed

2 files changed

+8
-31
lines changed
Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Common/Core/vtkRandomPool.cxx b/Common/Core/vtkRandomPool.cxx
2-
index 46f9aff201..273ca74c50 100644
2+
index c2bcf67d18..69ca63654a 100644
33
--- a/Common/Core/vtkRandomPool.cxx
44
+++ b/Common/Core/vtkRandomPool.cxx
5-
@@ -338,6 +338,9 @@ const double* vtkRandomPool::GeneratePool()
5+
@@ -332,6 +332,9 @@ const double* vtkRandomPool::GeneratePool()
66
if (actualThreads < numThreads) // readjust work load
77
{
88
numThreads = actualThreads;
@@ -13,48 +13,26 @@ index 46f9aff201..273ca74c50 100644
1313

1414
// Now distribute work
1515
diff --git a/Filters/Modeling/vtkSelectEnclosedPoints.cxx b/Filters/Modeling/vtkSelectEnclosedPoints.cxx
16-
index 0dcae6df7a..2986c1e7fd 100644
16+
index 7d5122297e..998e3f888e 100644
1717
--- a/Filters/Modeling/vtkSelectEnclosedPoints.cxx
1818
+++ b/Filters/Modeling/vtkSelectEnclosedPoints.cxx
19-
@@ -88,7 +88,10 @@ struct SelectInOutCheck
20-
19+
@@ -80,6 +80,9 @@ struct SelectInOutCheck
2120
// Precompute a sufficiently large enough random sequence
2221
this->Sequence = vtkRandomPool::New();
23-
- this->Sequence->SetSize((numPts > 1500 ? numPts : 1500));
22+
this->Sequence->SetSize((numPts > 1500 ? numPts : 1500));
2423
+ // Alan : I see no reason to ever generate more than 1000 random numbers
2524
+ // each vector will use 3 and only a few vectors for each point
2625
+ // this also works around the bug in vtkRandomPool
27-
+ this->Sequence->SetSize(1000);
2826
this->Sequence->GeneratePool();
2927
}
3028

31-
@@ -325,7 +328,7 @@ int vtkSelectEnclosedPoints::IsInsideSurface(double x[3])
29+
@@ -325,7 +328,8 @@ int vtkSelectEnclosedPoints::IsInsideSurface(double x[3])
3230
// supporting the precomputation of a random sequence (see vtkRandomPool).
3331
//
3432
#define VTK_MAX_ITER 10 // Maximum iterations for ray-firing
3533
-#define VTK_VOTE_THRESHOLD 2 // Vote margin for test
34+
+// Alan: I've changed the vote margin to 3
3635
+#define VTK_VOTE_THRESHOLD 3 // Vote margin for test
3736

3837
int vtkSelectEnclosedPoints::IsInsideSurface(double x[3], vtkPolyData* surface, double bds[6],
3938
double length, double tolerance, vtkAbstractCellLocator* locator, vtkIdList* cellIds,
40-
diff --git a/Rendering/OpenGL2/vtkCocoaRenderWindow.mm b/Rendering/OpenGL2/vtkCocoaRenderWindow.mm
41-
index 0d63d49783..82e6b7c57f 100644
42-
--- a/Rendering/OpenGL2/vtkCocoaRenderWindow.mm
43-
+++ b/Rendering/OpenGL2/vtkCocoaRenderWindow.mm
44-
@@ -228,6 +228,16 @@ vtkCocoaRenderWindow::vtkCocoaRenderWindow()
45-
//----------------------------------------------------------------------------
46-
vtkCocoaRenderWindow::~vtkCocoaRenderWindow()
47-
{
48-
+ // If we created a vtkCocoaGLView, clear its reference back to us.
49-
+ if (this->GetViewCreated())
50-
+ {
51-
+ NSView* glView = (NSView*)this->GetWindowId();
52-
+ if ([glView isKindOfClass:[vtkCocoaGLView class]])
53-
+ {
54-
+ [(vtkCocoaGLView*)glView setVTKRenderWindow:nullptr];
55-
+ }
56-
+ }
57-
+
58-
if (this->CursorHidden)
59-
{
60-
this->ShowCursor();

build_dependencies.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ build_vtk()
134134
cd vtk
135135
git checkout -f tags/${VTK_VER}
136136

137-
patch -p1 < ${SCRIPT_DIR}/Support/vtk-9.1.patch
138-
cat Rendering/OpenGL2/vtkCocoaRenderWindow.mm
137+
patch -p1 < ${SCRIPT_DIR}/Support/vtk-9.5.patch
139138

140139
if [[ $BUILD_CLEAN = 1 ]]; then rm -rf build; fi
141140
mkdir -p build && cd build

0 commit comments

Comments
 (0)