testing/freecad: upgrade to 0.20

This commit is contained in:
Aiden Grossman 2022-07-24 06:46:25 +00:00 committed by alice
parent bc9fb53a49
commit f3c9cdcc2e
6 changed files with 13 additions and 4703 deletions

View File

@ -1,8 +1,8 @@
# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=freecad
pkgver=0.19.4
pkgrel=2
pkgver=0.20
pkgrel=0
pkgdesc="Free and open source 3D parametric modeler"
url="https://freecadweb.org/"
license="LGPL-2.0-or-later"
@ -18,10 +18,7 @@ makedepends="
"
checkdepends="xvfb-run mesa mesa-dri-gallium ttf-opensans"
source="https://github.com/FreeCAD/FreeCAD/archive/$pkgver/freecad-$pkgver.tar.gz
vtk9.patch
backtrace.patch
resourceDirectory.patch
opencascade76.patch
tests.patch
"
builddir="$srcdir/FreeCAD-$pkgver"
@ -35,7 +32,7 @@ build() {
-DCMAKE_INSTALL_DATADIR=/usr/share/freecad \
-DCMAKE_INSTALL_DATAROOTDIR=/usr/share \
-DCMAKE_INSTALL_DOCDIR=/usr/share/freecad/doc \
-DBUILD_ENABLE_CXX_STD=C++14 \
-DBUILD_ENABLE_CXX_STD=C++17 \
-DBUILD_QT5=ON \
-DFREECAD_USE_EXTERNAL_PIVY=ON \
-DFREECAD_USE_OCC_VARIANT="Official Version" \
@ -64,10 +61,7 @@ package() {
}
sha512sums="
58e5e6bb4ed40ce7f3a0b653cdb0371208189b9ca266f1c29a8f9077c4e56861b3925f695718fba34781254220f8a8919a2e2a501d43573b2c733f8b21c12c1f freecad-0.19.4.tar.gz
53f2becfebff2713c07a4a7e78a438502ea4cb401dfab116a2f84cb066f33adfaeaae9b03e9243f0534cb648cd7e3753e66456aa1e5600a0fdb724d7ef7fbf50 vtk9.patch
04e9a2cb4323aa66445eab0e27648272b84a9459f9b55784454edb74b2f3f9031749777ac4b8d01ebcae63703398d7e0033b62196461378cc9a16d7f372d5e10 backtrace.patch
a12be7920a9ba0076c45c40d4afc43e9b9a4f8370430f8be0b505c30401564c25d9ae651b840332a716d4de2f0b0ebfb61b2f4c7952b9ea6d4d2e08d3a42bfef resourceDirectory.patch
9a1b45b032988fe26a839bd52b7c0844a47e89c0b85f5b6bbfc3d0b71581f94fe037d739fa815644bcd99e5b7a0c67abcf086343c725131764f767d2ba56aaf1 opencascade76.patch
4c8f308435fd4623bea333af80d40051a68533607525230e37ba00a84a3fae19711040ea0354f8dfb11d8d1835adb7f0a92c03680bde12d11aab08980ba09d2d tests.patch
b1d91efa873f180bf635f6006d6c4b7a33b64b630955c639fe923bb340ce8104474688e05eea151d1ac1557388947ae81618cfc8a578f14706aa07b5cdc45cda freecad-0.20.tar.gz
8ba13b17bad66316757d180c1b9e9e72a24382627eac7c43a2264b3b5101e6e8f701775f2b805ed733f500fbcd8b0e8e422ec58a9ab3d948d613b666157d4c52 resourceDirectory.patch
8bc3c294eb37758ba847124f16f81cb061427fee0401c4b244cd1a5513e3328b8ad22e7e465292660d1aa86775e8f8320dfc167e14373ff6d722a268fcdc4cbd tests.patch
"

View File

@ -1,32 +0,0 @@
Removes the use of backtrace as musl libc does not support it.
Patch is upstreamed and should not be needed after FreeCAD v0.20.
--- ./src/App/Application.cpp
+++ ./src/App/Application.cpp
@@ -1589,6 +1589,7 @@
// This function produces a stack backtrace with demangled function & method names.
void printBacktrace(size_t skip=0)
{
+#if BACKTRACE_PRESENT
void *callstack[128];
size_t nMaxFrames = sizeof(callstack) / sizeof(callstack[0]);
size_t nFrames = backtrace(callstack, nMaxFrames);
@@ -1619,6 +1620,9 @@
}
free(symbols);
+#else
+ std:cerr << "FreeCAD has not been compiled with backtrace support and thus some debug information is not available" << std::endl;
+#endif
}
#endif
--- ./cMake/ConfigureChecks.cmake
+++ ./cMake/ConfigureChecks.cmake
@@ -62,4 +62,6 @@
SET(HAVE_QT_KEYPAD_DEFINE 1)
SET(HAVE_QWIDGET_SHOWFULLSCREEN 1)
-
+IF(Backtrace_FOUND)
+ ADD_COMPILE_DEFINITIONS(BACKTRACE_PRESENT)
+ENDIF(Backtrace_FOUND)

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
--- ./cMake/FreeCAD_Helpers/ConfigureCMakeVariables.cmake
--- ./cMake/FreeCAD_Helpers/ConfigureCMakeVariables.cmake.orig
+++ ./cMake/FreeCAD_Helpers/ConfigureCMakeVariables.cmake
@@ -23,7 +23,7 @@
"Path to the directory containing PyCXX's cxxextensions.c source file")
@ -6,6 +6,6 @@
# used as compiler defines
- set(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}")
+ set(RESOURCEDIR "../../share/freecad")
set(LIBRARYDIR "${CMAKE_INSTALL_LIBDIR}")
set(DOCDIR "${CMAKE_INSTALL_DOCDIR}")
message(STATUS "prefix: ${CMAKE_INSTALL_PREFIX}")

