Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Modules
Visualization
Commits
000e10dd
Commit
000e10dd
authored
May 19, 2010
by
mattijs
Browse files
BUG: PV3FoamReader : patch names was addressing outside of zoneCentres array.
parent
2c04b167
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C
View file @
000e10dd
...
...
@@ -651,7 +651,7 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
labelList
nZones
(
pbMesh
.
size
(),
0
);
// Per global zone number the average face centre position
DynamicList
<
point
>
zoneCentre
(
pbMesh
.
size
());
List
<
DynamicList
<
point
>
>
zoneCentre
(
pbMesh
.
size
());
// Loop through all patches to determine zones, and centre of each zone
...
...
@@ -693,31 +693,28 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
labelList
zoneNFaces
(
pZones
.
nZones
(),
0
);
// Save start of information for current patch
label
patchStart
=
zoneCentre
.
size
();
// Create storage for additional zone centres
forAll
(
zoneNFaces
,
zoneI
)
{
zoneCentre
.
append
(
vector
::
zero
);
zoneCentre
[
patchI
]
.
append
(
vector
::
zero
);
}
// Do averaging per individual zone
forAll
(
pp
,
faceI
)
{
label
zoneI
=
pZones
[
faceI
];
zoneCentre
[
patch
Start
+
zoneI
]
+=
pp
[
faceI
].
centre
(
pp
.
points
());
zoneCentre
[
patch
I
][
zoneI
]
+=
pp
[
faceI
].
centre
(
pp
.
points
());
zoneNFaces
[
zoneI
]
++
;
}
for
(
label
i
=
0
;
i
<
nZones
[
patchI
]
;
i
++
)
for
All
(
zoneCentre
[
patchI
]
,
zoneI
)
{
zoneCentre
[
patch
Start
+
i
]
/=
zoneNFaces
[
i
];
zoneCentre
[
patch
I
][
zoneI
]
/=
zoneNFaces
[
zoneI
];
}
}
// Count number of zones we're actually going to display.
This is truncated
// to a max per patch
// Count number of zones we're actually going to display.
//
This is truncated
to a max per patch
const
label
MAXPATCHZONES
=
20
;
...
...
@@ -728,13 +725,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
displayZoneI
+=
min
(
MAXPATCHZONES
,
nZones
[
patchI
]);
}
zoneCentre
.
shrink
();
if
(
debug
)
{
Info
<<
"patch zone centres = "
<<
zoneCentre
<<
nl
<<
"displayed zone centres = "
<<
displayZoneI
<<
nl
Info
<<
"displayed zone centres = "
<<
displayZoneI
<<
nl
<<
"zones per patch = "
<<
nZones
<<
endl
;
}
...
...
@@ -749,13 +742,12 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Actor index
displayZoneI
=
0
;
// Index in zone centres
label
globalZoneI
=
0
;
forAll
(
pbMesh
,
patchI
)
{
const
polyPatch
&
pp
=
pbMesh
[
patchI
];
label
globalZoneI
=
0
;
// Only selected patches will have a non-zero number of zones
label
nDisplayZones
=
min
(
MAXPATCHZONES
,
nZones
[
patchI
]);
label
increment
=
1
;
...
...
@@ -769,7 +761,7 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
if
(
debug
)
{
Info
<<
"patch name = "
<<
pp
.
name
()
<<
nl
<<
"anchor = "
<<
zoneCentre
[
globalZoneI
]
<<
nl
<<
"anchor = "
<<
zoneCentre
[
patchI
][
globalZoneI
]
<<
nl
<<
"globalZoneI = "
<<
globalZoneI
<<
endl
;
}
...
...
@@ -792,9 +784,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
txt
->
GetPositionCoordinate
()
->
SetValue
(
zoneCentre
[
globalZoneI
].
x
(),
zoneCentre
[
globalZoneI
].
y
(),
zoneCentre
[
globalZoneI
].
z
()
zoneCentre
[
patchI
][
globalZoneI
].
x
(),
zoneCentre
[
patchI
][
globalZoneI
].
y
(),
zoneCentre
[
patchI
][
globalZoneI
].
z
()
);
// Add text to each renderer
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment