RescaleAxeOperation.cpp
69 lines
| 2.1 KiB
| text/x-c
|
CppLexer
r401 | #include "Visualization/operations/RescaleAxeOperation.h" | |||
#include "Visualization/VisualizationGraphWidget.h" | ||||
Q_LOGGING_CATEGORY(LOG_RescaleAxeOperation, "RescaleAxeOperation") | ||||
struct RescaleAxeOperation::RescaleAxeOperationPrivate { | ||||
r471 | explicit RescaleAxeOperationPrivate(std::shared_ptr<Variable> variable, const SqpRange &range) | |||
r413 | : m_Variable{variable}, m_Range{range} | |||
r401 | { | |||
} | ||||
std::shared_ptr<Variable> m_Variable; | ||||
r471 | SqpRange m_Range; | |||
r401 | }; | |||
r471 | RescaleAxeOperation::RescaleAxeOperation(std::shared_ptr<Variable> variable, const SqpRange &range) | |||
r401 | : impl{spimpl::make_unique_impl<RescaleAxeOperationPrivate>(variable, range)} | |||
{ | ||||
} | ||||
void RescaleAxeOperation::visitEnter(VisualizationWidget *widget) | ||||
{ | ||||
// VisualizationWidget is not intended to contain a variable | ||||
Q_UNUSED(widget) | ||||
} | ||||
void RescaleAxeOperation::visitLeave(VisualizationWidget *widget) | ||||
{ | ||||
// VisualizationWidget is not intended to contain a variable | ||||
Q_UNUSED(widget) | ||||
} | ||||
void RescaleAxeOperation::visitEnter(VisualizationTabWidget *tabWidget) | ||||
{ | ||||
// VisualizationTabWidget is not intended to contain a variable | ||||
Q_UNUSED(tabWidget) | ||||
} | ||||
void RescaleAxeOperation::visitLeave(VisualizationTabWidget *tabWidget) | ||||
{ | ||||
// VisualizationTabWidget is not intended to contain a variable | ||||
Q_UNUSED(tabWidget) | ||||
} | ||||
void RescaleAxeOperation::visitEnter(VisualizationZoneWidget *zoneWidget) | ||||
{ | ||||
// VisualizationZoneWidget is not intended to contain a variable | ||||
Q_UNUSED(zoneWidget) | ||||
} | ||||
void RescaleAxeOperation::visitLeave(VisualizationZoneWidget *zoneWidget) | ||||
{ | ||||
// VisualizationZoneWidget is not intended to contain a variable | ||||
Q_UNUSED(zoneWidget) | ||||
} | ||||
void RescaleAxeOperation::visit(VisualizationGraphWidget *graphWidget) | ||||
{ | ||||
if (graphWidget) { | ||||
r413 | // If the widget contains the variable, rescale it | |||
r401 | if (impl->m_Variable && graphWidget->contains(*impl->m_Variable)) { | |||
graphWidget->setRange(impl->m_Variable, impl->m_Range); | ||||
} | ||||
} | ||||
else { | ||||
qCCritical(LOG_RescaleAxeOperation(), | ||||
"Can't visit VisualizationGraphWidget : the widget is null"); | ||||
} | ||||
} | ||||