Commit 180eca0b authored by Jan Möbius's avatar Jan Möbius

Enable headless mode for meshinfo plugin

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13519 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ff405bda
...@@ -70,13 +70,16 @@ ...@@ -70,13 +70,16 @@
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
void InfoMeshObjectPlugin::initializePlugin() { void InfoMeshObjectPlugin::initializePlugin() {
infoBar_ = new InfoBar();
// Create info dialog if ( OpenFlipper::Options::gui()) {
info_ = new InfoDialog(); infoBar_ = new InfoBar();
// Set default pick mode in dialog box // Create info dialog
info_->pickMode->setCurrentIndex(0); // PICK_FACES info_ = new InfoDialog();
// Set default pick mode in dialog box
info_->pickMode->setCurrentIndex(0); // PICK_FACES
}
} }
/// initialize the plugin /// initialize the plugin
...@@ -85,8 +88,10 @@ void InfoMeshObjectPlugin::pluginsInitialized() { ...@@ -85,8 +88,10 @@ void InfoMeshObjectPlugin::pluginsInitialized() {
//set the slot descriptions //set the slot descriptions
setDescriptions(); setDescriptions();
emit addWidgetToStatusbar(infoBar_); if ( OpenFlipper::Options::gui()) {
infoBar_->hideCounts(); emit addWidgetToStatusbar(infoBar_);
infoBar_->hideCounts();
}
} }
...@@ -740,16 +745,16 @@ bool InfoMeshObjectPlugin::getEdgeLengths(int _id, double &min, double &max, dou ...@@ -740,16 +745,16 @@ bool InfoMeshObjectPlugin::getEdgeLengths(int _id, double &min, double &max, dou
void InfoMeshObjectPlugin::slotObjectUpdated( int /*_identifier*/ , const UpdateType& _type){ void InfoMeshObjectPlugin::slotObjectUpdated( int /*_identifier*/ , const UpdateType& _type){
if ( !infoBar_ ) {
return;
}
if ( (PluginFunctions::objectCount() == 1) || (PluginFunctions::targetCount() == 1) ){ if ( (PluginFunctions::objectCount() == 1) || (PluginFunctions::targetCount() == 1) ){
// This block is only interesting for topology changes // This block is only interesting for topology changes
if ( ! _type.contains(UPDATE_TOPOLOGY) ) { if ( ! _type.contains(UPDATE_TOPOLOGY) ) {
return; return;
} }
if ( !infoBar_ ) {
return;
}
bool found = false; bool found = false;
...@@ -806,7 +811,8 @@ void InfoMeshObjectPlugin::slotObjectSelectionChanged( int _identifier ){ ...@@ -806,7 +811,8 @@ void InfoMeshObjectPlugin::slotObjectSelectionChanged( int _identifier ){
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void InfoMeshObjectPlugin::slotAllCleared(){ void InfoMeshObjectPlugin::slotAllCleared(){
infoBar_->hideCounts(); if ( infoBar_ )
infoBar_->hideCounts();
} }
Q_EXPORT_PLUGIN2( InfoMeshObjectPlugin , InfoMeshObjectPlugin ); Q_EXPORT_PLUGIN2( InfoMeshObjectPlugin , InfoMeshObjectPlugin );
......
...@@ -102,6 +102,8 @@ class InfoMeshObjectPlugin : public QObject, BaseInterface, InformationInterface ...@@ -102,6 +102,8 @@ class InfoMeshObjectPlugin : public QObject, BaseInterface, InformationInterface
void slotObjectSelectionChanged( int _identifier ); void slotObjectSelectionChanged( int _identifier );
void slotAllCleared(); void slotAllCleared();
void noguiSupported( ) {} ;
// InformationInterface // InformationInterface
void slotInformationRequested(const QPoint _clickedPoint, DataType _type); void slotInformationRequested(const QPoint _clickedPoint, DataType _type);
DataType supportedDataTypes(); DataType supportedDataTypes();
......
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