View File

@ -1,6 +1,6 @@
--- ./src/Mod/Mesh/App/MeshTestsApp.py
--- ./src/Mod/Mesh/App/MeshTestsApp.py.orig
+++ ./src/Mod/Mesh/App/MeshTestsApp.py
@@ -190,30 +190,6 @@
@@ -423,30 +423,6 @@
self.planarMesh = []
FreeCAD.newDocument("MeshTest")
@ -22,138 +22,12 @@
- rp.setRay(coin.SbVec3f(-16.05,16.0,16.0),coin.SbVec3f(0,-1,0))
- rp.apply(view.getSoRenderManager().getSceneGraph())
- pp=rp.getPickedPoint()
- self.failUnless(pp != None)
- self.assertTrue(pp != None)
- det=pp.getDetail()
- self.failUnless(det.getTypeId() == coin.SoFaceDetail.getClassTypeId())
- self.assertTrue(det.getTypeId() == coin.SoFaceDetail.getClassTypeId())
- det=coin.cast(det,str(det.getTypeId().getName()))
- self.failUnless(det.getFaceIndex() == 1)
- self.assertTrue(det.getFaceIndex() == 1)
-
def testPrimitiveCount(self):
if not FreeCAD.GuiUp:
return
--- ./src/Mod/Fem/femtest/test_commands.sh
+++ ./src/Mod/Fem/femtest/test_commands.sh
@@ -95,11 +95,6 @@
make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_calculix.TestSolverCalculix.test_thermomech_bimetall
make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_calculix.TestSolverCalculix.test_thermomech_flow1D
make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_calculix.TestSolverCalculix.test_thermomech_spine
-make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_elmer.TestSolverElmer.test_box_static_0_mm
-make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_elmer.TestSolverElmer.test_ccxcantilever_faceload_0_mm
-make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_elmer.TestSolverElmer.test_ccxcantilever_faceload_1_si
-make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_elmer.TestSolverElmer.test_ccxcantilever_nodeload_0_mm
-make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_elmer.TestSolverElmer.test_ccxcantilever_prescribeddisplacement_0_mm
make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_z88.TestSolverZ88.test_ccxcantilever_faceload
make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_z88.TestSolverZ88.test_ccxcantilever_hexa20
make -j 4 && ./bin/FreeCADCmd -t femtest.app.test_solver_z88.TestSolverZ88.test_ccxcantilever_nodeload
--- ./src/Mod/Fem/femtest/app/test_solver_elmer.py
+++ ./src/Mod/Fem/femtest/app/test_solver_elmer.py
@@ -106,109 +106,6 @@
param.SetInt("UserSchema", new_unit_schema)
# ********************************************************************************************
- def test_box_static_0_mm(
- self
- ):
- fcc_print("")
- self.set_unit_schema(0) # mm/kg/s
-
- # set up the Elmer static analysis example
- from femexamples.boxanalysis_static import setup
- setup(self.document, "elmer")
-
- # for information:
- # elmer needs gmsh mesho object
- # FIXME error message on Python solver run
- # the examples do use a gmsh mesh object thus ok
-
- base_name = get_namefromdef("test_")
- analysis_dir = testtools.get_fem_test_tmp_dir(self.pre_dir_name + base_name)
-
- # save the file
- save_fc_file = join(analysis_dir, base_name + ".FCStd")
- # fcc_print("Save FreeCAD file to {}...".format(save_fc_file))
- self.document.saveAs(save_fc_file)
-
- # write input files
- # fcc_print("Checking FEM input file writing for Elmer solver framework solver ...")
- machine_elmer = self.document.SolverElmer.Proxy.createMachine(
- self.document.SolverElmer,
- analysis_dir,
- True
- )
- machine_elmer.target = femsolver.run.PREPARE
- machine_elmer.start()
- machine_elmer.join() # wait for the machine to finish.
-
- fcc_print("Test writing STARTINFO file")
- startinfo_given = join(self.test_file_dir, "ELMERSOLVER_STARTINFO")
- startinfo_totest = join(analysis_dir, "ELMERSOLVER_STARTINFO")
- # fcc_print("Comparing {} to {}".format(startinfo_given, startinfo_totest))
- ret = testtools.compare_files(startinfo_given, startinfo_totest)
- self.assertFalse(ret, "STARTINFO write file test failed.\n{}".format(ret))
-
- fcc_print("Test writing case file")
- casefile_given = join(self.test_file_dir, base_name + self.ending)
- casefile_totest = join(analysis_dir, self.infilename + self.ending)
- # fcc_print("Comparing {} to {}".format(casefile_given, casefile_totest))
- ret = testtools.compare_files(casefile_given, casefile_totest)
- self.assertFalse(ret, "case write file test failed.\n{}".format(ret))
-
- fcc_print("Test writing GMSH geo file")
- gmshgeofile_given = join(self.test_file_dir, "group_mesh.geo")
- gmshgeofile_totest = join(analysis_dir, "group_mesh.geo")
- # fcc_print("Comparing {} to {}".format(gmshgeofile_given, gmshgeofile_totest))
- ret = testtools.compare_files(gmshgeofile_given, gmshgeofile_totest)
- self.assertFalse(ret, "GMSH geo write file test failed.\n{}".format(ret))
-
- # ********************************************************************************************
- def test_ccxcantilever_faceload_0_mm(
- self
- ):
- fcc_print("")
- self.set_unit_schema(0) # mm/kg/s
- from femexamples.ccx_cantilever_faceload import setup
- setup(self.document, "elmer")
- self.input_file_writing_test(get_namefromdef("test_"))
-
- # ********************************************************************************************
- def test_ccxcantilever_faceload_1_si(
- self
- ):
- if sys.version_info.major < 3:
- # TODO does not pass on Python 2
- # https://travis-ci.org/github/FreeCAD/FreeCAD/builds/707885742
- # https://api.travis-ci.org/v3/job/707885745/log.txt
- fcc_print("Python 2: test aborted.")
- return
-
- fcc_print("")
- self.set_unit_schema(1) # SI-units m/kg/s
- from femexamples.ccx_cantilever_faceload import setup
- setup(self.document, "elmer")
- self.input_file_writing_test(get_namefromdef("test_"))
-
- # ********************************************************************************************
- def test_ccxcantilever_nodeload_0_mm(
- self
- ):
- fcc_print("")
- self.set_unit_schema(0) # mm/kg/s
- from femexamples.ccx_cantilever_nodeload import setup
- setup(self.document, "elmer")
- self.input_file_writing_test(get_namefromdef("test_"))
-
- # ********************************************************************************************
- def test_ccxcantilever_prescribeddisplacement_0_mm(
- self
- ):
- fcc_print("")
- self.set_unit_schema(0) # mm/kg/s
- from femexamples.ccx_cantilever_prescribeddisplacement import setup
- setup(self.document, "elmer")
- self.input_file_writing_test(get_namefromdef("test_"))
-
- # ********************************************************************************************
def input_file_writing_test(
self,
base_name

View File

@ -1,830 +0,0 @@
Originally from Fedora FreeCAD package
https://src.fedoraproject.org/rpms/freecad/blob/rawhide/f/freecad-vtk9.patch
Will not be needed once FreeCAD v0.20 comes out as it has native support for vtk9
From bb9bcbd51df7c3cb76c5823038e4ea0f7e25a9ff Mon Sep 17 00:00:00 2001
From: wmayer <wmayer@users.sourceforge.net>
Date: Mon, 12 Oct 2020 17:56:03 +0200
Subject: [PATCH] Make smesh compile with vtk9
---
.../salomesmesh/inc/SMDS_MeshElement.hxx | 9 +++-
.../salomesmesh/inc/SMDS_UnstructuredGrid.hxx | 4 ++
.../salomesmesh/src/SMDS/SMDS_BallElement.cpp | 9 +++-
.../salomesmesh/src/SMDS/SMDS_Downward.cpp | 44 +++++++++----------
.../salomesmesh/src/SMDS/SMDS_Mesh.cpp | 6 ++-
.../src/SMDS/SMDS_Mesh0DElement.cpp | 12 +++++
.../salomesmesh/src/SMDS/SMDS_MeshNode.cpp | 10 ++---
.../src/SMDS/SMDS_UnstructuredGrid.cpp | 35 +++++++++++++--
.../src/SMDS/SMDS_VtkCellIterator.cpp | 7 +--
.../salomesmesh/src/SMDS/SMDS_VtkEdge.cpp | 19 +++++++-
.../salomesmesh/src/SMDS/SMDS_VtkFace.cpp | 29 ++++++++++--
.../salomesmesh/src/SMDS/SMDS_VtkVolume.cpp | 38 +++++++++++-----
.../src/SMESH/SMESH_MeshEditor.cpp | 8 ++--
src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp | 7 ++-
14 files changed, 179 insertions(+), 58 deletions(-)
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx
+++ FreeCAD-0.19.2/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 @@ protected:
//! 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
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx
@@ -95,7 +95,11 @@ public:
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)
{
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp
@@ -67,10 +67,16 @@ void SMDS_BallElement::SetDiameter(doubl
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::ostre
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 ]);
}
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Downward.cpp
@@ -303,7 +303,7 @@ int SMDS_Down1D::getNodeSet(int cellId,
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 *pt
{
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 ce
// --- 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::computeVolumeIdsFromNod
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::computeVolumeIdsFromNod
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,
{
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::getOrderedNodesOfFa
//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::computeFacesWithNod
// --- 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::getOrderedNodes
//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::computeFacesWit
// --- 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::getOrderedNodesOf
//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::computeFacesWithN
// --- 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::getOrderedNod
//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::computeFacesW
// --- 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::getOrderedNodesOfFa
//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::computeFacesWithNod
// --- 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::getOrderedNodes
//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::computeFacesWit
// --- 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::getOrderedNodesOfFac
//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::computeFacesWithNode
// --- 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::getOrderedNodesO
//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::computeFacesWith
// --- 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
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp
@@ -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);
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh0DElement.cpp
@@ -146,6 +146,17 @@ bool SMDS_Mesh0DElement::ChangeNodes(con
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(con
}
myNode = nodes[0];
pts[0] = myNode->getVtkId();
+#endif
SMDS_Mesh::_meshList[myMeshId]->setMyModified();
return true;
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_MeshNode.cpp
@@ -191,7 +191,7 @@ public:
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 typ
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(co
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;
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
@@ -139,8 +139,8 @@ int SMDS_UnstructuredGrid::InsertNextLin
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(vtk
{
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(s
*/
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::ModifyCellNo
//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.
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
@@ -33,7 +33,8 @@ SMDS_VtkCellIterator::SMDS_VtkCellIterat
}
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_VtkCellI
//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_VtkCellI
{
//MESSAGE("SMDS_VtkCellIterator Polyhedra");
vtkIdType nFaces = 0;
- vtkIdType* ptIds = 0;
+ vtkIdTypePtr ptIds = 0;
grid->GetFaceStream(_cellId, nFaces, ptIds);
int id = 0;
_nbNodesInFaces = 0;
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkEdge.cpp
@@ -67,6 +67,19 @@ bool SMDS_VtkEdge::ChangeNodes(const SMD
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 SMD
{
pts[i] = nodes[i]->getVtkId();
}
+#endif
SMDS_Mesh::_meshList[myMeshId]->setMyModified();
return true;
}
@@ -87,7 +101,7 @@ bool SMDS_VtkEdge::IsMediumNode(const SM
{
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 ]);
}
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkFace.cpp
@@ -101,6 +101,19 @@ void SMDS_VtkFace::initQuadPoly(const st
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 SMD
{
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) con
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 SM
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::inter
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();
}
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkVolume.cpp
@@ -133,6 +133,19 @@ void SMDS_VtkVolume::initPoly(const std:
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 S
{
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 in
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::Get
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::GetQuan
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::Get
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::Get
}
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
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
}
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
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++)
Index: FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
+++ FreeCAD-0.19.2/src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
@@ -11348,7 +11348,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGrou
{
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::DoubleNodesOnGrou
//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::DoubleNodesOnGrou
{
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(do
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++)
{
Index: FreeCAD-0.19.2/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
===================================================================
--- FreeCAD-0.19.2.orig/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
+++ FreeCAD-0.19.2/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-
#include "PreCompiled.h"
#ifndef _PreComp_