##// END OF EJS Templates
Merge pull request 189 from SCIQLOP-Initialisation develop...
Merge pull request 189 from SCIQLOP-Initialisation develop Develop

File last commit:

r447:00ae2619d35f
r448:f7cb609ac07f merge
Show More
RescaleAxeOperation.cpp
71 lines | 2.2 KiB | text/x-c | CppLexer
Add rescale operation to permit to rescale axe widget
r435 #include "Visualization/operations/RescaleAxeOperation.h"
#include "Visualization/VisualizationGraphWidget.h"
Q_LOGGING_CATEGORY(LOG_RescaleAxeOperation, "RescaleAxeOperation")
struct RescaleAxeOperation::RescaleAxeOperationPrivate {
explicit RescaleAxeOperationPrivate(std::shared_ptr<Variable> variable,
const SqpDateTime &range)
Correction for MR
r447 : m_Variable{variable}, m_Range{range}
Add rescale operation to permit to rescale axe widget
r435 {
}
std::shared_ptr<Variable> m_Variable;
SqpDateTime m_Range;
};
RescaleAxeOperation::RescaleAxeOperation(std::shared_ptr<Variable> variable,
const SqpDateTime &range)
: 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) {
Correction for MR
r447 // If the widget contains the variable, rescale it
Add rescale operation to permit to rescale axe widget
r435 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");
}
}