{
public:
RenameObjectIdentifierExpressionVisitor(P & _prop,
const std::map (_prop)
, paths(_paths)
, owner(_owner)
{
}
void visit(Expression &node) {
this->renameObjectIdentifier(node,paths,owner);
}
private:
const std::map {
public:
UpdateElementReferenceExpressionVisitor(P & _prop, App::DocumentObject *feature=0, bool reverse=false)
: ExpressionModifier (_prop),feature(feature),reverse(reverse)
{
}
void visit(Expression &node) {
this->updateElementReference(node,feature,reverse);
}
private:
App::DocumentObject *feature;
bool reverse;
};
// Document relabel is not undoable, so we don't derive from
// ExpressionModifier, hence not calling aboutToSetValue/hasSetValue().
// By right, modification of document label should not change evaluation result
// of any expression.
class RelabelDocumentExpressionVisitor : public ExpressionVisitor {
public:
RelabelDocumentExpressionVisitor(const App::Document &doc)
: doc(doc)
{
}
void visit(Expression &node) {
this->relabeledDocument(node,doc.getOldLabel(),doc.Label.getStrValue());
}
private:
const App::Document &doc;
};
template {
public:
MoveCellsExpressionVisitor(P &prop, const CellAddress &address, int rowCount, int colCount)
: ExpressionModifier (prop),address(address),rowCount(rowCount),colCount(colCount)
{}
void visit(Expression &node) {
this->moveCells(node,address,rowCount,colCount);
}
private:
CellAddress address;
int rowCount;
int colCount;
};
template {
public:
OffsetCellsExpressionVisitor(P &prop, int rowOffset, int colOffset)
: ExpressionModifier (prop),rowOffset(rowOffset),colOffset(colOffset)
{}
void visit(Expression &node) {
this->offsetCells(node,rowOffset,colOffset);
}
private:
int rowOffset;
int colOffset;
};
}
#endif // RENAMEOBJECTIDENTIFIEREXPRESSIONVISITOR_H