mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
blockMesh reader fix, start refactoring of PV3Readers
- apply scaleFactor (eg, mm->m) in PV3 reader - this looks better when overlaying with other objects - stop segfault when paraview exits without deleting readers first
This commit is contained in:
@ -4,18 +4,18 @@ set -x
|
||||
|
||||
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
|
||||
then
|
||||
case "$ParaView_VERSION" in
|
||||
3*)
|
||||
wmake libso vtkPV3blockMesh
|
||||
(
|
||||
cd PV3blockMeshReader
|
||||
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
|
||||
cd Make/$WM_OPTIONS
|
||||
cmake ../..
|
||||
make
|
||||
)
|
||||
;;
|
||||
esac
|
||||
case "$ParaView_VERSION" in
|
||||
3*)
|
||||
wmake libso vtkPV3blockMesh
|
||||
(
|
||||
cd PV3blockMeshReader
|
||||
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
|
||||
cd Make/$WM_OPTIONS
|
||||
cmake ../..
|
||||
make
|
||||
)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -220,8 +220,18 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show)
|
||||
{
|
||||
pqApplicationCore* appCore = pqApplicationCore::instance();
|
||||
|
||||
// need to check this, since our destructor calls this
|
||||
if (!appCore)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Server manager model for querying items in the server manager
|
||||
pqServerManagerModel* smModel = appCore->getServerManagerModel();
|
||||
if (!smModel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get all the pqRenderView instances
|
||||
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
|
||||
|
||||
@ -7,9 +7,11 @@ EXE_INC = \
|
||||
-I$(ParaView_INST_DIR)/VTK/Common \
|
||||
-I$(ParaView_INST_DIR)/VTK/Filtering \
|
||||
-I$(ParaView_INST_DIR)/VTK/Rendering \
|
||||
-I../../vtkPV3Readers/lnInclude \
|
||||
-I../PV3blockMeshReader
|
||||
|
||||
LIB_LIBS = \
|
||||
-lvtkPV3Readers \
|
||||
-lmeshTools \
|
||||
-lblockMesh \
|
||||
$(GLIBS)
|
||||
|
||||
@ -44,6 +44,21 @@ inline void vtkInsertNextOpenFOAMPoint
|
||||
points->InsertNextPoint(p.x(), p.y(), p.z());
|
||||
}
|
||||
|
||||
inline void vtkInsertNextOpenFOAMPoint
|
||||
(
|
||||
vtkPoints *points,
|
||||
const Foam::point& p,
|
||||
const Foam::scalar scaleFactor
|
||||
)
|
||||
{
|
||||
points->InsertNextPoint
|
||||
(
|
||||
p.x()*scaleFactor,
|
||||
p.y()*scaleFactor,
|
||||
p.z()*scaleFactor
|
||||
);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -384,6 +384,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
|
||||
if (show && meshPtr_)
|
||||
{
|
||||
const pointField& cornerPts = meshPtr_->blockPointField();
|
||||
const scalar scaleFactor = meshPtr_->scaleFactor();
|
||||
|
||||
pointNumberTextActorsPtrs_.setSize(cornerPts.size());
|
||||
forAll(cornerPts, pointI)
|
||||
@ -407,9 +408,9 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
|
||||
|
||||
txt->GetPositionCoordinate()->SetValue
|
||||
(
|
||||
cornerPts[pointI].x(),
|
||||
cornerPts[pointI].y(),
|
||||
cornerPts[pointI].z()
|
||||
cornerPts[pointI].x()*scaleFactor,
|
||||
cornerPts[pointI].y()*scaleFactor,
|
||||
cornerPts[pointI].z()*scaleFactor
|
||||
);
|
||||
|
||||
// Add text to each renderer
|
||||
|
||||
@ -66,6 +66,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
|
||||
}
|
||||
|
||||
int blockI = 0;
|
||||
const scalar scaleFactor = blkMesh.scaleFactor();
|
||||
|
||||
for
|
||||
(
|
||||
@ -103,7 +104,8 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
|
||||
vtkInsertNextOpenFOAMPoint
|
||||
(
|
||||
vtkpoints,
|
||||
blockPoints[blockLabels[ptI]]
|
||||
blockPoints[blockLabels[ptI]],
|
||||
scaleFactor
|
||||
);
|
||||
|
||||
nodeIds[ptI] = ptI;
|
||||
@ -159,6 +161,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
|
||||
const curvedEdgeList& edges = blkMesh.edges();
|
||||
|
||||
int edgeI = 0;
|
||||
const scalar scaleFactor = blkMesh.scaleFactor();
|
||||
|
||||
for
|
||||
(
|
||||
@ -212,7 +215,12 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
|
||||
vtkIdType pointIds[edgePoints.size()];
|
||||
forAll(edgePoints, ptI)
|
||||
{
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, edgePoints[ptI]);
|
||||
vtkInsertNextOpenFOAMPoint
|
||||
(
|
||||
vtkpoints,
|
||||
edgePoints[ptI],
|
||||
scaleFactor
|
||||
);
|
||||
pointIds[ptI] = ptI;
|
||||
}
|
||||
|
||||
@ -266,6 +274,7 @@ void Foam::vtkPV3blockMesh::convertMeshCorners
|
||||
label datasetNo = 0; // restart at dataset 0
|
||||
|
||||
const pointField& blockPoints = meshPtr_->blockPointField();
|
||||
const scalar& scaleFactor = meshPtr_->scaleFactor();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -284,7 +293,12 @@ void Foam::vtkPV3blockMesh::convertMeshCorners
|
||||
vtkIdType pointId = 0;
|
||||
forAll(blockPoints, ptI)
|
||||
{
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, blockPoints[ptI]);
|
||||
vtkInsertNextOpenFOAMPoint
|
||||
(
|
||||
vtkpoints,
|
||||
blockPoints[ptI],
|
||||
scaleFactor
|
||||
);
|
||||
|
||||
vtkcells->InsertNextCell(1, &pointId);
|
||||
pointId++;
|
||||
|
||||
Reference in New Issue
Block a user