Fixed contour tree example app.

This commit is contained in:
Petar Hristov 2020-07-24 14:17:36 +01:00
parent 1c8935f7ce
commit ce653c78f1
2 changed files with 18 additions and 20 deletions

@ -719,12 +719,12 @@ int main(int argc, char* argv[])
ctaug_ns::IdArrayType superarcDependentWeight;
ctaug_ns::IdArrayType supernodeTransferWeight;
ctaug_ns::IdArrayType hyperarcDependentWeight;
ctaug_ns::ProcessContourTree::ComputeVolumeWeights(filter.GetContourTree(),
filter.GetNumIterations(),
superarcIntrinsicWeight, // (output)
superarcDependentWeight, // (output)
supernodeTransferWeight, // (output)
hyperarcDependentWeight); // (output)
ctaug_ns::ProcessContourTree::ComputeVolumeWeightsSerial(filter.GetContourTree(),
filter.GetNumIterations(),
superarcIntrinsicWeight, // (output)
superarcDependentWeight, // (output)
supernodeTransferWeight, // (output)
hyperarcDependentWeight); // (output)
// Record the timings for the branch decomposition
std::stringstream timingsStream; // Use a string stream to log in one message
timingsStream << std::endl;
@ -740,14 +740,14 @@ int main(int argc, char* argv[])
ctaug_ns::IdArrayType branchMaximum;
ctaug_ns::IdArrayType branchSaddle;
ctaug_ns::IdArrayType branchParent;
ctaug_ns::ProcessContourTree::ComputeVolumeBranchDecomposition(filter.GetContourTree(),
superarcDependentWeight,
superarcIntrinsicWeight,
whichBranch, // (output)
branchMinimum, // (output)
branchMaximum, // (output)
branchSaddle, // (output)
branchParent); // (output)
ctaug_ns::ProcessContourTree::ComputeVolumeBranchDecompositionSerial(filter.GetContourTree(),
superarcDependentWeight,
superarcIntrinsicWeight,
whichBranch, // (output)
branchMinimum, // (output)
branchMaximum, // (output)
branchSaddle, // (output)
branchParent); // (output)
// Record and log the branch decompostion timings
timingsStream << " " << std::setw(38) << std::left << "Compute Volume Branch Decomposition"
<< ": " << branchDecompTimer.GetElapsedTime() << " seconds" << std::endl;

@ -109,7 +109,7 @@ public:
~Branch();
// Compute list of relevant/interesting isovalues
void GetRelevantValues(int type, T eps, std::vector<std::pair<T, vtkm::Id>>& values) const;
void GetRelevantValues(int type, T eps, std::vector<T>& values) const;
void AccumulateIntervals(int type, T eps, PiecewiseLinearFunction<T>& plf) const;
@ -177,7 +177,7 @@ Branch<T>* Branch<T>::ComputeBranchDecomposition(
// Reconstruct explicit branch decomposition from array representation
for (std::size_t branchID = 0; branchID < static_cast<std::size_t>(nBranches); ++branchID)
{
branches[branchID]->originalId = branchID;
branches[branchID]->OriginalId = branchID;
if (!NoSuchElement(branchSaddlePortal.Get(static_cast<vtkm::Id>(branchID))))
{
branches[branchID]->Saddle = MaskedIndex(
@ -344,9 +344,7 @@ Branch<T>::~Branch()
// TODO this recursive accumlation of values does not lend itself well to the use of VTKM data structures
template <typename T>
void Branch<T>::GetRelevantValues(int type,
T eps,
std::vector<std::pair<T, vtkm::Id>>& values) const
void Branch<T>::GetRelevantValues(int type, T eps, std::vector<T>& values) const
{ // GetRelevantValues()
T val;
@ -368,7 +366,7 @@ void Branch<T>::GetRelevantValues(int type,
break;
}
if (Parent)
values.push_back({ val, this->originalId });
values.push_back({ val });
for (Branch* c : Children)
c->GetRelevantValues(type, eps, values);
} // GetRelevantValues()