1 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/CMakeLists.txt ParaView-4.2.0_SRC.new/CMakeLists.txt
2 --- ParaView-4.2.0_SRC/CMakeLists.txt 2014-09-23 18:46:43.000000000 +0400
3 +++ ParaView-4.2.0_SRC.new/CMakeLists.txt 2014-12-19 15:39:41.000000000 +0300
6 #----------------------------------------------------------------------------------
7 # Set some flags that affect VTK's modules.
8 - set (VTK_NO_PYTHON_THREADS 1 CACHE INTERNAL
9 - "Disable Python Threads support" FORCE)
10 + set (VTK_NO_PYTHON_THREADS ON CACHE BOOL
11 + "Disable Python Threads support")
12 set(VTK_WRAP_PYTHON ${PARAVIEW_ENABLE_PYTHON}
13 CACHE INTERNAL "Should VTK Python wrapping be built?" FORCE)
15 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Core/vtkPVPythonInformation.cxx ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Core/vtkPVPythonInformation.cxx
16 --- ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Core/vtkPVPythonInformation.cxx 2014-09-23 18:46:44.000000000 +0400
17 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Core/vtkPVPythonInformation.cxx 2014-12-19 15:39:41.000000000 +0300
20 bool hasModule(const char *module)
23 vtkSmartPyObject mod(PyImport_ImportModule(module));
29 // Returns empty string on error.
30 std::string getModuleAttrAsString(const char *module, const char *attribute)
33 vtkSmartPyObject mod(PyImport_ImportModule(module));
36 std::ostringstream result;
37 result << "(module '" << module << "' not found)";
43 std::ostringstream result;
44 result << "('" << module << "' module found, missing '" << attribute
50 std::string result = PyBytes_AsString(attr);
56 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Core/vtkSession.cxx ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Core/vtkSession.cxx
57 --- ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Core/vtkSession.cxx 2014-09-23 18:46:44.000000000 +0400
58 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Core/vtkSession.cxx 2014-12-19 15:39:41.000000000 +0300
60 //----------------------------------------------------------------------------
61 void vtkSession::Activate()
63 - vtkProcessModule::GetProcessModule()->PushActiveSession(this);
64 + if(vtkProcessModule::GetProcessModule())
65 + vtkProcessModule::GetProcessModule()->PushActiveSession(this);
68 //----------------------------------------------------------------------------
69 void vtkSession::DeActivate()
71 - vtkProcessModule::GetProcessModule()->PopActiveSession(this);
72 + if(vtkProcessModule::GetProcessModule())
73 + vtkProcessModule::GetProcessModule()->PopActiveSession(this);
76 //----------------------------------------------------------------------------
77 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.cxx ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.cxx
78 --- ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.cxx 2014-09-23 18:46:44.000000000 +0400
79 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.cxx 2014-12-19 15:39:41.000000000 +0300
83 geomFilter->SetUseOutline(0);
84 + geomFilter->SetTriangulate(0);
85 geomFilter->SetNonlinearSubdivisionLevel(1);
86 geomFilter->SetPassThroughCellIds(1);
87 geomFilter->SetPassThroughPointIds(1);
89 vtkPVRenderView::MarkAsRedistributable(inInfo, this);
91 // Tell the view if this representation needs ordered compositing. We need
92 - // ordered compositing when rendering translucent geometry.
93 + // ordered compositing when rendering translucent geometry.
94 if (this->Actor->HasTranslucentPolygonalGeometry())
96 // We need to extend this condition to consider translucent LUTs once we
98 this->LODOutlineFilter->Update();
99 // Pass along the LOD geometry to the view so that it can deliver it to
100 // the rendering node as and when needed.
101 - vtkPVRenderView::SetPieceLOD(inInfo, this,
102 + vtkPVRenderView::SetPieceLOD(inInfo, this,
103 this->LODOutlineFilter->GetOutputDataObject(0));
108 // Pass along the LOD geometry to the view so that it can deliver it to
109 // the rendering node as and when needed.
110 - vtkPVRenderView::SetPieceLOD(inInfo, this,
111 + vtkPVRenderView::SetPieceLOD(inInfo, this,
112 this->Decimator->GetOutputDataObject(0));
118 //----------------------------------------------------------------------------
119 +void vtkGeometryRepresentation::SetTriangulate(int val)
121 + if (vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter))
123 + vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter)->SetTriangulate(val);
126 + // since geometry filter needs to execute, we need to mark the representation
128 + this->MarkModified();
131 +//----------------------------------------------------------------------------
132 void vtkGeometryRepresentation::SetNonlinearSubdivisionLevel(int val)
134 if (vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter))
135 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.h ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.h
136 --- ParaView-4.2.0_SRC/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.h 2014-09-23 18:46:44.000000000 +0400
137 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ClientServerCore/Rendering/vtkGeometryRepresentation.h 2014-12-19 15:39:41.000000000 +0300
139 // It handles non-polygonal datasets by extracting external surfaces. One can
140 // use this representation to show surface/wireframe/points/surface-with-edges.
142 -// The addition of a transformation matrix was supported by CEA/DIF
143 +// The addition of a transformation matrix was supported by CEA/DIF
144 // Commissariat a l'Energie Atomique, Centre DAM Ile-De-France, Arpajon, France.
146 #ifndef __vtkGeometryRepresentation_h
149 // Returns true if this class would like to get ghost-cells if available for
150 // the connection whose information object is passed as the argument.
151 - static bool DoRequestGhostCells(vtkInformation* information);
152 + static bool DoRequestGhostCells(vtkInformation* information);
155 // Representations that use geometry representation as the internal
157 //***************************************************************************
158 // Forwarded to vtkPVGeometryFilter
159 virtual void SetUseOutline(int);
160 + void SetTriangulate(int);
161 void SetNonlinearSubdivisionLevel(int);
163 //***************************************************************************
165 virtual void SetPosition(double, double, double);
166 virtual void SetScale(double, double, double);
167 virtual void SetTexture(vtkTexture*);
168 - virtual void SetUserTransform(const double[16]);
169 + virtual void SetUserTransform(const double[16]);
171 //***************************************************************************
172 // Forwarded to Mapper and LODMapper.
173 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx ParaView-4.2.0_SRC.new/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx
174 --- ParaView-4.2.0_SRC/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx 2014-09-23 18:46:44.000000000 +0400
175 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx 2014-12-19 15:39:41.000000000 +0300
177 #ifdef PARAVIEW_ENABLE_PYTHON
178 // ensure Python interpreter is initialized.
179 vtkPythonInterpreter::Initialize();
181 this->Internals->TraceModule.TakeReference(PyImport_ImportModule("paraview.smtrace"));
182 if (!this->Internals->TraceModule)
185 this->Internals->CreateItemFunction.TakeReference(NULL);
192 @@ -115,12 +117,15 @@
194 #ifdef PARAVIEW_ENABLE_PYTHON
195 vtkPythonInterpreter::Initialize();
200 vtkSmartPyObject module(PyImport_ImportModule("paraview.smstate"));
201 if (!module || PyErr_Occurred())
203 vtkGenericWarningMacro("Failed to import paraview.smstate module.");
209 if (!result || PyErr_Occurred())
211 vtkGenericWarningMacro("Failed to generate state.");
215 - return vtkStdString(PyString_AsString(result));
216 + vtkStdString s(PyString_AsString(result));
228 (void)propertiesToTraceOnCreate;
229 (void)skipHiddenRepresentations;
235 vtkSmartPyObject _start_trace_internal(
236 PyObject_CallMethod(vtkSMTrace::ActiveTracer->GetTraceModule(),
237 const_cast<char*>("_start_trace_internal"), NULL));
239 vtkSMTrace::ActiveTracer->CheckForError();
243 vtkSMTrace::ActiveTracer = NULL;
245 #ifdef PARAVIEW_ENABLE_PYTHON
247 vtkSmartPyObject _stop_trace_internal(
248 PyObject_CallMethod(active->GetTraceModule(), const_cast<char*>("_stop_trace_internal"), NULL));
249 if (active->CheckForError() == false)
250 @@ -199,14 +211,18 @@
252 if (Py_None != _stop_trace_internal.GetPointer() && _stop_trace_internal.GetPointer() != NULL)
254 - return vtkStdString(PyString_AsString(_stop_trace_internal));
255 + vtkStdString s(PyString_AsString(_stop_trace_internal));
261 vtkGenericWarningMacro("Empty trace returned!!!");
263 return vtkStdString();
268 return vtkStdString();
270 @@ -223,13 +239,17 @@
272 #ifdef PARAVIEW_ENABLE_PYTHON
273 vtkSMTrace* active = vtkSMTrace::ActiveTracer;
275 vtkSmartPyObject get_current_trace_output(
276 PyObject_CallMethod(active->GetTraceModule(), const_cast<char*>("get_current_trace_output"), NULL));
277 if (active->CheckForError() == false && get_current_trace_output)
280 - return vtkStdString(PyString_AsString(get_current_trace_output));
281 + vtkStdString s(PyString_AsString(get_current_trace_output));
287 return vtkStdString();
290 bool vtkSMTrace::CheckForError()
292 #ifdef PARAVIEW_ENABLE_PYTHON
294 PyObject *exception = PyErr_Occurred();
297 @@ -264,12 +285,15 @@
298 // catch Untraceable exceptions. We can log them when debugging is
314 if (vtkSMTrace::GetActiveTracer())
316 #ifdef PARAVIEW_ENABLE_PYTHON
318 vtkSmartPyObject keyObj(PyString_FromString(key));
319 vtkSmartPyObject valObj(vtkPythonUtil::GetObjectFromPointer(val));
320 assert(valObj && keyObj);
322 int ret = PyDict_SetItem(this->Internals->GetKWArgs(), keyObj, valObj);
330 if (vtkSMTrace::GetActiveTracer())
332 #ifdef PARAVIEW_ENABLE_PYTHON
334 vtkSmartPyObject keyObj(PyString_FromString(key));
335 vtkSmartPyObject valObj;
338 int ret = PyDict_SetItem(this->Internals->GetKWArgs(), keyObj, valObj);
346 if (vtkSMTrace::GetActiveTracer())
348 #ifdef PARAVIEW_ENABLE_PYTHON
350 vtkSmartPyObject keyObj(PyString_FromString(key));
351 vtkSmartPyObject valObj(PyInt_FromLong(val));
352 assert(keyObj && valObj);
354 int ret = PyDict_SetItem(this->Internals->GetKWArgs(), keyObj, valObj);
362 if (vtkSMTrace::GetActiveTracer())
364 #ifdef PARAVIEW_ENABLE_PYTHON
366 vtkSmartPyObject keyObj(PyString_FromString(key));
367 vtkSmartPyObject valObj(PyFloat_FromDouble(val));
368 assert(keyObj && valObj);
370 int ret = PyDict_SetItem(this->Internals->GetKWArgs(), keyObj, valObj);
378 if (vtkSMTrace::GetActiveTracer())
380 #ifdef PARAVIEW_ENABLE_PYTHON
382 vtkSmartPyObject keyObj(PyString_FromString(key));
383 vtkSmartPyObject valObj(PyBool_FromLong(val? 1 : 0));
384 assert(keyObj && valObj);
386 int ret = PyDict_SetItem(this->Internals->GetKWArgs(), keyObj, valObj);
393 @@ -452,11 +486,13 @@
394 if (vtkSMTrace::GetActiveTracer())
396 #ifdef PARAVIEW_ENABLE_PYTHON
398 vtkSmartPyObject valObj(vtkPythonUtil::GetObjectFromPointer(val));
400 int ret = PyList_Append(this->Internals->GetPositionalArgs(), valObj);
407 @@ -470,11 +506,13 @@
408 if (vtkSMTrace::GetActiveTracer())
410 #ifdef PARAVIEW_ENABLE_PYTHON
412 vtkSmartPyObject valObj(PyString_FromString(val));
414 int ret = PyList_Append(this->Internals->GetPositionalArgs(), valObj);
421 @@ -487,11 +525,13 @@
422 if (vtkSMTrace::GetActiveTracer())
424 #ifdef PARAVIEW_ENABLE_PYTHON
426 vtkSmartPyObject valObj(PyInt_FromLong(val));
428 int ret = PyList_Append(this->Internals->GetPositionalArgs(), valObj);
435 @@ -504,11 +544,13 @@
436 if (vtkSMTrace::GetActiveTracer())
438 #ifdef PARAVIEW_ENABLE_PYTHON
440 vtkSmartPyObject valObj(PyFloat_FromDouble(val));
442 int ret = PyList_Append(this->Internals->GetPositionalArgs(), valObj);
449 @@ -521,11 +563,13 @@
450 if (vtkSMTrace::GetActiveTracer())
452 #ifdef PARAVIEW_ENABLE_PYTHON
454 vtkSmartPyObject valObj(PyBool_FromLong(val? 1 : 0));
456 int ret = PyList_Append(this->Internals->GetPositionalArgs(), valObj);
464 vtkSMTrace* tracer = vtkSMTrace::GetActiveTracer();
465 if (tracer && this->Internals->PyItem)
468 vtkSmartPyObject reply(
469 PyObject_CallMethod(this->Internals->PyItem,
470 const_cast<char*>("finalize"), NULL));
472 tracer->CheckForError();
473 tracer->InvokeEvent(vtkCommand::UpdateEvent);
476 if (vtkSMTrace* tracer = vtkSMTrace::GetActiveTracer())
478 #ifdef PARAVIEW_ENABLE_PYTHON
480 assert(tracer->GetTraceModule());
481 assert(tracer->GetCreateItemFunction());
484 this->Internals->PyItem.TakeReference(
485 PyObject_Call(tracer->GetCreateItemFunction(), args, NULL));
486 tracer->CheckForError();
491 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx ParaView-4.2.0_SRC.new/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx
492 --- ParaView-4.2.0_SRC/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx 2014-09-23 18:46:44.000000000 +0400
493 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx 2014-12-19 15:39:41.000000000 +0300
498 - vtkWarningMacro("Could not determine array range.");
499 + // vtkWarningMacro("Could not determine array range.");
503 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml ParaView-4.2.0_SRC.new/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml
504 --- ParaView-4.2.0_SRC/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml 2014-09-23 18:46:44.000000000 +0400
505 +++ ParaView-4.2.0_SRC.new/ParaViewCore/ServerManager/SMApplication/Resources/views_and_representations.xml 2014-12-19 15:39:41.000000000 +0300
506 @@ -2044,16 +2044,14 @@
507 <IntVectorProperty command="SetStereoRender"
510 - number_of_elements="1"
512 + number_of_elements="1">
513 <BooleanDomain name="bool" />
515 <IntVectorProperty command="SetStereoType"
518 panel_visibility="never"
519 - number_of_elements="1"
521 + number_of_elements="1">
522 <EnumerationDomain name="enum">
523 <Entry text="Crystal Eyes"
525 @@ -3139,6 +3137,8 @@
526 panel_visibility="advanced" />
527 <Property name="UserTransform"
528 panel_visibility="never" />
529 + <Property name="Triangulate"
530 + panel_visibility="advanced" />
531 <Property name="NonlinearSubdivisionLevel"
532 panel_visibility="advanced" />
533 <Property name="BlockVisibility"
534 @@ -8229,6 +8229,15 @@
535 <!--<Entry value="2" text="Phong" />-->
538 + <IntVectorProperty command="SetTriangulate"
541 + number_of_elements="1">
542 + <BooleanDomain name="bool" />
543 + <Documentation>Triangulate the geometry internally to avoid rendering
544 + issues of non-convex polygons. This feature has a processing and memory
545 + cost, it should be enabled only when needed.</Documentation>
546 + </IntVectorProperty>
547 <IntVectorProperty command="SetNonlinearSubdivisionLevel"
549 name="NonlinearSubdivisionLevel"
550 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h ParaView-4.2.0_SRC.new/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h
551 --- ParaView-4.2.0_SRC/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h 2014-09-23 18:46:44.000000000 +0400
552 +++ ParaView-4.2.0_SRC.new/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h 2014-12-19 15:39:41.000000000 +0300
555 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
557 -#ifdef PARAVIEW_USE_MPI
558 -#include "vtkMPIImageReader.h"
560 #include "vtkImageReader.h"
563 -class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVImageReader : public
564 -#ifdef PARAVIEW_USE_MPI
569 +class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVImageReader : public vtkImageReader
572 static vtkPVImageReader* New();
574 -#ifdef PARAVIEW_USE_MPI
575 - vtkTypeMacro(vtkPVImageReader, vtkMPIImageReader);
578 vtkTypeMacro(vtkPVImageReader, vtkImageReader);
581 void PrintSelf(ostream& os, vtkIndent indent);
583 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.cxx ParaView-4.2.0_SRC.new/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.cxx
584 --- ParaView-4.2.0_SRC/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.cxx 2014-09-23 18:46:44.000000000 +0400
585 +++ ParaView-4.2.0_SRC.new/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.cxx 2014-12-19 15:39:41.000000000 +0300
587 #include "vtkStructuredGrid.h"
588 #include "vtkStructuredGridOutlineFilter.h"
589 #include "vtkTimerLog.h"
590 +#include "vtkTriangleFilter.h"
591 #include "vtkUniformGrid.h"
592 #include "vtkUnsignedCharArray.h"
593 #include "vtkUnsignedIntArray.h"
598 -#define VTK_CREATE(type, name) \
599 - vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
601 vtkStandardNewMacro(vtkPVGeometryFilter);
602 vtkCxxSetObjectMacro(vtkPVGeometryFilter, Controller, vtkMultiProcessController);
604 this->UseOutline = 1;
606 this->GenerateCellNormals = 1;
607 + this->Triangulate = false;
608 this->NonlinearSubdivisionLevel = 1;
610 this->DataSetSurfaceFilter = vtkDataSetSurfaceFilter::New();
611 @@ -1348,8 +1348,8 @@
613 this->OutlineFlag = 0;
615 - bool handleSubdivision = false;
616 - if (this->NonlinearSubdivisionLevel > 0)
617 + bool handleSubdivision = (this->Triangulate != 0);
618 + if (!handleSubdivision && (this->NonlinearSubdivisionLevel > 0))
620 // Check to see if the data actually has nonlinear cells. Handling
621 // nonlinear cells adds unnecessary work if we only have linear cells.
622 @@ -1445,6 +1445,16 @@
623 this->DataSetSurfaceFilter->UnstructuredGridExecute(input, output, updateghostlevel);
626 + if (this->Triangulate && (output->GetNumberOfPolys() > 0))
628 + // Triangulate the polygonal mesh if requested to avoid rendering
629 + // issues of non-convex polygons.
630 + vtkNew<vtkTriangleFilter> triangleFilter;
631 + triangleFilter->SetInputData(output);
632 + triangleFilter->Update();
633 + output->ShallowCopy(triangleFilter->GetOutput());
636 if (handleSubdivision)
638 // Restore state of DataSetSurfaceFilter.
639 @@ -1456,9 +1466,9 @@
641 // Now use vtkPVRecoverGeometryWireframe to create an edge flag attribute
642 // that will cause the wireframe to be rendered correctly.
643 - VTK_CREATE(vtkPolyData, nextStageInput);
644 + vtkNew<vtkPolyData> nextStageInput;
645 nextStageInput->ShallowCopy(output); // Yes output is correct.
646 - this->RecoverWireframeFilter->SetInputData(nextStageInput);
647 + this->RecoverWireframeFilter->SetInputData(nextStageInput.Get());
649 // Observe the progress of the internal filter.
650 // TODO: Make the consecutive internal filter execution have monotonically
651 @@ -1489,7 +1499,7 @@
654 vtkIdType numPts = polyPtIds2FacePtIds->GetNumberOfTuples();
655 - VTK_CREATE(vtkIdTypeArray, polyPtIds2OriginalPtIds);
656 + vtkNew<vtkIdTypeArray> polyPtIds2OriginalPtIds;
657 polyPtIds2OriginalPtIds->SetName("vtkOriginalPointIds");
658 polyPtIds2OriginalPtIds->SetNumberOfComponents(1);
659 polyPtIds2OriginalPtIds->SetNumberOfTuples(numPts);
660 @@ -1503,7 +1513,7 @@
662 polyPtIds2OriginalPtIds->SetValue(polyPtId, originalPtId);
664 - output->GetPointData()->AddArray(polyPtIds2OriginalPtIds);
665 + output->GetPointData()->AddArray(polyPtIds2OriginalPtIds.Get());
669 @@ -1518,7 +1528,7 @@
671 //----------------------------------------------------------------------------
672 void vtkPVGeometryFilter::PolyDataExecute(
673 - vtkPolyData* input, vtkPolyData* out, int doCommunicate)
674 + vtkPolyData* input, vtkPolyData* output, int doCommunicate)
676 if (!this->UseOutline)
678 @@ -1533,54 +1543,90 @@
679 inCopy->RemoveGhostCells(1);
680 stripper->SetInputData(inCopy);
682 - out->CopyStructure(stripper->GetOutput());
683 - out->GetPointData()->ShallowCopy(stripper->GetOutput()->GetPointData());
684 - out->GetCellData()->ShallowCopy(stripper->GetOutput()->GetCellData());
685 + output->CopyStructure(stripper->GetOutput());
686 + output->GetPointData()->ShallowCopy(stripper->GetOutput()->GetPointData());
687 + output->GetCellData()->ShallowCopy(stripper->GetOutput()->GetCellData());
693 - out->ShallowCopy(input);
694 + output->ShallowCopy(input);
695 if (this->PassThroughCellIds)
697 - vtkIdTypeArray *originalCellIds = vtkIdTypeArray::New();
698 + vtkNew<vtkIdTypeArray> originalCellIds;
699 originalCellIds->SetName("vtkOriginalCellIds");
700 originalCellIds->SetNumberOfComponents(1);
701 - vtkCellData *outputCD = out->GetCellData();
702 - outputCD->AddArray(originalCellIds);
703 - vtkIdType numTup = out->GetNumberOfCells();
704 + vtkNew<vtkIdTypeArray> originalFaceIds;
705 + originalFaceIds->SetName(vtkPVRecoverGeometryWireframe::ORIGINAL_FACE_IDS());
706 + originalFaceIds->SetNumberOfComponents(1);
707 + vtkCellData *outputCD = output->GetCellData();
708 + outputCD->AddArray(originalCellIds.Get());
709 + if (this->Triangulate)
711 + outputCD->AddArray(originalFaceIds.Get());
713 + vtkIdType numTup = output->GetNumberOfCells();
714 originalCellIds->SetNumberOfValues(numTup);
715 + originalFaceIds->SetNumberOfValues(numTup);
716 for (vtkIdType cId = 0; cId < numTup; cId++)
718 originalCellIds->SetValue(cId, cId);
719 + originalFaceIds->SetValue(cId, cId);
721 - originalCellIds->Delete();
722 - originalCellIds = NULL;
724 if (this->PassThroughPointIds)
726 - vtkIdTypeArray *originalPointIds = vtkIdTypeArray::New();
727 + vtkNew<vtkIdTypeArray> originalPointIds;
728 originalPointIds->SetName("vtkOriginalPointIds");
729 originalPointIds->SetNumberOfComponents(1);
730 - vtkPointData *outputPD = out->GetPointData();
731 - outputPD->AddArray(originalPointIds);
732 - vtkIdType numTup = out->GetNumberOfPoints();
733 + vtkPointData *outputPD = output->GetPointData();
734 + outputPD->AddArray(originalPointIds.Get());
735 + vtkIdType numTup = output->GetNumberOfPoints();
736 originalPointIds->SetNumberOfValues(numTup);
737 for (vtkIdType pId = 0; pId < numTup; pId++)
739 originalPointIds->SetValue(pId, pId);
741 - originalPointIds->Delete();
742 - originalPointIds = NULL;
744 - out->RemoveGhostCells(1);
746 + output->RemoveGhostCells(1);
748 + if (this->Triangulate)
750 + // Triangulate the polygonal mesh.
751 + vtkNew<vtkTriangleFilter> triangleFilter;
752 + triangleFilter->SetInputData(output);
753 + triangleFilter->Update();
755 + // Now use vtkPVRecoverGeometryWireframe to create an edge flag attribute
756 + // that will cause the wireframe to be rendered correctly.
757 + this->RecoverWireframeFilter->SetInputData(triangleFilter->GetOutput());
759 + // Observe the progress of the internal filter.
760 + // TODO: Make the consecutive internal filter execution have monotonically
761 + // increasing progress rather than restarting for every internal filter.
762 + this->RecoverWireframeFilter->AddObserver(
763 + vtkCommand::ProgressEvent,
764 + this->InternalProgressObserver);
765 + this->RecoverWireframeFilter->Update();
766 + // The internal filter finished. Remove the observer.
767 + this->RecoverWireframeFilter->RemoveObserver(
768 + this->InternalProgressObserver);
770 + this->RecoverWireframeFilter->SetInputData(NULL);
772 + // Get what should be the final output.
773 + output->ShallowCopy(this->RecoverWireframeFilter->GetOutput());
775 + output->GetCellData()->RemoveArray(vtkPVRecoverGeometryWireframe::ORIGINAL_FACE_IDS());
781 this->OutlineFlag = 1;
782 - this->DataSetExecute(input, out, doCommunicate);
783 + this->DataSetExecute(input, output, doCommunicate);
786 //----------------------------------------------------------------------------
787 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.h ParaView-4.2.0_SRC.new/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.h
788 --- ParaView-4.2.0_SRC/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.h 2014-09-23 18:46:44.000000000 +0400
789 +++ ParaView-4.2.0_SRC.new/ParaViewCore/VTKExtensions/Rendering/vtkPVGeometryFilter.h 2014-12-19 15:39:41.000000000 +0300
791 vtkBooleanMacro(GenerateCellNormals, int);
794 + // Whether to triangulate mesh for rendering. This parameter avoid
795 + // rendering issues of non-convex polygons.
796 + vtkSetMacro(Triangulate, int);
797 + vtkGetMacro(Triangulate, int);
798 + vtkBooleanMacro(Triangulate, int);
801 // Nonlinear faces are approximated with flat polygons. This parameter
802 // controls how many times to subdivide nonlinear surface cells. Higher
803 // subdivisions generate closer approximations but take more memory and
806 // If on, the output polygonal dataset will have a celldata array that
807 // holds the cell index of the original 3D cell that produced each output
808 - // cell. This is useful for picking. The default is off to conserve
810 + // cell. This is useful for picking but it takes memory. The default is on.
811 void SetPassThroughCellIds(int);
812 vtkGetMacro(PassThroughCellIds,int);
813 vtkBooleanMacro(PassThroughCellIds,int);
816 // If on, the output polygonal dataset will have a pointdata array that
817 // holds the point index of the original vertex that produced each output
818 - // vertex. This is useful for picking. The default is off to conserve
820 + // vertex. This is useful for picking but it takes memory. The default is on.
821 void SetPassThroughPointIds(int);
822 vtkGetMacro(PassThroughPointIds,int);
823 vtkBooleanMacro(PassThroughPointIds,int);
825 virtual vtkExecutive* CreateDefaultExecutive();
828 - // Produce geometry for a block in the dataset.
829 + // Produce geometry for a block in the dataset.
830 // This does not handle producing outlines. Call only when this->UseOutline ==
831 // 0; \c extractface mask it is used to determine external faces.
832 void ExecuteAMRBlock(vtkUniformGrid* input,
836 int GenerateCellNormals;
838 int NonlinearSubdivisionLevel;
840 vtkMultiProcessController* Controller;
841 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Qt/Components/pqPropertiesPanel.cxx ParaView-4.2.0_SRC.new/Qt/Components/pqPropertiesPanel.cxx
842 --- ParaView-4.2.0_SRC/Qt/Components/pqPropertiesPanel.cxx 2014-09-23 18:46:44.000000000 +0400
843 +++ ParaView-4.2.0_SRC.new/Qt/Components/pqPropertiesPanel.cxx 2014-12-19 15:39:41.000000000 +0300
845 this->Internals->Ui.DisplayButton->setVisible(has_multiples_types && has_display);
846 this->Internals->Ui.ViewButton->setVisible(has_multiples_types && has_view);
848 + // added to avoid unwanted save restore buttons
849 + this->Internals->Ui.PropertiesSaveAsDefaults->setVisible(has_source);
850 + this->Internals->Ui.PropertiesRestoreDefaults->setVisible(has_source);
851 + this->Internals->Ui.DisplaySaveAsDefaults->setVisible(has_display);
852 + this->Internals->Ui.DisplayRestoreDefaults->setVisible(has_display);
853 + this->Internals->Ui.ViewSaveAsDefaults->setVisible(has_view);
854 + this->Internals->Ui.ViewRestoreDefaults->setVisible(has_view);
859 @@ -593,14 +601,15 @@
862 //-----------------------------------------------------------------------------
863 -void pqPropertiesPanel::updateViewPanel (pqView* _view)
864 +void pqPropertiesPanel::updateViewPanel (pqView* argView)
866 + pqView* _view = argView;
867 if ( (this->PanelMode & pqPropertiesPanel::VIEW_PROPERTIES) == 0)
872 - if (this->Internals->View != _view)
873 + if (this->Internals->View != argView)
875 // The view has changed.
876 if (this->Internals->View)
878 delete this->Internals->ViewWidgets;
881 - this->Internals->View = _view;
882 - emit this->viewChanged(_view);
883 + this->Internals->View = argView;
884 + emit this->viewChanged(argView);
887 // create the widgets for this view
888 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Qt/Python/pqPythonShell.cxx ParaView-4.2.0_SRC.new/Qt/Python/pqPythonShell.cxx
889 --- ParaView-4.2.0_SRC/Qt/Python/pqPythonShell.cxx 2014-09-23 18:46:44.000000000 +0400
890 +++ ParaView-4.2.0_SRC.new/Qt/Python/pqPythonShell.cxx 2014-12-19 15:40:01.000000000 +0300
893 QStringList getPythonAttributes(const QString& pythonObjectName)
896 if (this->Interpreter == NULL ||
897 this->Interpreter->GetInteractiveConsoleLocalsPyObject() == NULL)
908 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Qt/Python/pqPythonSyntaxHighlighter.cxx ParaView-4.2.0_SRC.new/Qt/Python/pqPythonSyntaxHighlighter.cxx
909 --- ParaView-4.2.0_SRC/Qt/Python/pqPythonSyntaxHighlighter.cxx 2014-09-23 18:46:44.000000000 +0400
910 +++ ParaView-4.2.0_SRC.new/Qt/Python/pqPythonSyntaxHighlighter.cxx 2014-12-19 15:39:41.000000000 +0300
912 this->Internals->TextEdit = textEdit;
913 this->Internals->TextEdit->installEventFilter(this);
914 vtkPythonInterpreter::Initialize();
916 this->Internals->PygmentsModule.TakeReference(PyImport_ImportModule("pygments"));
917 if (this->Internals->PygmentsModule && this->Internals->TextEdit != NULL)
920 this->connect(this->Internals->TextEdit.data(), SIGNAL(textChanged()),
921 this, SLOT(rehighlightSyntax()));
924 this->Internals->IsSyntaxHighlighting = false;
925 // Replace tabs with 4 spaces
926 this->Internals->ReplaceTabs = true;
927 @@ -175,10 +177,12 @@
929 QString leadingWhitespace = text.left(leadingWhiteSpaceLength);
930 QString trailingWhitespace = text.right(trailingWhiteSpaceLength);
932 vtkSmartPyObject args(Py_BuildValue("sOO",text.trimmed().toStdString().c_str(),
933 this->Internals->PythonLexer.GetPointer(),this->Internals->HtmlFormatter.GetPointer()));
934 vtkSmartPyObject resultingText(PyObject_Call(this->Internals->HighlightFunction,args,NULL));
935 const char *resultingTextAsCString = PyString_AsString(resultingText);
937 QString pygmentsOutput(resultingTextAsCString);
938 // the first span tag always should follow the pre tag like this; <pre ...><span
939 int startOfPre = pygmentsOutput.indexOf(">",pygmentsOutput.indexOf("<pre"))+1;
940 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Utilities/VisItBridge/databases/Velodyne/VelodyneReader.C ParaView-4.2.0_SRC.new/Utilities/VisItBridge/databases/Velodyne/VelodyneReader.C
941 --- ParaView-4.2.0_SRC/Utilities/VisItBridge/databases/Velodyne/VelodyneReader.C 2014-09-23 18:46:46.000000000 +0400
942 +++ ParaView-4.2.0_SRC.new/Utilities/VisItBridge/databases/Velodyne/VelodyneReader.C 2014-12-19 15:39:41.000000000 +0300
944 // This code was contributed to the VisIt project by Corvid Technologies
945 // on February 10, 2010.
948 +#define H5Eset_auto_vers 2
955 #include <VelodyneReader.h>
957 #include <visit-hdf5.h>
960 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Utilities/VisItBridge/databases/Vs/VsFilter.C ParaView-4.2.0_SRC.new/Utilities/VisItBridge/databases/Vs/VsFilter.C
961 --- ParaView-4.2.0_SRC/Utilities/VisItBridge/databases/Vs/VsFilter.C 2014-09-23 18:46:46.000000000 +0400
962 +++ ParaView-4.2.0_SRC.new/Utilities/VisItBridge/databases/Vs/VsFilter.C 2014-12-19 15:39:41.000000000 +0300
964 +#define H5Gopen_vers 2
965 +#define H5Dopen_vers 2
966 +#define H5Eset_auto_vers 2
967 +#define H5Aiterate_vers 2
968 #include <vtk_hdf5.h>
969 #include <visit-hdf5.h>
970 #if HDF5_VERSION_GE(1,8,1)
973 // Get info of the linked object.
975 -#ifndef H5_USE_16_API
976 hid_t obj_id = H5Oopen(locId, name, H5P_DEFAULT);
978 - hid_t obj_id = H5Oopen(locId, name);
982 VsLog::errorLog() <<"VsFilter::visitLinks() - unable to get id for external object " <<name <<std::endl;
983 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Utilities/VisItBridge/databases/Vs/VsH5File.C ParaView-4.2.0_SRC.new/Utilities/VisItBridge/databases/Vs/VsH5File.C
984 --- ParaView-4.2.0_SRC/Utilities/VisItBridge/databases/Vs/VsH5File.C 2014-09-23 18:46:46.000000000 +0400
985 +++ ParaView-4.2.0_SRC.new/Utilities/VisItBridge/databases/Vs/VsH5File.C 2014-12-19 15:39:41.000000000 +0300
987 * Created on: Apr 27, 2010
991 +#define H5Eset_auto_vers 2
992 #include "VsH5File.h"
994 #include "VsFilter.h"
995 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/CMake/vtkModuleTop.cmake ParaView-4.2.0_SRC.new/VTK/CMake/vtkModuleTop.cmake
996 --- ParaView-4.2.0_SRC/VTK/CMake/vtkModuleTop.cmake 2014-09-23 18:47:10.000000000 +0400
997 +++ ParaView-4.2.0_SRC.new/VTK/CMake/vtkModuleTop.cmake 2014-12-19 15:39:41.000000000 +0300
999 get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS)
1001 install(EXPORT ${VTK_INSTALL_EXPORT_NAME} DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
1002 + install(EXPORT ${VTK_INSTALL_EXPORT_NAME} DESTINATION ${VTK_INSTALL_PACKAGE_DIR} FILE VTKTargets.cmake)
1004 set(CMAKE_CONFIGURABLE_FILE_CONTENT "# No targets!")
1005 configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
1006 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx ParaView-4.2.0_SRC.new/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx
1007 --- ParaView-4.2.0_SRC/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx 2014-09-23 18:47:11.000000000 +0400
1008 +++ ParaView-4.2.0_SRC.new/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx 2014-12-19 15:39:41.000000000 +0300
1010 //----------------------------------------------------------------------------
1011 vtkMatplotlibMathTextUtilities::Availablity
1012 vtkMatplotlibMathTextUtilities::MPLMathTextAvailable =
1013 -vtkMatplotlibMathTextUtilities::NOT_TESTED;
1014 +vtkMatplotlibMathTextUtilities::UNAVAILABLE;
1016 // A macro that is used in New() to print warnings if VTK_MATPLOTLIB_DEBUG
1017 // is defined in the environment. Use vtkGenericWarningMacro to allow this to
1018 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp ParaView-4.2.0_SRC.new/VTK/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp
1019 --- ParaView-4.2.0_SRC/VTK/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp 2014-09-23 18:47:11.000000000 +0400
1020 +++ ParaView-4.2.0_SRC.new/VTK/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp 2014-12-19 15:39:41.000000000 +0300
1022 coordinates[3][1] - coordinates[0][1],
1023 coordinates[3][2] - coordinates[0][2] );
1025 - double detTet = ab % ( ac * ad );
1026 + double detTet = fabs( ab % ( ac * ad ) );
1028 if( detTet < VERDICT_DBL_MIN )
1029 return (double)VERDICT_DBL_MAX;
1033 double aspect_ratio;
1034 - aspect_ratio = normal_coeff * hm * ( A + B + C + D ) / fabs( detTet );
1035 + aspect_ratio = normal_coeff * hm * ( A + B + C + D ) / detTet;
1037 if( aspect_ratio > 0 )
1038 return (double) VERDICT_MIN( aspect_ratio, VERDICT_DBL_MAX );
1039 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/Utilities/Python/vtkPython.h ParaView-4.2.0_SRC.new/VTK/Utilities/Python/vtkPython.h
1040 --- ParaView-4.2.0_SRC/VTK/Utilities/Python/vtkPython.h 2014-09-23 18:47:11.000000000 +0400
1041 +++ ParaView-4.2.0_SRC.new/VTK/Utilities/Python/vtkPython.h 2014-12-19 15:39:41.000000000 +0300
1043 #error "Python.h is different version from what VTK was configured with!!"
1046 +#ifdef VTK_NO_PYTHON_THREADS
1047 +# define VTK_PY_GIL_ENSURE
1048 +# define VTK_PY_GIL_RELEASE
1050 +# define VTK_PY_GIL_ENSURE PyGILState_STATE _gstate_avoid_clash = PyGILState_Ensure();
1051 +# define VTK_PY_GIL_RELEASE PyGILState_Release(_gstate_avoid_clash);
1057 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx ParaView-4.2.0_SRC.new/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx
1058 --- ParaView-4.2.0_SRC/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx 2014-09-23 18:47:11.000000000 +0400
1059 +++ ParaView-4.2.0_SRC.new/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx 2014-12-19 15:39:41.000000000 +0300
1062 void CleanupPythonObjects()
1065 Py_XDECREF(this->InteractiveConsoleLocals);
1066 Py_XDECREF(this->InteractiveConsole);
1067 this->InteractiveConsole = NULL;
1069 const char* code = "import gc; gc.collect()\n";
1070 vtkPythonInterpreter::RunSimpleString(code);
1072 + VTK_PY_GIL_RELEASE
1075 PyObject* GetInteractiveConsole()
1078 vtkPythonInterpreter::Initialize();
1081 // set up the code.InteractiveConsole instance that we'll use.
1082 const char* code = "import code\n"
1083 "__vtkConsoleLocals={'__name__':'__vtkconsole__','__doc__':None}\n"
1086 vtkGenericWarningMacro(
1087 "Failed to locate the InteractiveConsole/InteractiveConsoleLocals object.");
1088 + VTK_PY_GIL_RELEASE
1091 Py_INCREF(this->InteractiveConsole);
1093 PySys_SetObject(const_cast<char*>("ps2"), ps2 = PyString_FromString("... "));
1097 + VTK_PY_GIL_RELEASE
1098 return this->InteractiveConsole;
1106 bool ret_value = false;
1107 PyObject *res = PyObject_CallMethod(console,
1108 const_cast<char*>("push"), const_cast<char*>("z"), buffer.c_str());
1113 + VTK_PY_GIL_RELEASE
1117 @@ -190,12 +196,14 @@
1119 this->Internals->GetInteractiveConsole(); //ensure the console is initialized
1122 PyObject* context = this->Internals->GetInteractiveConsoleLocalsPyObject();
1123 PyObject* result = PyRun_String(const_cast<char*>(script), Py_file_input, context, context);
1128 + VTK_PY_GIL_RELEASE
1136 + VTK_PY_GIL_RELEASE
1140 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx ParaView-4.2.0_SRC.new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx
1141 --- ParaView-4.2.0_SRC/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx 2014-09-23 18:47:11.000000000 +0400
1142 +++ ParaView-4.2.0_SRC.new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx 2014-12-19 15:39:54.000000000 +0300
1145 inline void vtkPrependPythonPath(const char* pathtoadd)
1148 PyObject* path = PySys_GetObject(const_cast<char*>("path"));
1149 PyObject* newpath = PyString_FromString(pathtoadd);
1150 PyList_Insert(path, 0, newpath);
1152 + VTK_PY_GIL_RELEASE
1157 //----------------------------------------------------------------------------
1158 bool vtkPythonInterpreter::Initialize(int initsigs /*=0*/)
1160 - vtkPythonInterpreter::InitializedOnce = true;
1161 if (Py_IsInitialized() == 0)
1163 #if (VTK_PYTHON_MAJOR_VERSION > 2) ||\
1164 @@ -117,11 +118,26 @@
1170 // Put default SIGINT handler back after Py_Initialize/Py_InitializeEx.
1171 signal(SIGINT, SIG_DFL);
1175 + if (! vtkPythonInterpreter::InitializedOnce)
1177 +#ifndef VTK_NO_PYTHON_THREADS
1178 + int threadInit = PyEval_ThreadsInitialized();
1179 + PyEval_InitThreads(); // safe to call this multiple time
1181 + // At this point we have GIL, or we are mono-thread.
1182 + // Access to the static below is safe:
1183 + vtkPythonInterpreter::InitializedOnce = true;
1185 +#ifndef VTK_NO_PYTHON_THREADS
1187 + PyEval_SaveThread(); // release GIL
1189 // HACK: Calling PyRun_SimpleString for the first time for some reason results in
1190 // a "\n" message being generated which is causing the error dialog to
1191 // popup. So we flush that message out of the system before setting up the
1192 @@ -134,15 +150,17 @@
1193 vtkPythonStdStreamCaptureHelper* wrapperErr =
1194 NewPythonStdStreamCaptureHelper(true);
1196 - // Redirect Python's stdout and stderr and stdin
1197 - PySys_SetObject(const_cast<char*>("stdout"),
1198 + // Redirect Python's stdout and stderr and stdin - GIL protected operation
1200 + int ret1 = PySys_SetObject(const_cast<char*>("stdout"),
1201 reinterpret_cast<PyObject*>(wrapperOut));
1202 - PySys_SetObject(const_cast<char*>("stderr"),
1203 + int ret2 = PySys_SetObject(const_cast<char*>("stderr"),
1204 reinterpret_cast<PyObject*>(wrapperErr));
1205 - PySys_SetObject(const_cast<char*>("stdin"),
1206 + int ret3 = PySys_SetObject(const_cast<char*>("stdin"),
1207 reinterpret_cast<PyObject*>(wrapperOut));
1208 Py_DECREF(wrapperOut);
1209 Py_DECREF(wrapperErr);
1210 + VTK_PY_GIL_RELEASE
1212 for (size_t cc=0; cc < PythonPaths.size(); cc++)
1215 if (Py_IsInitialized() != 0)
1217 NotifyInterpreters(vtkCommand::ExitEvent);
1223 vtkPythonInterpreter::SetProgramName(argv[0]);
1225 vtkPythonInterpreter::Initialize(1);
1227 return Py_Main(argc, argv);
1228 + // Py_Main already does a finalize etc ...
1231 //----------------------------------------------------------------------------
1233 buffer.erase(std::remove(buffer.begin(), buffer.end(), '\r'), buffer.end());
1235 // The cast is necessary because PyRun_SimpleString() hasn't always been const-correct
1237 PyRun_SimpleString(const_cast<char*>(buffer.c_str()));
1238 + VTK_PY_GIL_RELEASE
1241 //----------------------------------------------------------------------------
1242 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx ParaView-4.2.0_SRC.new/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx
1243 --- ParaView-4.2.0_SRC/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx 2014-09-23 18:47:11.000000000 +0400
1244 +++ ParaView-4.2.0_SRC.new/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx 2014-12-19 15:39:41.000000000 +0300
1246 vtkPythonUtil::UnRegisterPythonCommand(this);
1247 if (this->obj && Py_IsInitialized())
1250 Py_DECREF(this->obj);
1251 + VTK_PY_GIL_RELEASE
1256 void vtkPythonCommand::SetObject(PyObject *o)
1260 + VTK_PY_GIL_RELEASE
1265 // If a threadstate has been set using vtkPythonCommand::SetThreadState,
1266 // then swap it in here. See the email to vtk-developers@vtk.org from
1267 // June 18, 2009 with subject "Py_NewInterpreter and vtkPythonCallback issue"
1268 - PyThreadState* prevThreadState = NULL;
1269 - if (this->ThreadState)
1271 - prevThreadState = PyThreadState_Swap(this->ThreadState);
1273 +// PyThreadState* prevThreadState = NULL;
1274 +// if (this->ThreadState)
1276 +// prevThreadState = PyThreadState_Swap(this->ThreadState);
1279 PyObject * obj2 = NULL;
1280 if (ptr && ptr->GetReferenceCount() > 0)
1281 @@ -237,10 +241,10 @@
1284 // If we did the swap near the top of this function then swap back now.
1285 - if (this->ThreadState)
1287 - PyThreadState_Swap(prevThreadState);
1289 +// if (this->ThreadState)
1291 +// PyThreadState_Swap(prevThreadState);
1294 #ifndef VTK_NO_PYTHON_THREADS
1295 #if (PY_MAJOR_VERSION > 2) || \
1296 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/VTK/Wrapping/PythonCore/vtkSmartPyObject.cxx ParaView-4.2.0_SRC.new/VTK/Wrapping/PythonCore/vtkSmartPyObject.cxx
1297 --- ParaView-4.2.0_SRC/VTK/Wrapping/PythonCore/vtkSmartPyObject.cxx 2014-09-23 18:47:11.000000000 +0400
1298 +++ ParaView-4.2.0_SRC.new/VTK/Wrapping/PythonCore/vtkSmartPyObject.cxx 2014-12-19 15:39:41.000000000 +0300
1300 vtkSmartPyObject::vtkSmartPyObject(const vtkSmartPyObject &other) :
1301 Object(other.Object)
1304 Py_XINCREF(this->Object);
1305 + VTK_PY_GIL_RELEASE
1308 //--------------------------------------------------------------------
1309 vtkSmartPyObject::~vtkSmartPyObject()
1311 - Py_XDECREF(this->Object);
1312 + if (Py_IsInitialized())
1315 + Py_XDECREF(this->Object);
1316 + VTK_PY_GIL_RELEASE
1319 + Py_XDECREF(this->Object);
1322 //--------------------------------------------------------------------
1323 vtkSmartPyObject &vtkSmartPyObject::operator=(const vtkSmartPyObject &other)
1326 Py_XDECREF(this->Object);
1327 this->Object = other.Object;
1328 Py_XINCREF(this->Object);
1329 + VTK_PY_GIL_RELEASE
1333 //--------------------------------------------------------------------
1334 vtkSmartPyObject &vtkSmartPyObject::operator=(PyObject *obj)
1337 Py_XDECREF(this->Object);
1339 Py_XINCREF(this->Object);
1340 + VTK_PY_GIL_RELEASE
1344 //--------------------------------------------------------------------
1345 void vtkSmartPyObject::TakeReference(PyObject *obj)
1348 Py_XDECREF(this->Object);
1349 + VTK_PY_GIL_RELEASE
1354 //--------------------------------------------------------------------
1355 PyObject *vtkSmartPyObject::GetAndIncreaseReferenceCount()
1358 Py_XINCREF(this->Object);
1359 + VTK_PY_GIL_RELEASE
1360 return this->Object;
1362 diff -Naur --exclude=CVS --exclude=.git ParaView-4.2.0_SRC/Wrapping/Python/paraview/servermanager.py ParaView-4.2.0_SRC.new/Wrapping/Python/paraview/servermanager.py
1363 --- ParaView-4.2.0_SRC/Wrapping/Python/paraview/servermanager.py 2014-09-23 18:46:44.000000000 +0400
1364 +++ ParaView-4.2.0_SRC.new/Wrapping/Python/paraview/servermanager.py 2014-12-19 15:39:41.000000000 +0300
1365 @@ -1092,7 +1092,7 @@
1366 property = self.SMProperty
1367 nElems = property.GetNumberOfElements()
1369 - raise ValueError, "The SMProperty with XML label '%s' has a size that is not a multiple of 2." % property.GetXMLLabel()
1372 for i in range(0, nElems, 2):
1373 if self.GetElement(i+1) != '0':