Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F24563424
cad_freecad.diff
thierry (Thierry Thomas)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
thierry
Jun 30 2021, 6:25 PM
2021-06-30 18:25:22 (UTC+0)
Size
45 KB
Referenced Files
None
Subscribers
None
cad_freecad.diff
View Options
commit 4cc7ff26665c0dab47eb9b76d2b45cbef4a653d6
Author: Thierry Thomas <thierry@FreeBSD.org>
Date: Wed Jun 30 20:16:24 2021 +0200
cad/freecad: fix againt VTK-9
Patches from hobbes1069 (Fedora) from
https://forum.freecadweb.org/memberlist.php?mode=viewprofile&u=725
diff --git a/cad/freecad/Makefile b/cad/freecad/Makefile
index c173b88dde18..3e5a7ddebf07 100644
--- a/cad/freecad/Makefile
+++ b/cad/freecad/Makefile
@@ -22,7 +22,7 @@ LIB_DEPENDS= libexpat.so:textproc/expat2 \
libCoin.so:graphics/Coin \
libpng.so:graphics/png \
libtiff.so:graphics/tiff \
- libvtkFiltersTexture-8.2.so:math/vtk8 \
+ libvtksys-${VTKVER}.so:math/vtk${VTKVER:R} \
libTKernel.so:cad/opencascade \
libxerces-c.so:textproc/xerces-c3 \
libboost_thread.so:devel/boost-libs \
@@ -34,7 +34,7 @@ LIB_DEPENDS= libexpat.so:textproc/expat2 \
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pivy>0:graphics/py-pivy@${PY_FLAVOR} \
${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR}
-USES= dos2unix compiler:c++11-lib cmake gl eigen:3 fortran jpeg \
+USES= dos2unix compiler:c++17-lang cmake gl eigen:3 fortran jpeg \
localbase:ldflags pkgconfig python:3.7+ localbase qt:5 xorg
USE_GITHUB= yes
USE_XORG= ice sm x11 xext xt
@@ -43,11 +43,14 @@ USE_QT= buildtools concurrent core gui network opengl printsupport \
qmake_build svg webkit widgets xml xmlpatterns
USE_LDCONFIG= yes
+VTKVER= 9.0
+
DOS2UNIX_GLOB= *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL
CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
-DOPENMPI_INCLUDE_DIRS="${LOCALBASE}/mpi/openmpi/include" \
-DBUILD_QT5="ON" \
+ -DBUILD_FEM_VTK="ON" \
-DPYTHON_LIBRARY="${PYTHONBASE}/lib/libpython${PYTHON_VER}${PYTHON_ABIVER}.so" \
-DPYTHON_INCLUDE_DIR="${PYTHON_INCLUDEDIR}" \
-DPYTHON_PACKAGES_PATH="${PYTHON_SITELIBDIR}" \
@@ -55,7 +58,7 @@ CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
-DBUILD_ASSEMBLY="OFF" -DBUILD_FLAT_MESH="ON" \
-DPYSIDE2RCCBINARY="${LOCALBASE}/bin/rcc" \
-DPYSIDE2UICBINARY="${LOCALBASE}/bin/uic" \
- -DVTK_DIR:PATH=${LOCALBASE}/lib/vtk-8.2/cmake/vtk-8.2
+ -DVTK_DIR:PATH=${LOCALBASE}/include/vtk-${VTKVER}
CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME}
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMDS__MeshElement.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMDS__MeshElement.hxx
new file mode 100644
index 000000000000..58e07f4f1ea9
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMDS__MeshElement.hxx
@@ -0,0 +1,29 @@
+--- src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx.orig 2021-04-15 09:17:08 UTC
++++ src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx
+@@ -40,11 +40,16 @@
+
+ #include <vtkType.h>
+ #include <vtkCellType.h>
++#include <vtkCellArray.h>
+
+ //typedef unsigned short UShortType;
+ typedef short ShortType;
+ typedef int LongType;
+-
++#ifdef VTK_CELL_ARRAY_V2
++typedef const vtkIdType* vtkIdTypePtr;
++#else
++typedef vtkIdType* vtkIdTypePtr;
++#endif
+ class SMDS_MeshNode;
+ class SMDS_MeshEdge;
+ class SMDS_MeshFace;
+@@ -192,7 +197,7 @@ class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObj
+ //! Element index in vector SMDS_Mesh::myNodes or SMDS_Mesh::myCells
+ int myID;
+ //! index in vtkUnstructuredGrid
+- int myVtkID;
++ vtkIdType myVtkID;
+ //! SMDS_Mesh identification in SMESH
+ ShortType myMeshId;
+ //! SubShape and SubMesh identification in SMESHDS
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMDS__UnstructuredGrid.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMDS__UnstructuredGrid.hxx
new file mode 100644
index 000000000000..4cfdbe2a0196
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMDS__UnstructuredGrid.hxx
@@ -0,0 +1,14 @@
+--- src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx.orig 2021-04-15 09:17:08 UTC
++++ src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
+@@ -95,7 +95,11 @@ class SMDS_EXPORT SMDS_UnstructuredGrid: public vtkUns
+ std::map<int, std::map<long,int> >& nodeQuadDomains);
+ vtkCellLinks* GetLinks()
+ {
++#ifdef VTK_CELL_ARRAY_V2
++ return static_cast<vtkCellLinks*>(GetCellLinks());
++#else
+ return Links;
++#endif
+ }
+ SMDS_Downward* getDownArray(unsigned char vtkType)
+ {
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__BallElement.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__BallElement.cpp
new file mode 100644
index 000000000000..13d6e02ef3a6
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__BallElement.cpp
@@ -0,0 +1,29 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
+@@ -67,10 +67,16 @@ void SMDS_BallElement::SetDiameter(double diameter)
+ bool SMDS_BallElement::ChangeNode (const SMDS_MeshNode * node)
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++ cellPoints->SetId(0, node->getVtkId());
++#else
+ vtkIdType npts = 0;
+ vtkIdType* pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+ pts[0] = node->getVtkId();
++#endif
+ SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ return true;
+ }
+@@ -83,7 +89,8 @@ void SMDS_BallElement::Print (std::ostream & OS) const
+ const SMDS_MeshNode* SMDS_BallElement::GetNode (const int ind) const
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( myVtkID, npts, pts );
+ return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ 0 ]);
+ }
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Downward.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Downward.cpp
new file mode 100644
index 000000000000..fef34e6df8b2
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Downward.cpp
@@ -0,0 +1,200 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
+@@ -303,7 +303,7 @@ int SMDS_Down1D::getNodeSet(int cellId, int* nodeSet)
+ void SMDS_Down1D::setNodes(int cellId, int vtkId)
+ {
+ vtkIdType npts = 0;
+- vtkIdType *pts; // will refer to the point id's of the face
++ vtkIdTypePtr pts; // will refer to the point id's of the face
+ _grid->GetCellPoints(vtkId, npts, pts);
+ // MESSAGE(vtkId << " " << npts << " " << _nbDownCells);
+ //ASSERT(npts == _nbDownCells);
+@@ -357,7 +357,7 @@ int SMDS_Down1D::computeVtkCells(int *pts, std::vector
+ {
+ vtkIdType point = pts[i];
+ int numCells = _grid->GetLinks()->GetNcells(point);
+- vtkIdType *cells = _grid->GetLinks()->GetCells(point);
++ vtkIdTypePtr cells = _grid->GetLinks()->GetCells(point);
+ for (int j = 0; j < numCells; j++)
+ {
+ int vtkCellId = cells[j];
+@@ -532,7 +532,7 @@ int SMDS_Down2D::computeVolumeIds(int cellId, int* ids
+ // --- find point id's of the face
+
+ vtkIdType npts = 0;
+- vtkIdType *pts; // will refer to the point id's of the face
++ vtkIdTypePtr pts; // will refer to the point id's of the face
+ _grid->GetCellPoints(cellId, npts, pts);
+ vector<int> nodes;
+ for (int i = 0; i < npts; i++)
+@@ -577,7 +577,7 @@ int SMDS_Down2D::computeVolumeIdsFromNodesFace(int* pt
+ vtkIdType point = pts[i];
+ int numCells = _grid->GetLinks()->GetNcells(point);
+ //MESSAGE("cells pour " << i << " " << numCells);
+- vtkIdType *cells = _grid->GetLinks()->GetCells(point);
++ vtkIdTypePtr cells = _grid->GetLinks()->GetCells(point);
+ for (int j = 0; j < numCells; j++)
+ {
+ int vtkCellId = cells[j];
+@@ -627,7 +627,7 @@ int SMDS_Down2D::computeVolumeIdsFromNodesFace(int* pt
+ void SMDS_Down2D::setTempNodes(int cellId, int vtkId)
+ {
+ vtkIdType npts = 0;
+- vtkIdType *pts; // will refer to the point id's of the face
++ vtkIdTypePtr pts; // will refer to the point id's of the face
+ _grid->GetCellPoints(vtkId, npts, pts);
+ // MESSAGE(vtkId << " " << npts << " " << _nbNodes);
+ //ASSERT(npts == _nbNodes);
+@@ -795,7 +795,7 @@ void SMDS_Down3D::getNodeIds(int cellId, std::set<int>
+ {
+ int vtkId = this->_vtkCellIds[cellId];
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(vtkId, npts, nodes);
+ for (int i = 0; i < npts; i++)
+ nodeSet.insert(nodes[i]);
+@@ -1126,7 +1126,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId,
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -1178,7 +1178,7 @@ void SMDS_DownTetra::computeFacesWithNodes(int cellId,
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -1234,7 +1234,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cel
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -1288,7 +1288,7 @@ void SMDS_DownQuadTetra::computeFacesWithNodes(int cel
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -1357,7 +1357,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellI
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -1435,7 +1435,7 @@ void SMDS_DownPyramid::computeFacesWithNodes(int cellI
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -1500,7 +1500,7 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int c
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -1580,7 +1580,7 @@ void SMDS_DownQuadPyramid::computeFacesWithNodes(int c
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -1660,7 +1660,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId,
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -1744,7 +1744,7 @@ void SMDS_DownPenta::computeFacesWithNodes(int cellId,
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -1810,7 +1810,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cel
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -1896,7 +1896,7 @@ void SMDS_DownQuadPenta::computeFacesWithNodes(int cel
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -1981,7 +1981,7 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId,
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -2036,7 +2036,7 @@ void SMDS_DownHexa::computeFacesWithNodes(int cellId,
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
+@@ -2112,7 +2112,7 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cell
+ //MESSAGE("cellId = " << cellId);
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
+
+ set<int> tofind;
+@@ -2167,7 +2167,7 @@ void SMDS_DownQuadHexa::computeFacesWithNodes(int cell
+ // --- find point id's of the volume
+
+ vtkIdType npts = 0;
+- vtkIdType *nodes; // will refer to the point id's of the volume
++ vtkIdTypePtr nodes; // will refer to the point id's of the volume
+ _grid->GetCellPoints(cellId, npts, nodes);
+
+ // --- create all the ordered list of node id's for each face
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp
index ca0fbdbc6a03..b61ae212200d 100644
--- a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp
@@ -1,11 +1,15 @@
---- src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp.orig 2016-09-07 14:39:54 UTC
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp.orig 2021-06-30 17:16:30 UTC
+++ src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
-@@ -57,7 +57,7 @@
- using namespace std;
-
- #ifndef WIN32
--#if !(defined(__MACH__) && defined(__APPLE__))
-+#ifdef __linux__
- #include <sys/sysinfo.h>
- #endif
- #include <sys/wait.h>
+@@ -4768,7 +4768,11 @@ void SMDS_Mesh::dumpGrid(string ficdump)
+ ficcon << endl;
+ }
+ ficcon << "-------------------------------- connectivity " << nbPoints << endl;
+- vtkCellLinks *links = myGrid->GetCellLinks();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkCellLinks *links = static_cast<vtkCellLinks*>(myGrid->GetCellLinks());
++#else
++ vtkCellLinks *links = myGrid->GetCellLinks();
++#endif
+ for (int i=0; i<nbPoints; i++)
+ {
+ int ncells = links->GetNcells(i);
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh0DElement.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh0DElement.cpp
new file mode 100644
index 000000000000..5cd8ec8ed2e0
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh0DElement.cpp
@@ -0,0 +1,28 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
+@@ -146,6 +146,17 @@ bool SMDS_Mesh0DElement::ChangeNodes(const SMDS_MeshNo
+ if ( nbNodes == 1 )
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++ if (nbNodes != cellPoints->GetNumberOfIds())
++ {
++ MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++ return false;
++ }
++ myNode = nodes[0];
++ cellPoints->SetId(0, myNode->getVtkId());
++#else
+ vtkIdType npts = 0;
+ vtkIdType* pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+@@ -156,6 +167,7 @@ bool SMDS_Mesh0DElement::ChangeNodes(const SMDS_MeshNo
+ }
+ myNode = nodes[0];
+ pts[0] = myNode->getVtkId();
++#endif
+
+ SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ return true;
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__MeshNode.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__MeshNode.cpp
new file mode 100644
index 000000000000..e56acd60a3ef
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__MeshNode.cpp
@@ -0,0 +1,47 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
+@@ -191,7 +191,7 @@ class SMDS_MeshNode_MyInvIterator: public SMDS_ElemIte
+ SMDS_ElemIteratorPtr SMDS_MeshNode::
+ GetInverseElementIterator(SMDSAbs_ElementType type) const
+ {
+- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++ vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+ //MESSAGE("myID " << myID << " ncells " << l.ncells);
+ return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
+ }
+@@ -251,7 +251,7 @@ elementsIterator(SMDSAbs_ElementType type) const
+ return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
+ else
+ {
+- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++ vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+ return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
+ }
+ }
+@@ -350,7 +350,7 @@ void SMDS_MeshNode::AddInverseElement(const SMDS_MeshE
+ const SMDS_MeshCell *cell = dynamic_cast<const SMDS_MeshCell*> (ME);
+ assert(cell);
+ SMDS_UnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+- vtkCellLinks *Links = grid->GetCellLinks();
++ vtkCellLinks *Links = static_cast<vtkCellLinks*>(grid->GetCellLinks());
+ Links->ResizeCellList(myVtkID, 1);
+ Links->AddCellReference(cell->getVtkId(), myVtkID);
+ }
+@@ -366,7 +366,7 @@ void SMDS_MeshNode::ClearInverseElements()
+
+ bool SMDS_MeshNode::emptyInverseElements()
+ {
+- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++ vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+ return (l.ncells == 0);
+ }
+
+@@ -378,7 +378,7 @@ bool SMDS_MeshNode::emptyInverseElements()
+
+ int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const
+ {
+- vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID);
++ vtkCellLinks::Link l = static_cast<vtkCellLinks*>(SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks())->GetLink(myVtkID);
+
+ if ( type == SMDSAbs_All )
+ return l.ncells;
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp
new file mode 100644
index 000000000000..308a393f10c9
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__UnstructuredGrid.cpp
@@ -0,0 +1,79 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
+@@ -139,8 +139,8 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int ty
+ for (; it != setOfNodes.end(); ++it)
+ {
+ //MESSAGE("reverse link for node " << *it << " cell " << cellid);
+- this->Links->ResizeCellList(*it, 1);
+- this->Links->AddCellReference(cellid, *it);
++ this->GetLinks()->ResizeCellList(*it, 1);
++ this->GetLinks()->AddCellReference(cellid, *it);
+ }
+
+ return cellid;
+@@ -332,9 +332,13 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharAr
+ {
+ newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
+ idCellsOldToNew[j] = alreadyCopied; // old vtkId --> new vtkId
++#ifdef VTK_CELL_ARRAY_V2
++ vtkIdType oldLoc = this->GetCellLocationsArray()->GetValue(j);
++#else
+ vtkIdType oldLoc = this->Locations->GetValue(j);
++#endif
+ vtkIdType nbpts;
+- vtkIdType *oldPtsCell = 0;
++ vtkIdTypePtr oldPtsCell = 0;
+ this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
+ assert(nbpts < NBMAXNODESINCELL);
+ //MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
+@@ -952,6 +956,21 @@ void SMDS_UnstructuredGrid::GetNodeIds(std::set<int>&
+ */
+ void SMDS_UnstructuredGrid::ModifyCellNodes(int vtkVolId, std::map<int, int> localClonedNodeIds)
+ {
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ this->GetCellPoints(vtkVolId, cellPoints.GetPointer());
++ for (vtkIdType i = 0; i < cellPoints->GetNumberOfIds(); i++)
++ {
++ if (localClonedNodeIds.count(cellPoints->GetId(i)))
++ {
++ vtkIdType oldpt = cellPoints->GetId(i);
++ cellPoints->SetId(i, localClonedNodeIds[oldpt]);
++ //MESSAGE(oldpt << " --> " << pts[i]);
++ //this->RemoveReferenceToCell(oldpt, vtkVolId);
++ //this->AddReferenceToCell(pts[i], vtkVolId);
++ }
++ }
++#else
+ vtkIdType npts = 0;
+ vtkIdType *pts; // will refer to the point id's of the face
+ this->GetCellPoints(vtkVolId, npts, pts);
+@@ -966,6 +985,7 @@ void SMDS_UnstructuredGrid::ModifyCellNodes(int vtkVol
+ //this->AddReferenceToCell(pts[i], vtkVolId);
+ }
+ }
++#endif
+ }
+
+ /*! reorder the nodes of a face
+@@ -995,11 +1015,20 @@ void SMDS_UnstructuredGrid::BuildLinks()
+ this->Links->UnRegister(this);
+ }
+
++#ifdef VTK_CELL_ARRAY_V2
+ this->Links = SMDS_CellLinks::New();
++ GetLinks()->Allocate(this->GetNumberOfPoints());
++ GetLinks()->Register(this);
++//FIXME: vtk9
++ GetLinks()->BuildLinks(this);
++ GetLinks()->Delete();
++#else
++ this->Links = SMDS_CellLinks::New();
+ this->Links->Allocate(this->GetNumberOfPoints());
+ this->Links->Register(this);
+ this->Links->BuildLinks(this, this->Connectivity);
+ this->Links->Delete();
++#endif
+ }
+
+ /*! Create a volume (prism or hexahedron) by duplication of a face.
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkCellIterator.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkCellIterator.cpp
new file mode 100644
index 000000000000..3adc8f4cf2f1
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkCellIterator.cpp
@@ -0,0 +1,30 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
+@@ -33,7 +33,8 @@ SMDS_VtkCellIterator::SMDS_VtkCellIterator(SMDS_Mesh*
+ }
+ else
+ {
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( _cellId, npts, pts );
+ _vtkIdList->SetNumberOfIds( _nbNodes = npts );
+ for (int i = 0; i < _nbNodes; i++)
+@@ -67,7 +68,7 @@ SMDS_VtkCellIteratorToUNV::SMDS_VtkCellIteratorToUNV(S
+ //MESSAGE("SMDS_VtkCellInterlacedIterator (UNV)" << _type);
+
+ _vtkIdList = vtkIdList::New();
+- vtkIdType* pts;
++ vtkIdTypePtr pts;
+ vtkIdType npts;
+ vtkUnstructuredGrid* grid = _mesh->getGrid();
+ grid->GetCellPoints((vtkIdType)_cellId, npts, pts);
+@@ -182,7 +183,7 @@ SMDS_VtkCellIteratorPolyH::SMDS_VtkCellIteratorPolyH(S
+ {
+ //MESSAGE("SMDS_VtkCellIterator Polyhedra");
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(_cellId, nFaces, ptIds);
+ int id = 0;
+ _nbNodesInFaces = 0;
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkEdge.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkEdge.cpp
new file mode 100644
index 000000000000..2d959a08b7a0
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkEdge.cpp
@@ -0,0 +1,49 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
+@@ -67,6 +67,19 @@ bool SMDS_VtkEdge::ChangeNodes(const SMDS_MeshNode * n
+ bool SMDS_VtkEdge::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++ if (nbNodes != cellPoints->GetNumberOfIds())
++ {
++ MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++ return false;
++ }
++ for (int i = 0; i < nbNodes; i++)
++ {
++ cellPoints->SetId(i, nodes[i]->getVtkId());
++ }
++#else
+ vtkIdType npts = 0;
+ vtkIdType* pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+@@ -79,6 +92,7 @@ bool SMDS_VtkEdge::ChangeNodes(const SMDS_MeshNode* no
+ {
+ pts[i] = nodes[i]->getVtkId();
+ }
++#endif
+ SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ return true;
+ }
+@@ -87,7 +101,7 @@ bool SMDS_VtkEdge::IsMediumNode(const SMDS_MeshNode* n
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+ vtkIdType npts = 0;
+- vtkIdType* pts = 0;
++ vtkIdTypePtr pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+ //MESSAGE("IsMediumNode " << npts << " " << (node->getVtkId() == pts[npts-1]));
+ return ((npts == 3) && (node->getVtkId() == pts[2]));
+@@ -137,7 +151,8 @@ const SMDS_MeshNode*
+ SMDS_VtkEdge::GetNode(const int ind) const
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( this->myVtkID, npts, pts );
+ return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]);
+ }
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkFace.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkFace.cpp
new file mode 100644
index 000000000000..68d54e18cbb6
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkFace.cpp
@@ -0,0 +1,78 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
+@@ -101,6 +101,19 @@ void SMDS_VtkFace::initQuadPoly(const std::vector<vtkI
+ bool SMDS_VtkFace::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++ if (nbNodes != cellPoints->GetNumberOfIds())
++ {
++ MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++ return false;
++ }
++ for (int i = 0; i < nbNodes; i++)
++ {
++ cellPoints->SetId(i, nodes[i]->getVtkId());
++ }
++#else
+ vtkIdType npts = 0;
+ vtkIdType* pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+@@ -113,6 +126,7 @@ bool SMDS_VtkFace::ChangeNodes(const SMDS_MeshNode* no
+ {
+ pts[i] = nodes[i]->getVtkId();
+ }
++#endif
+ SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ return true;
+ }
+@@ -173,7 +187,8 @@ const SMDS_MeshNode*
+ SMDS_VtkFace::GetNode(const int ind) const
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( this->myVtkID, npts, pts );
+ return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]);
+ }
+@@ -186,7 +201,8 @@ SMDS_VtkFace::GetNode(const int ind) const
+ int SMDS_VtkFace::GetNodeIndex( const SMDS_MeshNode* node ) const
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( this->myVtkID, npts, pts );
+ for ( vtkIdType i = 0; i < npts; ++i )
+ if ( pts[i] == node->getVtkId() )
+@@ -251,7 +267,7 @@ bool SMDS_VtkFace::IsMediumNode(const SMDS_MeshNode* n
+ return false;
+ }
+ vtkIdType npts = 0;
+- vtkIdType* pts = 0;
++ vtkIdTypePtr pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+ vtkIdType nodeId = node->getVtkId();
+ for (int rank = 0; rank < npts; rank++)
+@@ -356,11 +372,18 @@ SMDS_NodeIteratorPtr SMDS_VtkFace::interlacedNodesIter
+ void SMDS_VtkFace::ChangeApex(SMDS_MeshNode* node)
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++ grid->RemoveReferenceToCell(cellPoints->GetId(0), myVtkID);
++ cellPoints->SetId(0, node->getVtkId());
++#else
+ vtkIdType npts = 0;
+ vtkIdType* pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+ grid->RemoveReferenceToCell(pts[0], myVtkID);
+ pts[0] = node->getVtkId();
++#endif
+ node->AddInverseElement(this),
+ SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ }
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkVolume.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkVolume.cpp
new file mode 100644
index 000000000000..113a7375ae28
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__VtkVolume.cpp
@@ -0,0 +1,131 @@
+--- src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
+@@ -133,6 +133,19 @@ void SMDS_VtkVolume::initPoly(const std::vector<vtkIdT
+ bool SMDS_VtkVolume::ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
+ {
+ vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid();
++#ifdef VTK_CELL_ARRAY_V2
++ vtkNew<vtkIdList> cellPoints;
++ grid->GetCellPoints(myVtkID, cellPoints.GetPointer());
++ if (nbNodes != cellPoints->GetNumberOfIds())
++ {
++ MESSAGE("ChangeNodes problem: not the same number of nodes " << cellPoints->GetNumberOfIds() << " -> " << nbNodes);
++ return false;
++ }
++ for (int i = 0; i < nbNodes; i++)
++ {
++ cellPoints->SetId(i, nodes[i]->getVtkId());
++ }
++#else
+ vtkIdType npts = 0;
+ vtkIdType* pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+@@ -145,6 +158,7 @@ bool SMDS_VtkVolume::ChangeNodes(const SMDS_MeshNode*
+ {
+ pts[i] = nodes[i]->getVtkId();
+ }
++#endif
+ SMDS_Mesh::_meshList[myMeshId]->setMyModified();
+ return true;
+ }
+@@ -207,7 +221,7 @@ int SMDS_VtkVolume::NbFaces() const
+ case VTK_POLYHEDRON:
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ nbFaces = nFaces;
+ break;
+@@ -236,7 +250,7 @@ int SMDS_VtkVolume::NbNodes() const
+ else
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ int id = 0;
+ for (int i = 0; i < nFaces; i++)
+@@ -276,7 +290,7 @@ int SMDS_VtkVolume::NbEdges() const
+ case VTK_POLYHEDRON:
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ nbEdges = 0;
+ int id = 0;
+@@ -312,7 +326,7 @@ int SMDS_VtkVolume::NbFaceNodes(const int face_ind) co
+ if (aVtkType == VTK_POLYHEDRON)
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ int id = 0;
+ for (int i = 0; i < nFaces; i++)
+@@ -342,7 +356,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetFaceNode(const
+ if (aVtkType == VTK_POLYHEDRON)
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ int id = 0;
+ for (int i = 0; i < nFaces; i++)
+@@ -372,7 +386,7 @@ std::vector<int> SMDS_VtkVolume::GetQuantities() const
+ if (aVtkType == VTK_POLYHEDRON)
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ int id = 0;
+ for (int i = 0; i < nFaces; i++)
+@@ -430,7 +444,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetNode(const int
+ if ( aVtkType == VTK_POLYHEDRON)
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ int id = 0, nbPoints = 0;
+ for (int i = 0; i < nFaces; i++)
+@@ -443,7 +457,8 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetNode(const int
+ }
+ return 0;
+ }
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( this->myVtkID, npts, pts );
+ const std::vector<int>& interlace = SMDS_MeshCell::fromVtkOrder( VTKCellType( aVtkType ));
+ return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ interlace.empty() ? ind : interlace[ind]] );
+@@ -460,7 +475,7 @@ int SMDS_VtkVolume::GetNodeIndex( const SMDS_MeshNode*
+ if ( aVtkType == VTK_POLYHEDRON)
+ {
+ vtkIdType nFaces = 0;
+- vtkIdType* ptIds = 0;
++ vtkIdTypePtr ptIds = 0;
+ grid->GetFaceStream(this->myVtkID, nFaces, ptIds);
+ int id = 0;
+ for (int iF = 0; iF < nFaces; iF++)
+@@ -473,7 +488,8 @@ int SMDS_VtkVolume::GetNodeIndex( const SMDS_MeshNode*
+ }
+ return -1;
+ }
+- vtkIdType npts, *pts;
++ vtkIdType npts;
++ vtkIdTypePtr pts;
+ grid->GetCellPoints( this->myVtkID, npts, pts );
+ for ( vtkIdType i = 0; i < npts; ++i )
+ if ( pts[i] == node->getVtkId() )
+@@ -534,7 +550,7 @@ bool SMDS_VtkVolume::IsMediumNode(const SMDS_MeshNode*
+ return false;
+ }
+ vtkIdType npts = 0;
+- vtkIdType* pts = 0;
++ vtkIdTypePtr pts = 0;
+ grid->GetCellPoints(myVtkID, npts, pts);
+ vtkIdType nodeId = node->getVtkId();
+ for (int rank = 0; rank < npts; rank++)
diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MeshEditor.cpp b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MeshEditor.cpp
new file mode 100644
index 000000000000..f7f9a1504ecb
--- /dev/null
+++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMESH_SMESH__MeshEditor.cpp
@@ -0,0 +1,38 @@
+--- src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp.orig 2021-06-30 17:16:26 UTC
++++ src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
+@@ -11348,7 +11348,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( c
+ {
+ int oldId = *itn;
+ //MESSAGE(" node " << oldId);
+- vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
++ vtkCellLinks::Link l = static_cast<vtkCellLinks*>(grid->GetCellLinks())->GetLink(oldId);
+ for (int i=0; i<l.ncells; i++)
+ {
+ int vtkId = l.cells[i];
+@@ -11527,7 +11527,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( c
+ //MESSAGE(" domain " << idom << " volume " << elem->GetID());
+ double values[3];
+ vtkIdType npts = 0;
+- vtkIdType* pts = 0;
++ vtkIdTypePtr pts = 0;
+ grid->GetCellPoints(vtkVolIds[ivol], npts, pts);
+ SMDS_VtkVolume::gravityCenter(grid, pts, npts, values);
+ if (id ==0)
+@@ -11708,7 +11708,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( c
+ {
+ int oldId = itnod->first;
+ //MESSAGE(" node " << oldId);
+- vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
++ vtkCellLinks::Link l = static_cast<vtkCellLinks*>(grid->GetCellLinks())->GetLink(oldId);
+ for (int i = 0; i < l.ncells; i++)
+ {
+ int vtkId = l.cells[i];
+@@ -12165,7 +12165,7 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
+ MESSAGE("volume to check, vtkId " << vtkId << " smdsId " << meshDS->fromVtkToSmds(vtkId));
+ bool volInside = false;
+ vtkIdType npts = 0;
+- vtkIdType* pts = 0;
++ vtkIdTypePtr pts = 0;
+ grid->GetCellPoints(vtkId, npts, pts);
+ for (int i=0; i<npts; i++)
+ {
diff --git a/cad/freecad/files/patch-src_Mod_Fem_Gui_ViewProviderFemPostObject.cpp b/cad/freecad/files/patch-src_Mod_Fem_Gui_ViewProviderFemPostObject.cpp
new file mode 100644
index 000000000000..ad2e5897c6e7
--- /dev/null
+++ b/cad/freecad/files/patch-src_Mod_Fem_Gui_ViewProviderFemPostObject.cpp
@@ -0,0 +1,10 @@
+--- src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp.orig 2021-06-30 17:16:27 UTC
++++ src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
+@@ -20,7 +20,6 @@
+ * *
+ ***************************************************************************/
+
+-
+ #include "PreCompiled.h"
+
+ #ifndef _PreComp_
diff --git a/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp b/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp
index f03a01f1e4e1..73453f1e29b7 100644
--- a/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp
+++ b/cad/freecad/files/patch-src_Mod_Part_App_Geometry2d.cpp
@@ -1,6 +1,6 @@
---- src/Mod/Part/App/Geometry2d.cpp.orig 2019-10-04 10:33:33 UTC
+--- src/Mod/Part/App/Geometry2d.cpp.orig 2021-06-30 17:16:27 UTC
+++ src/Mod/Part/App/Geometry2d.cpp
-@@ -183,7 +183,7 @@ void Geom2dPoint::Save(Base::Writer &writer) const
+@@ -184,7 +184,7 @@ void Geom2dPoint::Save(Base::Writer &writer) const
<< "<Geom2dPoint "
<< "X=\"" << Point.x << "\" "
<< "Y=\"" << Point.y << "\" "
@@ -9,7 +9,7 @@
}
void Geom2dPoint::Restore(Base::XMLReader &reader)
-@@ -875,7 +875,7 @@ void Geom2dCircle::Save(Base::Writer& writer) const
+@@ -876,7 +876,7 @@ void Geom2dCircle::Save(Base::Writer& writer) const
SaveAxis(writer, axis);
writer.Stream()
<< "Radius=\"" << c.Radius() << "\" "
@@ -18,7 +18,7 @@
}
void Geom2dCircle::Restore(Base::XMLReader& reader)
-@@ -990,7 +990,7 @@ void Geom2dArcOfCircle::Save(Base::Writer &writer) con
+@@ -991,7 +991,7 @@ void Geom2dArcOfCircle::Save(Base::Writer &writer) con
SaveAxis(writer, axis, u, v);
writer.Stream()
<< "Radius=\"" << c.Radius() << "\" "
@@ -27,7 +27,7 @@
}
void Geom2dArcOfCircle::Restore(Base::XMLReader &reader)
-@@ -1152,7 +1152,7 @@ void Geom2dEllipse::Save(Base::Writer& writer) const
+@@ -1153,7 +1153,7 @@ void Geom2dEllipse::Save(Base::Writer& writer) const
writer.Stream()
<< "MajorRadius=\"" << e.MajorRadius() << "\" "
<< "MinorRadius=\"" << e.MinorRadius() << "\" "
@@ -36,7 +36,7 @@
}
void Geom2dEllipse::Restore(Base::XMLReader& reader)
-@@ -1329,7 +1329,7 @@ void Geom2dArcOfEllipse::Save(Base::Writer &writer) co
+@@ -1330,7 +1330,7 @@ void Geom2dArcOfEllipse::Save(Base::Writer &writer) co
writer.Stream()
<< "MajorRadius=\"" << e.MajorRadius() << "\" "
<< "MinorRadius=\"" << e.MinorRadius() << "\" "
@@ -45,7 +45,7 @@
}
void Geom2dArcOfEllipse::Restore(Base::XMLReader &reader)
-@@ -1458,7 +1458,7 @@ void Geom2dHyperbola::Save(Base::Writer& writer) const
+@@ -1459,7 +1459,7 @@ void Geom2dHyperbola::Save(Base::Writer& writer) const
writer.Stream()
<< "MajorRadius=\"" << h.MajorRadius() << "\" "
<< "MinorRadius=\"" << h.MinorRadius() << "\" "
@@ -54,7 +54,7 @@
}
void Geom2dHyperbola::Restore(Base::XMLReader& reader)
-@@ -1591,7 +1591,7 @@ void Geom2dArcOfHyperbola::Save(Base::Writer &writer)
+@@ -1592,7 +1592,7 @@ void Geom2dArcOfHyperbola::Save(Base::Writer &writer)
writer.Stream()
<< "MajorRadius=\"" << h.MajorRadius() << "\" "
<< "MinorRadius=\"" << h.MinorRadius() << "\" "
@@ -63,7 +63,7 @@
}
void Geom2dArcOfHyperbola::Restore(Base::XMLReader &reader)
-@@ -1702,7 +1702,7 @@ void Geom2dParabola::Save(Base::Writer& writer) const
+@@ -1703,7 +1703,7 @@ void Geom2dParabola::Save(Base::Writer& writer) const
SaveAxis(writer, axis);
writer.Stream()
<< "Focal=\"" << focal << "\" "
@@ -72,7 +72,7 @@
}
void Geom2dParabola::Restore(Base::XMLReader& reader)
-@@ -1815,7 +1815,7 @@ void Geom2dArcOfParabola::Save(Base::Writer &writer) c
+@@ -1816,7 +1816,7 @@ void Geom2dArcOfParabola::Save(Base::Writer &writer) c
SaveAxis(writer, axis, u, v);
writer.Stream()
<< "Focal=\"" << focal << "\" "
@@ -81,7 +81,7 @@
}
void Geom2dArcOfParabola::Restore(Base::XMLReader &reader)
-@@ -1930,7 +1930,7 @@ void Geom2dLine::Save(Base::Writer &writer) const
+@@ -1931,7 +1931,7 @@ void Geom2dLine::Save(Base::Writer &writer) const
<< "PosY=\"" << Pos.y << "\" "
<< "DirX=\"" << Dir.x << "\" "
<< "DirY=\"" << Dir.y << "\" "
@@ -90,7 +90,7 @@
}
void Geom2dLine::Restore(Base::XMLReader &reader)
-@@ -2064,7 +2064,7 @@ void Geom2dLineSegment::Save(Base::Writer &writer) con
+@@ -2065,7 +2065,7 @@ void Geom2dLineSegment::Save(Base::Writer &writer) con
<< "StartY=\"" << Start.y << "\" "
<< "EndX=\"" << End.x << "\" "
<< "EndY=\"" << End.y << "\" "
diff --git a/cad/freecad/files/patch-src_Mod_Raytracing_App_AppRaytracingPy.cpp b/cad/freecad/files/patch-src_Mod_Raytracing_App_AppRaytracingPy.cpp
index b2b35586f377..d6da4229fca9 100644
--- a/cad/freecad/files/patch-src_Mod_Raytracing_App_AppRaytracingPy.cpp
+++ b/cad/freecad/files/patch-src_Mod_Raytracing_App_AppRaytracingPy.cpp
@@ -1,6 +1,6 @@
---- src/Mod/Raytracing/App/AppRaytracingPy.cpp.orig 2019-10-04 10:44:17 UTC
+--- src/Mod/Raytracing/App/AppRaytracingPy.cpp.orig 2021-06-30 17:16:28 UTC
+++ src/Mod/Raytracing/App/AppRaytracingPy.cpp
-@@ -105,13 +105,13 @@ class Module : public Py::ExtensionModule<Module> (pri
+@@ -107,13 +107,13 @@ class Module : public Py::ExtensionModule<Module> (pri
PovTools::writeShape(out,PartName,aShape,(float)0.1);
// This must not be done in PovTools::writeShape!
@@ -21,7 +21,7 @@
return Py::String(out.str());
}
Py::Object getPartAsLux(const Py::Tuple& args)
-@@ -128,10 +128,10 @@ class Module : public Py::ExtensionModule<Module> (pri
+@@ -130,10 +130,10 @@ class Module : public Py::ExtensionModule<Module> (pri
// write a material entry
// This must not be done in PovTools::writeShape!
diff --git a/cad/freecad/files/patch-src_Mod_Raytracing_App_LuxFeature.cpp b/cad/freecad/files/patch-src_Mod_Raytracing_App_LuxFeature.cpp
index 96118c364569..facdb9351c4d 100644
--- a/cad/freecad/files/patch-src_Mod_Raytracing_App_LuxFeature.cpp
+++ b/cad/freecad/files/patch-src_Mod_Raytracing_App_LuxFeature.cpp
@@ -1,6 +1,6 @@
---- src/Mod/Raytracing/App/LuxFeature.cpp.orig 2019-10-04 10:45:53 UTC
+--- src/Mod/Raytracing/App/LuxFeature.cpp.orig 2021-06-30 17:16:28 UTC
+++ src/Mod/Raytracing/App/LuxFeature.cpp
-@@ -88,23 +88,23 @@ App::DocumentObjectExecReturn *LuxFeature::execute(voi
+@@ -89,23 +89,23 @@ App::DocumentObjectExecReturn *LuxFeature::execute(voi
const App::Color& c = Color.getValue();
long t = Transparency.getValue();
if (t == 0) {
diff --git a/cad/freecad/files/patch-src_Mod_Raytracing_App_RayFeature.cpp b/cad/freecad/files/patch-src_Mod_Raytracing_App_RayFeature.cpp
index 92c0f65afdfe..fa94f6b9ae86 100644
--- a/cad/freecad/files/patch-src_Mod_Raytracing_App_RayFeature.cpp
+++ b/cad/freecad/files/patch-src_Mod_Raytracing_App_RayFeature.cpp
@@ -1,6 +1,6 @@
---- src/Mod/Raytracing/App/RayFeature.cpp.orig 2019-10-04 10:45:11 UTC
+--- src/Mod/Raytracing/App/RayFeature.cpp.orig 2021-06-30 17:16:28 UTC
+++ src/Mod/Raytracing/App/RayFeature.cpp
-@@ -81,19 +81,19 @@ App::DocumentObjectExecReturn *RayFeature::execute(voi
+@@ -82,19 +82,19 @@ App::DocumentObjectExecReturn *RayFeature::execute(voi
// This must not be done in PovTools::writeShape!
long t = Transparency.getValue();
const App::Color& c = Color.getValue();
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3886555
Default Alt Text
cad_freecad.diff (45 KB)
Attached To
Mode
D30934: cad/opencascade: switch to VTK-9
Attached
Detach File
Event Timeline
Log In to Comment