Commit 486719da authored by Jan Möbius's avatar Jan Möbius

Removed philips stereo from core (moved to postprocessor plugin)



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12305 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c8b168e2
......@@ -45,6 +45,7 @@
#define POSTPROCESSORINTERFACE_HH
#include <ACG/GL/GLState.hh>
#include <QAction>
/** \file PostProcessorInterface.hh
*
......@@ -80,6 +81,16 @@ class PostProcessorInterface {
*/
virtual QString postProcessorName() = 0;
/** \brief Return options menu
*
* If you want an options Menu or menu entry, you can return your action here.
* It will be shown on top of the post processors list in the options menu.
*
*
* @return Action for a menu or menu entry
*/
virtual QAction* optionsAction() { return 0; };
};
/** \page PostProcessorInterfacePage Post Processor Interface
......
......@@ -1937,6 +1937,14 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
// Retrieve and store PostProcessor information
if ( postProcessorInfo != 0) {
postProcessorInfo->plugin = postProcessorPlugin;
if ( checkSlot( plugin , "optionsAction()" ) ) {
//Get an action for the post processor options
postProcessorInfo->optionsAction = postProcessorPlugin->optionsAction();
} else {
postProcessorInfo->optionsAction = 0;
}
}
} else {
......
......@@ -176,7 +176,8 @@ unsigned int RenderManager::activeId(unsigned int _id) {
PostProcessorInfo::PostProcessorInfo(PostProcessorInterface* _plugin, QString _name) :
plugin(_plugin),
name(_name)
name(_name),
optionsAction(0)
{
}
......
......@@ -179,6 +179,9 @@ class PostProcessorInfo{
/// Name of the plugin ( requested from the plugin on load)
QString name;
/// Possible action to add an options action or menu to the system.
QAction* optionsAction;
};
......
......@@ -888,20 +888,6 @@ bool initializeSettings() {
if ( ! settings_->contains("Core/Stereo/EyeDistance") )
settings_->setValue("Core/Stereo/EyeDistance",0.07);
// Philips stereo display settings
if ( ! settings_->contains("Core/Stereo/Philips/Content") )
settings_->setValue("Core/Stereo/Philips/Content",3);
if ( ! settings_->contains("Core/Stereo/Philips/Factor") )
settings_->setValue("Core/Stereo/Philips/Factor",64);
if ( ! settings_->contains("Core/Stereo/Philips/Offset") )
settings_->setValue("Core/Stereo/Philips/Offset",128);
if ( ! settings_->contains("Core/Stereo/Philips/Select") )
settings_->setValue("Core/Stereo/Philips/Select",0);
return true;
......
......@@ -415,8 +415,7 @@ QString helpDirStr();
enum StereoMode {
OpenGL,
AnaglyphRedCyan,
AnaglyphCustom,
Philips
AnaglyphCustom
};
/// Store opengl stereo support setting
......
......@@ -261,6 +261,18 @@ void CoreWidget::updatePopupMenuCoordsysNode(QMenu* _menu , const int /*_part*/
QActionGroup* groupPostProcessor = new QActionGroup( this );
groupPostProcessor->setExclusive( true );
// Get the options action for the currently active
for ( unsigned int i = 0 ; i < postProcessorManager().available() ; ++i) {
if ( postProcessorManager().activeId(PluginFunctions::activeExaminer() ) == i )
if( postProcessorManager()[i]->optionsAction != 0 ) {
postProcessorMenu->addAction(postProcessorManager()[i]->optionsAction);
postProcessorMenu->addSeparator();
}
}
// Now add the processor chooser
for ( unsigned int i = 0 ; i < postProcessorManager().available() ; ++i) {
// Add a new Action with the postprocessors name
......
......@@ -590,23 +590,12 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->stereoCustomAnaglyph, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->stereoPhilips, SIGNAL(clicked()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->focalDistance, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->eyeDistance, SIGNAL(editingFinished()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerContentType, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
connect(stereoSettingsWidget_->headerFactor, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerOffsetCC, SIGNAL(sliderReleased()),
this, SLOT(slotApplyStereoSettings()));
connect(stereoSettingsWidget_->headerSelect, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotApplyStereoSettings(int)));
// Close button
connect(stereoSettingsWidget_->closeButton, SIGNAL(clicked()),
stereoSettingsWidget_, SLOT(hide()));
......
......@@ -423,36 +423,10 @@ void CoreWidget::stereoButtonContextMenu(const QPoint& _pos) {
// Set values
stereoSettingsWidget_->stereoAnaglyph->setChecked(OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphRedCyan);
stereoSettingsWidget_->stereoCustomAnaglyph->setChecked(OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphCustom);
stereoSettingsWidget_->stereoPhilips->setChecked(OpenFlipper::Options::stereoMode() == OpenFlipper::Options::Philips);
stereoSettingsWidget_->eyeDistance->setValue( OpenFlipperSettings().value("Core/Stereo/EyeDistance").toDouble() );
stereoSettingsWidget_->focalDistance->setValue( OpenFlipperSettings().value("Core/Stereo/FocalDistance").toDouble() * 1000);
// Philips stereo mode part
// Block signals such that slotApplyStereoSettings
// won't be called when setting the initial values here...
stereoSettingsWidget_->headerContentType->blockSignals(true);
stereoSettingsWidget_->headerSelect->blockSignals(true);
stereoSettingsWidget_->headerContentType->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Content").toInt());
stereoSettingsWidget_->headerFactor->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Factor").toInt());
stereoSettingsWidget_->headerOffsetCC->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Offset").toInt());
stereoSettingsWidget_->factorCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Factor").toInt());
stereoSettingsWidget_->offsetCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Offset").toInt());
stereoSettingsWidget_->headerSelect->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Select").toInt());
// Unblock signals
stereoSettingsWidget_->headerContentType->blockSignals(false);
stereoSettingsWidget_->headerSelect->blockSignals(false);
// Show right stacked widget
if (stereoSettingsWidget_->stereoPhilips->isChecked()) {
stereoSettingsWidget_->stackedWidget->setCurrentIndex(1);
} else {
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
}
// Move widget to the position of the cursor
stereoSettingsWidget_->move(stereoButton_->mapToGlobal(_pos) - QPoint((int)(stereoSettingsWidget_->width()/2), 0));
// Show widget
......@@ -470,9 +444,6 @@ void CoreWidget::slotApplyStereoSettings(int /*_tmpParam*/) {
} else if (stereoSettingsWidget_->stereoAnaglyph->isChecked()) {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan);
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
} else if (stereoSettingsWidget_->stereoPhilips->isChecked()) {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::Philips);
stereoSettingsWidget_->stackedWidget->setCurrentIndex(1);
} else {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL);
stereoSettingsWidget_->stackedWidget->setCurrentIndex(0);
......@@ -482,16 +453,6 @@ void CoreWidget::slotApplyStereoSettings(int /*_tmpParam*/) {
OpenFlipperSettings().setValue("Core/Stereo/EyeDistance",stereoSettingsWidget_->eyeDistance->value());
OpenFlipperSettings().setValue("Core/Stereo/FocalDistance",double(stereoSettingsWidget_->focalDistance->value()/1000.0));
// Update labels that display the current values
stereoSettingsWidget_->factorCounter->setNum(stereoSettingsWidget_->headerFactor->value());
stereoSettingsWidget_->offsetCounter->setNum(stereoSettingsWidget_->headerOffsetCC->value());
// Set option entries
OpenFlipperSettings().setValue("Core/Stereo/Philips/Content",stereoSettingsWidget_->headerContentType->currentIndex());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Factor",stereoSettingsWidget_->headerFactor->value());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Offset",stereoSettingsWidget_->headerOffsetCC->value());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Select",stereoSettingsWidget_->headerSelect->currentIndex());
// Update all views
for (unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i) {
examiner_widgets_[i]->updateGL();
......
......@@ -147,12 +147,6 @@ glViewer::glViewer( QGraphicsScene* _scene,
glWidget_(_glWidget),
cursorPainter_(0),
cursorPositionValid_(false),
pProgram_(0),
philipsStereoInitialized_(false),
colorTextureBufferWidth_(0),
colorTextureBufferHeight_(0),
depthStencilTextureBufferWidth_(0),
depthStencilTextureBufferHeight_(0),
pickCache_(0),
updatePickCache_(true),
pickCacheSupported_(true),
......@@ -588,16 +582,6 @@ void glViewer::drawScene()
// draw mono or stereo
makeCurrent();
/* std::cerr << "Draw Scene" << std::endl;
std::cerr << "Available renderers: " << renderManager().available() << std::endl;
std::cerr << "Active renderer: " << renderManager().active()->name.toStdString() << std::endl;
std::cerr << "Available postprocessors: " << postProcessorManager().available() << std::endl;
std::cerr << "Active postprocessor: " << postProcessorManager().active()->name.toStdString() << std::endl;
*/
// Check if we use build in default renderers
if ( renderManager().activeId( properties_.viewerId() ) == 0 ) {
if (stereo_) drawScene_stereo();
......@@ -797,16 +781,8 @@ glViewer::drawScene_stereo()
// if somthing went wrong, fallback to normal anaglyph
if (customAnaglyphSupported_)
return;
} else if (OpenFlipper::Options::stereoMode () == OpenFlipper::Options::Philips )
{
drawScenePhilipsStereo ();
return;
}
drawScene_anaglyphStereo ();
}
......
......@@ -665,42 +665,9 @@ private:
GLuint agProgram_;
bool customAnaglyphSupported_;
GLSL::PtrProgram pProgram_;
bool philipsStereoInitialized_;
/** @} */
//===========================================================================
/** @name Buffers
* @{ */
//===========================================================================
private:
/// Updates the Color Texture Buffer to the current size and initializes it if necessary
void updateColorTextureBuffer();
/// Updates the DepthStencil Texture Buffer to the current size and initializes it if necessary
void updateDepthStencilTextureBuffer();
/// color texture buffer
ACG::Texture2D pColorTexture_;
/// depthStencil texture buffer
ACG::Texture2D pDepthStencilTexture_;
/// Current width of the color texture buffer
int colorTextureBufferWidth_;
/// Current height of the color texture buffer
int colorTextureBufferHeight_;
/// Current width of the depthStencil texture buffer
int depthStencilTextureBufferWidth_;
/// Current height of the depthStencil texture buffer
int depthStencilTextureBufferHeight_;
//===========================================================================
/** @name Key handling
* @{ */
......
This diff is collapsed.
......@@ -86,23 +86,12 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
this, SLOT(switchStackedWidget()));
connect(stereoCustomAnaglyph, SIGNAL(clicked()),
this, SLOT(switchStackedWidget()));
connect(stereoPhilips, SIGNAL(clicked()),
this, SLOT(switchStackedWidget()));
connect(focalDistance, SIGNAL(sliderReleased()),
this, SLOT(slotPreviewStereoSettings()));
connect(eyeDistance, SIGNAL(editingFinished()),
this, SLOT(slotPreviewStereoSettings()));
connect(headerContentType, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotPreviewStereoSettings(int)));
connect(headerFactor, SIGNAL(sliderReleased()),
this, SLOT(updateSliderCounter()));
connect(headerOffsetCC, SIGNAL(sliderReleased()),
this, SLOT(updateSliderCounter()));
connect(headerSelect, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotPreviewStereoSettings(int)));
ACG::SceneGraph::DrawModes::ModeFlagSet mode(2);
for (uint i=1; i < 22; i++) {
std::vector< QString > dm = drawModeToDescriptions( mode );
......@@ -216,9 +205,6 @@ void OptionsWidget::switchStackedWidget() {
} else if (stereoAnaglyph->isChecked()) {
stackedWidget->setCurrentIndex(0);
customAnaGlyphSettings->setVisible(false);
} else if (stereoPhilips->isChecked()) {
stackedWidget->setCurrentIndex(1);
customAnaGlyphSettings->setVisible(false);
} else {
stackedWidget->setCurrentIndex(0);
customAnaGlyphSettings->setVisible(false);
......@@ -303,38 +289,17 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
stereoAnaglyph->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphRedCyan);
stereoCustomAnaglyph->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphCustom);
stereoPhilips->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::Philips);
eyeDistance->setValue ( OpenFlipperSettings().value("Core/Stereo/EyeDistance").toDouble() );
focalDistance->setValue ( OpenFlipperSettings().value("Core/Stereo/FocalDistance").toDouble() * 1000);
// Block signals such that slotApplyStereoSettings
// won't be called when setting the initial values here...
headerContentType->blockSignals(true);
headerSelect->blockSignals(true);
// Philips stereo mode part
headerContentType->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Content").toInt());
headerFactor->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Factor").toInt());
headerOffsetCC->setValue(OpenFlipperSettings().value("Core/Stereo/Philips/Offset").toInt());
factorCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Factor").toInt());
offsetCounter->setNum(OpenFlipperSettings().value("Core/Stereo/Philips/Offset").toInt());
headerSelect->setCurrentIndex(OpenFlipperSettings().value("Core/Stereo/Philips/Select").toInt());
// Unblock signals
headerContentType->blockSignals(false);
headerSelect->blockSignals(false);
// Show right stacked widget
customAnaGlyphSettings->setVisible(false);
if (stereoPhilips->isChecked()) {
stackedWidget->setCurrentIndex(1);
} else {
stackedWidget->setCurrentIndex(0);
if (stereoCustomAnaglyph->isChecked())
customAnaGlyphSettings->setVisible(true);
}
stackedWidget->setCurrentIndex(0);
if (stereoCustomAnaglyph->isChecked())
customAnaGlyphSettings->setVisible(true);
std::vector<float> mat = OpenFlipper::Options::anaglyphLeftEyeColorMatrix ();
lcm0->setValue (mat[0]);
......@@ -653,21 +618,12 @@ void OptionsWidget::slotApply() {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphCustom);
else if (stereoAnaglyph->isChecked ())
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan);
else if (stereoPhilips->isChecked() )
OpenFlipper::Options::stereoMode(OpenFlipper::Options::Philips);
else
OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL);
OpenFlipperSettings().setValue("Core/Stereo/EyeDistance",eyeDistance->value ());
OpenFlipperSettings().setValue("Core/Stereo/FocalDistance",double(focalDistance->value() / 1000.0));
// Set option entries for philips stereo mode
// Set option entries
OpenFlipperSettings().setValue("Core/Stereo/Philips/Content",headerContentType->currentIndex());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Factor",headerFactor->value());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Offset",headerOffsetCC->value());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Select",headerSelect->currentIndex());
std::vector<float> mat (9, 0);
mat[0] = lcm0->value ();
mat[1] = lcm1->value ();
......@@ -962,35 +918,18 @@ void OptionsWidget::compareVersions() {
updateVersionsTable();
}
void OptionsWidget::updateSliderCounter() {
// Update labels that display the current values
factorCounter->setNum(headerFactor->value());
offsetCounter->setNum(headerOffsetCC->value());
// Preview settings
slotPreviewStereoSettings();
}
void OptionsWidget::slotPreviewStereoSettings(int /*_tmpParam*/) {
if (stereoCustomAnaglyph->isChecked ())
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphCustom);
else if (stereoAnaglyph->isChecked ())
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan);
else if (stereoPhilips->isChecked() )
OpenFlipper::Options::stereoMode(OpenFlipper::Options::Philips);
else
OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL);
OpenFlipperSettings().setValue("Core/Stereo/EyeDistance", eyeDistance->value());
OpenFlipperSettings().setValue("Core/Stereo/FocalDistance", double(focalDistance->value() / 1000.0));
// Set option entries for philips stereo mode
// Set option entries
OpenFlipperSettings().setValue("Core/Stereo/Philips/Content", headerContentType->currentIndex());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Factor", headerFactor->value());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Offset", headerOffsetCC->value());
OpenFlipperSettings().setValue("Core/Stereo/Philips/Select", headerSelect->currentIndex());
// Update all views
emit applyOptions();
......
......@@ -113,9 +113,6 @@ private slots:
/// Switch between the stacked widgets of the stereo settings
void switchStackedWidget();
/// Update the labels that show th current values of the sliders
void updateSliderCounter();
/// This function is called to update stereo settings for real-time preview
/// Note: The parameter only makes sure that the signals can be connected
/// to this slot.
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment