Skip to content

Commit

Permalink
Build graph fix (#8311) - Fixed Constraints' value not being updated
Browse files Browse the repository at this point in the history
  • Loading branch information
acpopescu authored and donovaly committed Mar 27, 2023
1 parent 9872459 commit de2e122
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/App/PropertyExpressionEngine.cpp
Expand Up @@ -318,8 +318,8 @@ void PropertyExpressionEngine::Restore(Base::XMLReader &reader)
* @brief Update graph structure with given path and expression.
* @param path Path
* @param expression Expression to query for dependencies
* @param nodes Map with nodes of graph
* @param revNodes Reverse map of nodes
* @param nodes Map with nodes of graph, including dependencies of 'expression'
* @param revNodes Reverse map of the nodes, containing only the given paths, without dependencies.
* @param edges Edges in graph
*/

Expand Down Expand Up @@ -520,8 +520,8 @@ struct cycle_detector : public boost::dfs_visitor<> {
/**
* @brief Build a graph of all expressions in \a exprs.
* @param exprs Expressions to use in graph
* @param revNodes Map from int to ObjectIndentifer
* @param g Graph to update
* @param revNodes Map from int[nodeid] to ObjectIndentifer.
* @param g Graph to update. May contain additional nodes than in revNodes, because of outside dependencies.
*/

void PropertyExpressionEngine::buildGraph(const ExpressionMap & exprs,
Expand Down Expand Up @@ -550,7 +550,7 @@ void PropertyExpressionEngine::buildGraph(const ExpressionMap & exprs,
}

// Create graph
g = DiGraph(revNodes.size());
g = DiGraph(nodes.size());

// Add edges to graph
for (std::vector<Edge>::const_iterator i = edges.begin(); i != edges.end(); ++i)
Expand Down Expand Up @@ -588,6 +588,8 @@ std::vector<App::ObjectIdentifier> PropertyExpressionEngine::computeEvaluationOr
topological_sort(g, std::back_inserter(c));

for (std::vector<int>::iterator i = c.begin(); i != c.end(); ++i) {
// we return the evaluation order for our properties, not the dependencies
// the topo sort will contain node ids for both our props and their deps
if (revNodes.find(*i) != revNodes.end())
evaluationOrder.push_back(revNodes[*i]);
}
Expand Down

0 comments on commit de2e122

Please sign in to comment.