MCPcopy Create free account
hub / github.com/Kitware/ParaView / updateViewModelCallBack

Method updateViewModelCallBack

Qt/Core/pqMultiSliceView.cxx:259–309  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

257
258//-----------------------------------------------------------------------------
259void pqMultiSliceView::updateViewModelCallBack(vtkObject*, unsigned long, void*)
260{
261 if (this->UserIsInteracting)
262 {
263 return; // We don't want to update our data model
264 }
265
266 std::vector<double> xSlices =
267 vtkSMPropertyHelper(this->getViewProxy(), "XSlicesValues").GetDoubleArray();
268 std::vector<double> ySlices =
269 vtkSMPropertyHelper(this->getViewProxy(), "YSlicesValues").GetDoubleArray();
270 std::vector<double> zSlices =
271 vtkSMPropertyHelper(this->getViewProxy(), "ZSlicesValues").GetDoubleArray();
272
273 assert("The maximum number of slice can not be bigger than 255" &&
274 (255 > std::max(std::max(xSlices.size(), ySlices.size()), zSlices.size())));
275
276 // Build a tmp array of visibility set to true
277 bool visibility[255];
278 memset(visibility, true, 255);
279
280 double emptyDouble = 0;
281 if (!xSlices.empty())
282 {
283 this->AxisX->updateSlices(xSlices.data(), visibility, static_cast<int>(xSlices.size()));
284 }
285 else // Reset slices
286 {
287 this->AxisX->updateSlices(&emptyDouble, visibility, 0);
288 }
289
290 if (!ySlices.empty())
291 {
292 this->AxisY->updateSlices(ySlices.data(), visibility, static_cast<int>(ySlices.size()));
293 }
294 else // Reset slices
295 {
296 this->AxisY->updateSlices(&emptyDouble, visibility, 0);
297 }
298
299 if (!zSlices.empty())
300 {
301 this->AxisZ->updateSlices(zSlices.data(), visibility, static_cast<int>(zSlices.size()));
302 }
303 else // Reset slices
304 {
305 this->AxisZ->updateSlices(&emptyDouble, visibility, 0);
306 }
307
308 this->render();
309}
310//-----------------------------------------------------------------------------
311const double* pqMultiSliceView::GetVisibleSlices(int axisIndex, int& numberOfSlices)
312{

Callers 1

createWidgetMethod · 0.95

Calls 8

maxFunction · 0.85
GetDoubleArrayMethod · 0.80
getViewProxyMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
updateSlicesMethod · 0.45
dataMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected