MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / updateData

Method updateData

Tools/PartioViewer/PartioViewer.cpp:586–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584
585
586bool PartioViewer::updateData()
587{
588 bool chk = false;
589 for (size_t i = 0; i < getFluids().size(); i++)
590 {
591 getFluids()[i].currentFile = convertFileName(getFluids()[i].inputFile, to_string(m_frameIndex));
592 LOG_INFO << getFluids()[i].currentFile;
593 if (readPartioFile(getFluids()[i].currentFile, getFluids()[i].partioData, getFluids()[i].posIndex))
594 chk = true;
595
596 updateBoundingBox();
597
598 if (m_usePlane)
599 {
600 Partio::ParticleAttribute posAttr;
601 getFluids()[i].partioData->attributeInfo(getFluids()[i].posIndex, posAttr);
602 const float* partioX = getFluids()[i].partioData->data<float>(posAttr, 0);
603 getFluids()[i].visibleParticles.clear();
604 getFluids()[i].visibleParticles.reserve(getFluids()[i].partioData->numParticles());
605 Vector3f normal = m_planeNormal;
606 normal.normalize();
607 for (auto j = 0; j < getFluids()[i].partioData->numParticles(); j++)
608 {
609 const Eigen::Map<const Eigen::Vector3f> vec(&partioX[3 * j]);
610 if ((vec.dot(normal) - m_planePoint.dot(normal)) > 0)
611 getFluids()[i].visibleParticles.push_back(j);
612 }
613 }
614 }
615 if (chk)
616 {
617 if (m_useRBData)
618 {
619 string currentFile = convertFileName(m_rbDataFile, to_string(m_frameIndex));
620 LOG_INFO << currentFile;
621 readRigidBodyData(currentFile, m_frameIndex == m_firstRBIndex);
622 }
623 updateScalarField();
624 }
625 return chk;
626}
627
628bool PartioViewer::imagesExist(const unsigned int frameIndex)
629{

Callers 1

initParameterGUIMethod · 0.80

Calls 9

numParticlesMethod · 0.80
convertFileNameFunction · 0.50
to_stringFunction · 0.50
sizeMethod · 0.45
clearMethod · 0.45
reserveMethod · 0.45
normalizeMethod · 0.45
dotMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected