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
112 for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS,DATA_ALL ) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
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
143 void Core::slotVisibilityChanged( int _id ) {
144
145 // tell plugins
146 emit visibilityChanged( _id );
147
148 // Reset scenegraph but keep scene center!
149 resetScenegraph(false);
150
151 updateView();
152 }
153
156 void Core::slotObjectSelectionChanged( int _id )
157 {
158 // just inform the plugins as we don't do anything else
159 emit objectSelectionChanged(_id);
160
161 // Send via second interface
162 emit signalObjectUpdated(_id,UPDATE_STATE);
163
164 updateView();
165 }
166
167 void Core::slotObjectPropertiesChanged( int _id )
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
351 void Core::slotUpdateAllTextures( ){
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 //=============================================================================
LOGWARN
Definition: LoggingInterface.hh:95
Core::slotTextureChangeImage
void slotTextureChangeImage(QString _textureName, QImage &_image)
Called by plugins if texture image should be changed.
Definition: PluginCommunication.cc:435
RendererInfo::name
QString name
Name of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:67
Core::objectPropertiesChanged
void objectPropertiesChanged(int _id)
Tell plugins that object properties such as object names have been changed.
LOGINFO
Definition: LoggingInterface.hh:94
UpdateType
Update type class.
Definition: UpdateType.hh:60
Core::slotObjectUpdated
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)
Definition: PluginCommunication.cc:75
Core::textureIndex
void textureIndex(QString _textureName, int _id, int &_index)
get the texture index
Core::textureFilename
void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the texture&#39;s filename
Core::addTexture
void addTexture(QString, QString, uint, int)
The texture with the given name and filename has been added.
Core::textureChangeImage
void textureChangeImage(QString _textureName, QImage &_image)
Change the image for a given texture.
Core::textureGetImage
void textureGetImage(QString _textureName, QImage &_image)
fetch texture image
Core::signalObjectUpdated
void signalObjectUpdated(int)
When this Signal is emitted all Plugins are informed that the object list changed.
Core::visibilityChanged
void visibilityChanged(int _id)
Tell plugins that the visibility of an object has changed.
Core::slotCrossPluginConnect
void slotCrossPluginConnect(QString _pluginName1, const char *_signal, QString _pluginName2, const char *_slot)
Called to create inter plugin connections.
Definition: PluginCommunication.cc:554
Core
Definition: Core.hh:132
Core::deletedObject
void deletedObject(int _objectId)
This slot is called by the object manager when an object is deleted.
Definition: PluginCommunication.cc:514
Core::slotSwitchTexture
void slotSwitchTexture(QString _textureName, int _id)
Tells Plugins to switch to the given Texture.
Definition: PluginCommunication.cc:406
Core::slotSetRenderer
void slotSetRenderer(unsigned int _viewer, QString _rendererName)
called to switch the renderer for a specific viewer
Definition: PluginCommunication.cc:565
Core.hh
Core::objectSelectionChanged
void objectSelectionChanged(int)
This signal is emitted if the object has been changed (source/target)
Core::addMultiTexture
void addMultiTexture(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
The texture with the given name and filename has been added.
Core::slotUpdateTexture
void slotUpdateTexture(QString _name, int _identifier)
Tell the plugins to update the given texture.
Definition: PluginCommunication.cc:284
Core::slotGetCurrentTexture
void slotGetCurrentTexture(int _id, QString &_textureName)
Called by plugins if current texture should be retrieved.
Definition: PluginCommunication.cc:483
Core::log
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
UPDATE_STATE
const UpdateType UPDATE_STATE(UpdateTypeSet(1)<< 12)
State has changed.
Core::slotObjectPropertiesChanged
void slotObjectPropertiesChanged(int _id)
Called by plugins if object properties like names have changed.
Definition: PluginCommunication.cc:167
Core::updatedTextures
void updatedTextures(QString, int)
This Signal is send to the plugins if a texture has been updated.
PluginFunctions::ALL_OBJECTS
const QStringList ALL_OBJECTS
Iterable object range.
Definition: PluginFunctions.hh:430
LOGERR
Definition: LoggingInterface.hh:96
Core::slotSetTextureMode
void slotSetTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
Definition: PluginCommunication.cc:358
Core::slotTextureIndex
void slotTextureIndex(QString _textureName, int _id, int &_index)
Called by plugins if texture index should be fetched.
Definition: PluginCommunication.cc:459
Core::slotTextureName
void slotTextureName(int _id, int _textureIndex, QString &_textureName)
Called by plugins if texture name should be fetched.
Definition: PluginCommunication.cc:471
Core::slotTextureGetImage
void slotTextureGetImage(QString _textureName, QImage &_image)
Called by plugins if texture image should be fetched.
Definition: PluginCommunication.cc:447
Core::updateTexture
void updateTexture(QString, int)
Tell the plugins to update the given texture.
Core::slotTextureIndexPropertyName
void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Called by plugins if texture index property name should be fetched.
Definition: PluginCommunication.cc:465
PluginFunctions::getObject
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Definition: PluginFunctions.cc:294
Core::textureName
void textureName(int _id, int _textureIndex, QString &_textureName)
get the texture name
Core::slotVisibilityChanged
void slotVisibilityChanged(int _id)
Called when a plugin changes the visibility of an object.
Definition: PluginCommunication.cc:143
Core::plugins
std::vector< PluginInfo > & plugins()
Index of Plugins toolbox widget.
Definition: Core.cc:720
Core::updateAllTextures
void updateAllTextures()
Update all textures in the plugins.
Core::newObject
void newObject(int _objectId)
This slot is called by the object manager when a new object is created.
Definition: PluginCommunication.cc:498
RenderManager::active
RendererInfo * active(int _id)
Get the current active renderer.
Definition: RendererInfo.cc:182
Core::updateView
void updateView()
Called when a plugin requests an update in the viewer.
Definition: Core.cc:898
RenderManager::setActive
void setActive(unsigned int _active, int _id)
set the active renderer
Definition: RendererInfo.cc:145
Core::setTextureMode
void setTextureMode(QString _textureName, QString _mode, int _id)
A texture mode should be changed.
updateTypeName
QString updateTypeName(UpdateType _id)
Get the name of a type with given id.
Definition: UpdateType.cc:267
PluginFunctions::ObjectIterator
Core Data Iterator.
Definition: PluginFunctions.hh:441
Core::slotTextureUpdated
void slotTextureUpdated(QString _textureName, int _identifier)
A Texture has been updated.
Definition: PluginCommunication.cc:392
PluginFunctions::objectsEnd
DLLEXPORT ObjectIterator objectsEnd()
Return Iterator to Object End.
Definition: PluginFunctionsIterator.cc:177
BaseObject
Definition: BaseObject.hh:82
Core::textureIndexPropertyName
void textureIndexPropertyName(int _id, QString &_propertyName)
get the texture index property name
Core::slotObjectSelectionChanged
void slotObjectSelectionChanged(int _id)
Called by Plugins if they changed the active object.
Definition: PluginCommunication.cc:156
Core::slotAddTexture
void slotAddTexture(QString _textureName, QString _filename, uint _dimension, int _id)
Called by a plugin if it creates a texture.
Definition: PluginCommunication.cc:180
Core::getCurrentTexture
void getCurrentTexture(int _id, QString &_textureName)
get current texture
Core::getSubTextures
void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get a multi-texture&#39;s sub textures
Core::slotTextureFilename
void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
Called by plugins if texture name should be fetched.
Definition: PluginCommunication.cc:477
DATA_ALL
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
Core::slotGetCurrentRenderer
void slotGetCurrentRenderer(unsigned int _viewer, QString &_rendererName)
called to get the currently active renderer renderer for a specific viewer
Definition: PluginCommunication.cc:569
Core::slotMultiTextureAdded
void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
Called by a plugin if it creates a multitexture.
Definition: PluginCommunication.cc:302
Core::slotGetSubTextures
void slotGetSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
Called by plugins if a multi-texture&#39;s sub textures should be fetched.
Definition: PluginCommunication.cc:489
Core::slotCrossPluginConnectQueued
void slotCrossPluginConnectQueued(QString _pluginName1, const char *_signal, QString _pluginName2, const char *_slot)
Called to create inter plugin connections.
Definition: PluginCommunication.cc:558
Core::resetScenegraph
void resetScenegraph(bool _resetTrackBall)
Definition: openFunctions.cc:62
Core::switchTexture
void switchTexture(QString, int)
Switch Texture Plugins to a given Mode.
Core::slotUpdateAllTextures
void slotUpdateAllTextures()
Update all textures in the plugins.
Definition: PluginCommunication.cc:351