Skip to content

Commit

Permalink
Ensure chart is only compiled with USE_VTK
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Oct 30, 2023
1 parent 59d2c13 commit 773ff08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion avogadro/qtplugins/spectra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ avogadro_plugin(Spectra
"vibrationdialog.ui"
)

target_link_libraries(Spectra PRIVATE Avogadro::Vtk)
if (USE_VTK)
add_definitions(-DUSE_VTK)
target_link_libraries(Spectra PRIVATE Avogadro::Vtk)
endif()
2 changes: 2 additions & 0 deletions avogadro/qtplugins/spectra/spectra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ void Spectra::openDialog()
m_dialog->show();
}

#ifdef USE_VTK
void Spectra::showSpectraChart()
{
if (m_molecule == nullptr || m_molecule->vibrationFrequencies().empty())
Expand Down Expand Up @@ -294,6 +295,7 @@ chart->setXAxisLimits(4000.0, 0.0);
chart->setYAxisLimits(maxIntensity, 0.0);
m_chartDialog->show();
}
#endif

void Spectra::advanceFrame()
{
Expand Down
2 changes: 2 additions & 0 deletions avogadro/qtplugins/spectra/spectra.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ private slots:
QtGui::Molecule* m_molecule;

VibrationDialog* m_dialog;
#ifdef USE_VTK
QScopedPointer<VTK::ChartDialog> m_chartDialog;
#endif

QTimer* m_timer;

Expand Down
2 changes: 0 additions & 2 deletions avogadro/vtk/chartwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ void ChartWidget::setXAxisTitle(const std::string title)
axis->GetTitleProperties()->SetFontSize(18);
axis->GetTitleProperties()->SetBold(true);

qDebug() << " chart font " << axis->GetTitleProperties()->GetFontFamilyAsString();

axis->GetLabelProperties()->SetFontSize(14);
}

Expand Down

0 comments on commit 773ff08

Please sign in to comment.