Developer Documentation
PluginCommunication.cc
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 
43 
44 
45 
46 
47 //=============================================================================
48 //
49 // CLASS Core - IMPLEMENTATION of Comunication with plugins
50 //
51 //=============================================================================
52 
53 
54 //== INCLUDES =================================================================
55 
56 #include "Core.hh"
57 
58 #include "OpenFlipper/BasePlugin/PluginFunctionsCore.hh"
59 #include <stdexcept>
60 
61 //== IMPLEMENTATION ==========================================================
62 
63 //========================================================================================
64 // === Object List Communication =======================
65 //========================================================================================
66 
75 void Core::slotObjectUpdated(int _identifier, const UpdateType& _type) {
76  if ( OpenFlipper::Options::doSlotDebugging() ) {
77  if ( sender() != 0 ) {
78  if ( sender()->metaObject() != 0 ) {
79  emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + ", " + updateTypeName(_type)
80  + tr(" ) called by ") + QString( sender()->metaObject()->className() ) );
81  }
82  } else {
83  emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + ", " + updateTypeName(_type) + tr(" ) called by Core") );
84  }
85  }
86 
87  // Disable redraws as everything here has to update the object only once
88  OpenFlipper::Options::redrawDisabled(true);
89 
90  // If we are called for a special object, we update it ourself so the Plugins dont need to do that.
91  BaseObject* object = 0;
92  if ( _identifier != -1 ) {
93  if ( !PluginFunctions::getObject(_identifier,object) ) {
94  emit log(LOGERR,tr("updated_objects called for non existing object with id : ") + QString::number(_identifier) );
95  return;
96  }
97  }
98 
99 
100  // If the identifier is -1 we force an update of all objects in the scene (Bad idea for scenes with many objects)
101  if ( _identifier == -1 ) {
102 
103  if ( sender() != 0 ) {
104  if ( sender()->metaObject() != 0 ) {
105  emit log(LOGWARN,"updatedObject( " + QString::number(_identifier) + ", " + updateTypeName(_type)
106  + tr(" ) called by ") + QString( sender()->metaObject()->className() + tr(" which is inefficient)") ) );
107  }
108  } else {
109  emit log(LOGWARN,"updatedObject( " + QString::number(_identifier) + ", " + updateTypeName(_type) + tr(" ) called by Core, which is inefficient!") );
110  }
111 
113 
114  // just inform the plugins as we don't do anything else (Do deprecated and new updatedObjects here)
115  emit signalObjectUpdated(o_it->id());
116  emit signalObjectUpdated(o_it->id(), _type);
117 
118  // Call the objects update function
119  o_it->update();
120 
121  }
122  } else {
123  // just inform the plugins as we don't do anything else (Do deprecated and new updatedObjects here)
124  emit signalObjectUpdated(_identifier);
125  emit signalObjectUpdated(_identifier, _type);
126  }
127 
128 
129  // If we have an single object, call it's update function
130  if ( object != 0 )
131  object->update(_type);
132 
133  // Reenable redraws
134  OpenFlipper::Options::redrawDisabled(false);
135 
136 
137  // Reset scenegraph but keep scene center!
138  resetScenegraph(false);
139 
140  updateView();
141 }
142 
144 
145  // tell plugins
146  emit visibilityChanged( _id );
147 
148  // Reset scenegraph but keep scene center!
149  resetScenegraph(false);
150 
151  updateView();
152 }
153 
157 {
158  // just inform the plugins as we don't do anything else
159  emit objectSelectionChanged(_id);
160 
161  // Send via second interface
163 
164  updateView();
165 }
166 
168 {
169  emit objectPropertiesChanged(_id);
170 }
171 
172 //========================================================================================
173 // === Texture Communication ===========================
174 //========================================================================================
175 
176 
180 void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension, int _id) {
181 
182  if (QThread::currentThread() != QApplication::instance()->thread())
183  {
184  //execute method in main thread
185  QMetaObject::invokeMethod(this,"slotAddTexture",Qt::BlockingQueuedConnection, Q_ARG(QString, _textureName), Q_ARG(QString, _filename), Q_ARG(uint, _dimension), Q_ARG(int, _id));
186  return;
187  }
188 
189  if ( OpenFlipper::Options::doSlotDebugging() ) {
190  if ( sender() != 0 ) {
191  if ( sender()->metaObject() != 0 ) {
192  emit log(LOGINFO,"addTexture( " + _textureName + "," + _filename + "," + QString::number(_dimension) + ", " + QString::number(_id) + tr(" ) called by ") +
193  QString( sender()->metaObject()->className() ) );
194  }
195  } else {
196  emit log(LOGINFO,"addTexture( " + _textureName + "," + _filename + "," + QString::number(_dimension) + ", " + QString::number(_id) + tr(" ) called by Core") );
197  }
198  }
199 
200  emit addTexture(_textureName , _filename,_dimension,_id);
201 }
202 
206 void Core::slotAddTexture( QString _textureName , QImage _image, uint _dimension, int _id) {
207 
208  if (QThread::currentThread() != QApplication::instance()->thread())
209  {
210  //execute method in main thread
211  QMetaObject::invokeMethod(this,"slotAddTexture",Qt::BlockingQueuedConnection, Q_ARG(QString, _textureName), Q_ARG(QImage, _image), Q_ARG(uint, _dimension), Q_ARG(int, _id));
212  return;
213  }
214 
215  if ( OpenFlipper::Options::doSlotDebugging() ) {
216  if ( sender() != 0 ) {
217  if ( sender()->metaObject() != 0 ) {
218  emit log(LOGINFO,"addTexture( " + _textureName + ",QImage," + QString::number(_dimension) + ", " + QString::number(_id) + tr(" ) called by ") +
219  QString( sender()->metaObject()->className() ) );
220  }
221  } else {
222  emit log(LOGINFO,"addTexture( " + _textureName + ",image," + QString::number(_dimension) + ", " + QString::number(_id) + tr(" ) called by Core") );
223  }
224  }
225 
226  emit addTexture(_textureName , _image,_dimension,_id);
227 }
228 
232 void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension) {
233 
234  if (QThread::currentThread() != QApplication::instance()->thread())
235  {
236  //execute method in main thread
237  QMetaObject::invokeMethod(this,"slotAddTexture",Qt::BlockingQueuedConnection, Q_ARG(QString, _textureName), Q_ARG(QString, _filename), Q_ARG(uint, _dimension));
238  return;
239  }
240 
241  if ( OpenFlipper::Options::doSlotDebugging() ) {
242  if ( sender() != 0 ) {
243  if ( sender()->metaObject() != 0 ) {
244  emit log(LOGINFO,"slotAddTexture( " + _textureName + "," + _filename + "," + QString::number(_dimension) + tr(" ) called by ") +
245  QString( sender()->metaObject()->className() ) );
246  }
247  } else {
248  emit log(LOGINFO,"slotAddTexture( " + _textureName + "," + _filename + "," +", " + QString::number(_dimension) + tr(" ) called by Core") );
249  }
250  }
251 
252  emit addTexture(_textureName , _filename,_dimension);
253 }
254 
258 void Core::slotAddTexture( QString _textureName , QImage _image, uint _dimension) {
259 
260  if (QThread::currentThread() != QApplication::instance()->thread())
261  {
262  //execute method in main thread
263  QMetaObject::invokeMethod(this,"slotAddTexture",Qt::BlockingQueuedConnection, Q_ARG(QString, _textureName), Q_ARG(QImage, _image), Q_ARG(uint, _dimension));
264  return;
265  }
266 
267  if ( OpenFlipper::Options::doSlotDebugging() ) {
268  if ( sender() != 0 ) {
269  if ( sender()->metaObject() != 0 ) {
270  emit log(LOGINFO,"slotAddTexture( " + _textureName + ",_image," + QString::number(_dimension) + tr(" ) called by ") +
271  QString( sender()->metaObject()->className() ) );
272  }
273  } else {
274  emit log(LOGINFO,"slotAddTexture( " + _textureName + ",_image," +", " + QString::number(_dimension) + tr(" ) called by Core") );
275  }
276  }
277 
278  emit addTexture(_textureName , _image,_dimension);
279 }
280 
284 void Core::slotUpdateTexture( QString _name , int _identifier){
285 
286  if ( OpenFlipper::Options::doSlotDebugging() ) {
287  if ( sender() != 0 ) {
288  if ( sender()->metaObject() != 0 ) {
289  emit log(LOGINFO,"slotUpdateTexture( " + _name + " , " + QString::number(_identifier) + tr(" ) called by ") +
290  QString( sender()->metaObject()->className() ) );
291  }
292  }
293  }
294 
295  emit updateTexture(_name, _identifier);
296 }
297 
298 void Core::slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int* _textureId ) {
299  slotMultiTextureAdded(_textureGroup, _name, _filename, _id, *_textureId);
300 }
301 
302 void Core::slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {
303 
304  if (QThread::currentThread() != QApplication::instance()->thread())
305  {
306  //execute method in main thread
307  QMetaObject::invokeMethod(this,"slotMultiTextureAdded",Qt::BlockingQueuedConnection, Q_ARG(QString, _textureGroup), Q_ARG(QString, _name), Q_ARG(QString, _filename), Q_ARG(int, _id), Q_ARG(int*, &_textureId));
308  return;
309  }
310 
311  if ( OpenFlipper::Options::doSlotDebugging() ) {
312  if ( sender() != 0 ) {
313  if ( sender()->metaObject() != 0 ) {
314  emit log(LOGINFO,"slotMultiTextureAdded( " + _textureGroup + ", " + _name + "," + _filename + "," + QString::number(_id) + tr(" ) called by ") +
315  QString( sender()->metaObject()->className() ) );
316  }
317  } else {
318  emit log(LOGINFO,"slotMultiTextureAdded( " + _textureGroup + ", " + _name + "," + _filename + "," + QString::number(_id) + tr(" ) called by Core") );
319  }
320  }
321 
322  emit addMultiTexture( _textureGroup , _name , _filename , _id , _textureId );
323 }
324 
325 void Core::slotMultiTextureAdded( QString _textureGroup , QString _name , QImage _image , int _id , int& _textureId ) {
326 
327  if (QThread::currentThread() != QApplication::instance()->thread())
328  {
329  //execute method in main thread
330  QMetaObject::invokeMethod(this,"slotMultiTextureAdded",Qt::BlockingQueuedConnection, Q_ARG(QString, _textureGroup), Q_ARG(QString, _name), Q_ARG(QImage, _image), Q_ARG(int, _id), Q_ARG(int*, &_textureId));
331  return;
332  }
333 
334  if ( OpenFlipper::Options::doSlotDebugging() ) {
335  if ( sender() != 0 ) {
336  if ( sender()->metaObject() != 0 ) {
337  emit log(LOGINFO,"slotMultiTextureAdded( " + _textureGroup + ", " + _name + ",_image," + QString::number(_id) + tr(" ) called by ") +
338  QString( sender()->metaObject()->className() ) );
339  }
340  } else {
341  emit log(LOGINFO,"slotMultiTextureAdded( " + _textureGroup + ", " + _name + ",_image," + QString::number(_id) + tr(" ) called by Core") );
342  }
343  }
344 
345  emit addMultiTexture( _textureGroup , _name , _image , _id , _textureId );
346 }
347 
352  emit updateAllTextures();
353 }
354 
358 void Core::slotSetTextureMode(QString _textureName, QString _mode, int _id) {
359 
360  if ( OpenFlipper::Options::doSlotDebugging() ) {
361  if ( sender() != 0 ) {
362  if ( sender()->metaObject() != 0 ) {
363  emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + " , " + QString::number(_id) + tr(" ) called by ") +
364  QString( sender()->metaObject()->className() ) );
365  }
366  }
367  }
368 
369  emit setTextureMode(_textureName,_mode,_id);
370 }
371 
375 void Core::slotSetTextureMode(QString _textureName ,QString _mode) {
376 
377  if ( OpenFlipper::Options::doSlotDebugging() ) {
378  if ( sender() != 0 ) {
379  if ( sender()->metaObject() != 0 ) {
380  emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + tr(" ) called by ") +
381  QString( sender()->metaObject()->className() ) );
382  }
383  }
384  }
385 
386  emit setTextureMode(_textureName,_mode);
387 }
388 
392 void Core::slotTextureUpdated( QString _textureName , int _identifier ) {
393  if ( OpenFlipper::Options::doSlotDebugging() ) {
394  if ( sender() != 0 ) {
395  if ( sender()->metaObject() != 0 ) {
396  emit log(LOGINFO,"slotTextureUpdated( " + _textureName + " , " + QString::number(_identifier) + tr(" ) called by ") +
397  QString( sender()->metaObject()->className() ) );
398  }
399  }
400  }
401  emit updatedTextures(_textureName,_identifier);
402 }
403 
406 void Core::slotSwitchTexture( QString _textureName, int _id ) {
407  if ( OpenFlipper::Options::doSlotDebugging() ) {
408  if ( sender() != 0 ) {
409  if ( sender()->metaObject() != 0 ) {
410  emit log(LOGINFO,"switchTexture( " + _textureName + " , " + QString::number(_id) + tr(" ) called by ") +
411  QString( sender()->metaObject()->className() ) );
412  }
413  }
414  }
415  emit switchTexture(_textureName, _id);
416 }
417 
420 void Core::slotSwitchTexture( QString _textureName ) {
421  if ( OpenFlipper::Options::doSlotDebugging() ) {
422  if ( sender() != 0 ) {
423  if ( sender()->metaObject() != 0 ) {
424  emit log(LOGINFO,"switchTexture( " + _textureName + tr(" ) called by ") +
425  QString( sender()->metaObject()->className() ) );
426  }
427  }
428  }
429  emit switchTexture(_textureName);
430 }
431 
432 
435 void Core::slotTextureChangeImage( QString _textureName , QImage& _image ) {
436  emit textureChangeImage( _textureName ,_image );
437 }
438 
441 void Core::slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {
442  emit textureChangeImage( _textureName , _image , _id );
443 }
444 
447 void Core::slotTextureGetImage( QString _textureName , QImage& _image ) {
448  emit textureGetImage( _textureName ,_image );
449 }
450 
453 void Core::slotTextureGetImage( QString _textureName , QImage& _image , int _id ) {
454  emit textureGetImage( _textureName , _image , _id );
455 }
456 
459 void Core::slotTextureIndex( QString _textureName, int _id, int& _index){
460  emit textureIndex( _textureName, _id, _index);
461 }
462 
465 void Core::slotTextureIndexPropertyName( int _id, QString& _propertyName){
466  emit textureIndexPropertyName( _id, _propertyName);
467 }
468 
471 void Core::slotTextureName( int _id, int _textureIndex, QString& _textureName){
472  emit textureName( _id, _textureIndex, _textureName);
473 }
474 
477 void Core::slotTextureFilename( int _id, QString _textureName, QString& _textureFilename){
478  emit textureFilename( _id, _textureName, _textureFilename);
479 }
480 
483 void Core::slotGetCurrentTexture( int _id, QString& _textureName ){
484  emit getCurrentTexture( _id, _textureName );
485 }
486 
489 void Core::slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ){
490  emit getSubTextures( _id, _multiTextureName, _subTextures );
491 }
492 
493 //========================================================================================
494 // === Object Manager ============================
495 //========================================================================================
496 
498 void Core::newObject(int _objectId) {
499 
500  BaseObject* baseObject = 0;
501  PluginFunctions::getObject(_objectId,baseObject);
502 
503  if ( baseObject ) {
504  connect( baseObject, SIGNAL(visibilityChanged(int)), this, SLOT(slotVisibilityChanged(int)), Qt::DirectConnection) ;
505  connect( baseObject, SIGNAL(objectSelectionChanged(int)), this, SLOT(slotObjectSelectionChanged(int)), Qt::DirectConnection );
506  connect( baseObject, SIGNAL(objectPropertiesChanged(int)), this, SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection );
507  } else {
508  emit log(LOGERR,tr("newObject received from objectManager with invalid id! This should not happen. The new Object will not work correctly!"));
509  }
510 
511 }
512 
514 void Core::deletedObject(int /*_objectId*/) {
515 }
516 
517 
518 //========================================================================================
519 // === Cross Plugin connections ============================
520 //========================================================================================
521 
523 void connectPlugins( Core* c, const std::vector<PluginInfo>& plugins_, QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot, bool _queued)
524 {
525  QObject* plugin1 = 0;
526  QObject* plugin2 = 0;
527 
528  for ( int i = 0 ; i < (int)plugins_.size(); ++i ) {
529  if ( plugins_[i].rpcName == _pluginName1 ) {
530  plugin1 = plugins_[i].plugin;
531  }
532  if ( plugins_[i].rpcName == _pluginName2 ) {
533  plugin2 = plugins_[i].plugin;
534  }
535  }
536 
537  if ( plugin1 == 0 ) {
538  emit c->log(LOGERR,QObject::tr("Cross Plugin Interconnection failed because plugin %1 was not found!").arg(_pluginName1));
539  return;
540  }
541 
542  if ( plugin2 == 0 ) {
543  emit c->log(LOGERR,QObject::tr("Cross Plugin Interconnection failed because plugin %1 was not found!").arg(_pluginName2));
544  return;
545  }
546 
547  // now connect them
548  if(_queued)
549  QObject::connect(plugin1,_signal,plugin2,_slot, Qt::QueuedConnection);
550  else
551  QObject::connect(plugin1,_signal,plugin2,_slot);
552 }
553 
554 void Core::slotCrossPluginConnect( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) {
555  connectPlugins(this, plugins(), _pluginName1, _signal, _pluginName2, _slot, false);
556 }
557 
558 void Core::slotCrossPluginConnectQueued( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) {
559  connectPlugins(this, plugins(), _pluginName1, _signal, _pluginName2, _slot, true);
560 }
561 
562 //========================================================================================
563 // === Renderer Settings ============================
564 //========================================================================================
565 void Core::slotSetRenderer(unsigned int _viewer, QString _rendererName) {
566  renderManager().setActive(_rendererName,_viewer);
567 }
568 
569 void Core::slotGetCurrentRenderer(unsigned int _viewer, QString& _rendererName) {
570  _rendererName = renderManager().active(_viewer)->name;
571 }
572 
573 void Core::slotMetadataDeserialized(
574  const QVector<QPair<QString, QString> > &data) {
575 
576  QString obj_metadata;
577  for (QVector<QPair<QString, QString> >::const_iterator
578  it = data.begin(); it != data.end(); ++it) {
579  if (it->first == "Mesh Comments")
580  obj_metadata = it->second;
581 
582  emit genericMetadataDeserialized(it->first, it->second);
583  }
584 
585  /*
586  * Now handle object metadata.
587  */
588  QRegExp re_begin("BEGIN Comments for object \"([^\\n]*)\"");
589  QRegExp re_end("\\nEND Comments for object \"([^\\n]*)\"");
590  enum STATE {
591  STATE_SEARCH_BEGIN,
592  STATE_CONSUME_INNER,
593  STATE_EOS,
594  };
595 
596  int cursor = 0;
597  QString current_object_name;
598  for (STATE state = STATE_SEARCH_BEGIN; state != STATE_EOS; ) {
599  switch (state) {
600  case STATE_SEARCH_BEGIN:
601  cursor = re_begin.indexIn(obj_metadata, cursor);
602  if (cursor == -1) {
603  state = STATE_EOS;
604  break;
605  }
606  current_object_name = re_begin.cap(1);
607  cursor += re_begin.matchedLength();
608  state = STATE_CONSUME_INNER;
609  break;
610  case STATE_CONSUME_INNER:
611  {
612  int next = re_end.indexIn(obj_metadata, cursor);
613  if (next == -1) {
614  state = STATE_EOS;
615  break;
616  }
617 
618  const QStringRef value = obj_metadata.midRef(cursor, next - cursor);
619 
620  emit objectMetadataDeserialized(current_object_name, value.toString());
621  QJsonParseError json_error;
622  QJsonDocument json_doc =
623  QJsonDocument::fromJson(value.toUtf8(), &json_error);
624  if (json_error.error == QJsonParseError::NoError) {
625  emit objectMetadataDeserializedJson(
626  current_object_name, json_doc);
627  }
628  cursor = next + re_end.matchedLength();
629  state = STATE_SEARCH_BEGIN;
630  break;
631  }
632  default:
633  throw std::logic_error("metadataDeserialized(): Invalid state.");
634  }
635  }
636 }
637 
638 //=============================================================================
void slotTextureChangeImage(QString _textureName, QImage &_image)
Called by plugins if texture image should be changed.
QString name
Name of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:67
void objectPropertiesChanged(int _id)
Tell plugins that object properties such as object names have been changed.
Update type class.
Definition: UpdateType.hh:60
void slotObjectUpdated(int _identifier, const UpdateType &_type=UPDATE_ALL)
Called by the plugins if they changed something in the object list (deleted, added, or other property changes)
void textureIndex(QString _textureName, int _id, int &_index)
get the texture index
void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the texture&#39;s filename
void addTexture(QString, QString, uint, int)
The texture with the given name and filename has been added.
void textureChangeImage(QString _textureName, QImage &_image)
Change the image for a given texture.
void textureGetImage(QString _textureName, QImage &_image)
fetch texture image
void signalObjectUpdated(int)
When this Signal is emitted all Plugins are informed that the object list changed.
void visibilityChanged(int _id)
Tell plugins that the visibility of an object has changed.
void slotCrossPluginConnect(QString _pluginName1, const char *_signal, QString _pluginName2, const char *_slot)
Called to create inter plugin connections.
Definition: Core.hh:132
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
void slotSwitchTexture(QString _textureName, int _id)
Tells Plugins to switch to the given Texture.
void slotSetRenderer(unsigned int _viewer, QString _rendererName)
called to switch the renderer for a specific viewer
void objectSelectionChanged(int)
This signal is emitted if the object has been changed (source/target)
void addMultiTexture(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
The texture with the given name and filename has been added.
void slotUpdateTexture(QString _name, int _identifier)
Tell the plugins to update the given texture.
void slotGetCurrentTexture(int _id, QString &_textureName)
Called by plugins if current texture should be retrieved.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
const UpdateType UPDATE_STATE(UpdateTypeSet(1)<< 12)
State has changed.
void slotObjectPropertiesChanged(int _id)
Called by plugins if object properties like names have changed.
void updatedTextures(QString, int)
This Signal is send to the plugins if a texture has been updated.
const QStringList ALL_OBJECTS
Iterable object range.
void slotSetTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
void slotTextureIndex(QString _textureName, int _id, int &_index)
Called by plugins if texture index should be fetched.
void slotTextureName(int _id, int _textureIndex, QString &_textureName)
Called by plugins if texture name should be fetched.
void slotTextureGetImage(QString _textureName, QImage &_image)
Called by plugins if texture image should be fetched.
void updateTexture(QString, int)
Tell the plugins to update the given texture.
void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Called by plugins if texture index property name should be fetched.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
void textureName(int _id, int _textureIndex, QString &_textureName)
get the texture name
void slotVisibilityChanged(int _id)
Called when a plugin changes the visibility of an object.
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
Definition: Core.cc:720
void updateAllTextures()
Update all textures in the plugins.
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
RendererInfo * active(int _id)
Get the current active renderer.
void updateView()
Called when a plugin requests an update in the viewer.
Definition: Core.cc:898
void setActive(unsigned int _active, int _id)
set the active renderer
void setTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
QString updateTypeName(UpdateType _id)
Get the name of a type with given id.
Definition: UpdateType.cc:267
void slotTextureUpdated(QString _textureName, int _identifier)
A Texture has been updated.
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
void textureIndexPropertyName(int _id, QString &_propertyName)
get the texture index property name
void slotObjectSelectionChanged(int _id)
Called by Plugins if they changed the active object.
void slotAddTexture(QString _textureName, QString _filename, uint _dimension, int _id)
Called by a plugin if it creates a texture.
void getCurrentTexture(int _id, QString &_textureName)
get current texture
void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get a multi-texture&#39;s sub textures
void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
Called by plugins if texture name should be fetched.
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
void slotGetCurrentRenderer(unsigned int _viewer, QString &_rendererName)
called to get the currently active renderer renderer for a specific viewer
void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
Called by a plugin if it creates a multitexture.
void slotGetSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
Called by plugins if a multi-texture&#39;s sub textures should be fetched.
void slotCrossPluginConnectQueued(QString _pluginName1, const char *_signal, QString _pluginName2, const char *_slot)
Called to create inter plugin connections.
void resetScenegraph(bool _resetTrackBall)
void switchTexture(QString, int)
Switch Texture Plugins to a given Mode.
void slotUpdateAllTextures()
Update all textures in the plugins.