Developer Documentation
BaseObject.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// MyTypes
46//
47//=============================================================================
48
49
50//== INCLUDES =================================================================
51
52#include "BaseObjectCore.hh"
53#include "Types.hh"
54#include <OpenFlipper/BasePlugin/PluginFunctionsCore.hh>
56
57#include <QJsonDocument>
58#include <QJsonObject>
59
60
61//== TYPEDEFS =================================================================
62
63//== Variables =================================================================
64
65//== CLASS DEFINITION =========================================================
66
70static int idGenerator = 1;
71
76
78 QObject(),
79 id_(idGenerator),
80 persistentId_(_object.persistentId_),
81 objectType_(_object.objectType_),
82 flags_(_object.flags_),
83 visible_(_object.visible_),
84 parentItem_(0),
85 path_("."),
86 filename_(""),
87 name_("Copy of " + _object.name_), // Generate a usable name based on the copied object
88 commentsByKey_(_object.commentsByKey_)
89
90{
91 // Increase id generator as we created a new object
92 ++idGenerator;
93
94 childItems_.clear();
95 dataMap_.clear();
96
97 // Iterate over all per Object datas and try to copy them
98 QMap< QString, PerObjectData* >::const_iterator mapIter = _object.dataMap_.begin();
99 while ( mapIter != _object.dataMap_.end() ) {
100 // Try to get a copy of the object.
101 PerObjectData* copiedData = mapIter.value()->copyPerObjectData();
102
103 if ( copiedData ) {
104 dataMap_.insert(mapIter.key(),copiedData);
105 } else {
106 std::cerr << "Failed to copy per Object Data: " << mapIter.key().toStdString() << std::endl;
107 }
108
109 ++mapIter;
110 }
111
112 // If the pointer is 0 then we are creating the object root
113 // and we do not have anything to attach this object to
114 // otherwise, we attach the new object to the object root
116
119
120 // New object
122
123 // If the new one is target, we also have to track this
124 if ( target() )
126 }
127
128 // Add object to object container
130
131 getObjectManager()->objectCreated(id());
132}
133
135 QObject() ,
136 id_(-1),
137 persistentId_(-1),
138 objectType_(DATA_UNKNOWN),
139 flags_(),
140 visible_(true),
141 parentItem_(_parent),
142 name_("NONAME")
143{
144 id_ = idGenerator;
145 ++ idGenerator;
146
147 // If the pointer is 0 then something went wrong or we are the root node
148 if ( _parent ) {
149
150 _parent->appendChild(this);
152
153 } else {
154
159 }
160
161 }
162
163 // Add object to object container
165
166 getObjectManager()->objectCreated(id());
167}
168
169
170BaseObject::~BaseObject() {
171
172 deleteData();
173
175
176 if ( target() )
178
179 getObjectManager()->objectDeleted(id());
180
181}
182
183
184// ===============================================================================
185// Object Identification
186// ===============================================================================
187
188int BaseObject::id() const {
189 return id_;
190}
191
193 return persistentId_;
194}
195
197 persistentId_ = _id;
198}
199
200
201// ===============================================================================
202// Data
203// ===============================================================================
204
206 persistentId_ = -1;
207 path_ = ".";
208 flags_.clear();
209
210 visible_ = true;
211 name_ = "NONAME";
212 filename_ = "";
213}
214
215// ===============================================================================
216// Data Type Handling
217// ===============================================================================
218
220 if ( _type == DATA_ALL ) {
221 return true;
222 }
223
224 return ( objectType_ & _type);
225}
226
229}
230
232 if ( objectType_ != DATA_UNKNOWN )
233 std::cerr << "BaseObect : overwriting data type" << std::endl;
234 objectType_ = _type;
235}
236
237// ===============================================================================
238// Object Information
239// ===============================================================================
240
241
243 QString output;
244
245 output += "Info for Object with id " + QString::number(id()) +"\n";
246 output += "Object is : ";
247 if ( target() )
248 output += "target ";
249 if ( source() )
250 output += " source";
251
252 if ( visible() )
253 output += " visible";
254 else
255 output += " invisible";
256
257 output +="\n";
258
259 return output;
260}
261
263 std::cout << getObjectinfo().toStdString();
264}
265
266
267// ===============================================================================
268// flag Handling
269// ===============================================================================
270
272 return flag("target");
273}
274
275void BaseObject::target(bool _target) {
276
277 if ( target() != _target ) {
278
279 if ( _target )
281 else
283 }
284
285 setFlag("target", _target);
286
287}
288
290 return flag("source");
291}
292
293void BaseObject::source(bool _source) {
294 setFlag("source", _source);
295}
296
297bool BaseObject::flag(QString _flag)
298{
299 return flags_.contains(_flag);
300}
301
302void BaseObject::setFlag(QString _flag, bool _set)
303{
304 bool emitted = false;
305
306 if (flags_.contains(_flag))
307 {
308 if (!_set) {
309 flags_.removeAll(_flag);
310 emit objectSelectionChanged(id());
311 emitted = true;
312 }
313 }
314 else
315 {
316 if (_set) {
317 flags_ << _flag;
318 emit objectSelectionChanged(id());
319 emitted = true;
320 }
321 }
322
323 //always emit if its a group
324 if ( !emitted && isGroup() )
325 emit objectSelectionChanged(id());
326}
327
328QStringList BaseObject::flags()
329{
330 return flags_;
331}
332
333// ===============================================================================
334// Object visualization
335// ===============================================================================
336
338 return visible_;
339}
340
341void BaseObject::visible(bool _visible) {
342 // Only do something if this is really a change
343 if ( visible_ != _visible ) {
344 visible_ = _visible;
345
346 emit visibilityChanged( id() );
347
348 } else {
349
350 //always emit if its a group
351 if ( isGroup() )
352 emit visibilityChanged( id() );
353 }
354}
355
356// ===============================================================================
357// ===============================================================================
358// Tree Structure :
359// ===============================================================================
360// ===============================================================================
361
363 //indexOf
364
365// // Visit child item of this node
366// if ( childItems_.size() > 0 ) {
367// return childItems_[0];
368// }
369//
370// // No Child Item so visit the next child of the parentItem_
371// if ( parentItem_ ) {
372//
373// BaseObject* parentPointer = parentItem_;
374// BaseObject* thisPointer = this;
375//
376// // while we are not at the root node
377// while ( parentPointer ) {
378//
379// // If there is an unvisited child of the parent, return this one
380// if ( parentPointer->childCount() > ( thisPointer->row() + 1) ) {
381// return parentPointer->childItems_[ thisPointer->row() + 1 ];
382// }
383//
384// // Go to the next level
385// thisPointer = parentPointer;
386// parentPointer = parentPointer->parentItem_;
387//
388// }
389//
390// return thisPointer;
391// }
392//
393// return this;
394 std::cerr << "Last not implemented yet! " << std::endl;
395 return 0;
396
397}
398
399// ===============================================================================
400// ===============================================================================
401
403 // Visit child item of this node
404 if ( childItems_.size() > 0 ) {
405 return childItems_[0];
406 }
407
408 // No Child Item so visit the next child of the parentItem_
409 if ( parentItem_ ) {
410
411 BaseObject* parentPointer = parentItem_;
412 BaseObject* thisPointer = this;
413
414 // while we are not at the root node
415 while ( parentPointer ) {
416
417 // If there is an unvisited child of the parent, return this one
418 int nextIndex = ( thisPointer->row() + 1);
419 if ( parentPointer->childCount() > nextIndex ) {
420 return parentPointer->childItems_[ nextIndex ];
421 }
422
423 // Go to the next level
424 thisPointer = parentPointer;
425 parentPointer = parentPointer->parentItem_;
426
427 }
428
429 return thisPointer;
430 }
431
432 return this;
433
434}
435
436// ===============================================================================
437// ===============================================================================
438
440 int level = 0;
441 BaseObject* current = this;
442
443 // Go up and count the levels to the root node
444 while ( current->parent() != 0 ) {
445 level++;
446 current = current->parent();
447 }
448
449 return level;
450}
451
452// ===============================================================================
453// Parent
454// ===============================================================================
455
457{
458 if (parentItem_)
459 return parentItem_->childItems_.indexOf(const_cast<BaseObject*>(this));
460
461 return 0;
462}
463
465{
466 return parentItem_;
467}
468
470{
471 return parentItem_;
472}
473
476 // remove this child from the old parents list
477 if ( parentItem_ != 0 ) {
479
480 if ( !_parent->childItems_.contains(this) )
481 _parent->appendChild(this);
482 }
483
484 // Store new parent
485 parentItem_ = _parent;
486
487 // Tell other plugins about this change
488 emit objectPropertiesChanged(id());
489}
490
491
492// ===============================================================================
493// Children
494// ===============================================================================
495
497{
498 if ( !childItems_.contains(item) )
499 childItems_.append(item);
500 else
501 std::cerr << "Warning! Trying to append a child twice! Remove the append calls from your File plugin!" << std::endl;
502}
503
505{
506 return childItems_.value(row);
507}
508
510{
511 return childItems_.count();
512}
513
515
516 // Check if this object has the requested id
517 if ( id_ == _objectId )
518 return this;
519
520 // search in children
521 for ( int i = 0 ; i < childItems_.size(); ++i ) {
522 BaseObject* tmp = childItems_[i]->childExists(_objectId);
523 if ( tmp != 0)
524 return tmp;
525 }
526
527 return 0;
528}
529
531
532 // Check if this object has the requested id
533 if ( name() == _name )
534 return this;
535
536 // search in children
537 for ( int i = 0 ; i < childItems_.size(); ++i ) {
538 BaseObject* tmp = childItems_[i]->childExists(_name);
539 if ( tmp != 0)
540 return tmp;
541 }
542
543 return 0;
544}
545
547
548 bool found = false;
549 QList<BaseObject*>::iterator i;
550 for (i = childItems_.begin(); i != childItems_.end(); ++i) {
551 if ( *i == _item ) {
552 found = true;
553 break;
554 }
555 }
556
557 if ( !found ) {
558 std::cerr << "Illegal remove request" << std::endl;
559 return;
560 }
561
562 childItems_.erase(i);
563}
564
565QList< BaseObject* > BaseObject::getLeafs() {
566
567 QList< BaseObject* > items;
568
569 for ( int i = 0 ; i < childItems_.size(); ++i ) {
570 items = items + childItems_[i]->getLeafs();
571 }
572
573 // If we are a leave...
574 if ( childCount() == 0 )
575 items.push_back(this);
576
577 return items;
578}
579
581
582 // call function for all children of this node
583 for ( int i = 0 ; i < childItems_.size(); ++i) {
584
585 // remove the subtree recursively
586 childItems_[i]->deleteSubtree();
587
588 // delete child
589 delete childItems_[i];
590 }
591
592 // clear the array
593 childItems_.clear();
594}
595
596// ===============================================================================
597// Grouping
598// ===============================================================================
599int BaseObject::group() const {
600 // Skip root node
601 if ( parent() == 0 )
602 return -1;
603
604 // Dont count root node as a group
605 if ( parent()->parent() == 0 )
606 return -1;
607
608 // Only consider groups
609 if ( !parent()->dataType(DATA_GROUP) )
610 return -1;
611
612 // Get the group id
613 return ( parent()->id() );
614
615}
616
618// return ( (childItems_.size() > 0) || dataType(DATA_GROUP) ) ;
619 return ( dataType(DATA_GROUP) ) ;
620};
621
622
623bool BaseObject::isInGroup( int _id ) const {
624 const BaseObject* current = this;
625
626 // Go up and check for the group id
627 do {
628
629 // Check if we found the id
630 if ( current->id() == _id )
631 return true;
632
633 // Move on to parent object
634 current = current->parent();
635 } while ( current != 0 );
636
637 return false;
638}
639
640bool BaseObject::isInGroup( const QString& _name ) const {
641 const BaseObject* current = this;
642
643 // Go up and check for the group name
644 do {
645
646 // Check if this object is a group and if it has the serach name
647 if ( current->dataType( DATA_GROUP ) && (current->name() == _name) )
648 return true;
649
650 // Move on to parent object
651 current = current->parent();
652
653 } while ( current != 0 );
654
655 return false;
656}
657
658std::vector< int > BaseObject::getGroupIds() {
659 std::vector< int > groups;
660
661 BaseObject* current = this;
662
663 // Go up and collect all groups in the given order
664 do {
665
666 // collect only groups
667 if ( current->dataType( DATA_GROUP ) )
668 // Skip the root Object
669 if ( current->parent() != 0 )
670 groups.push_back( current->id() );
671
672 // Move on to parent object
673 current = current->parent();
674 } while ( current != 0 );
675
676 return groups;
677}
678
680 QStringList groups;
681
682 BaseObject* current = this;
683
684 // Go up and collect all groups in the given order
685 do {
686
687 // collect only groups
688 if ( current->dataType( DATA_GROUP ) )
689 // Skip the root Object
690 if ( current->parent() != 0 )
691 groups.push_back( current->name() );
692
693 // Move on to parent object
694 current = current->parent();
695 } while ( current != 0 );
696
697 return groups;
698}
699
700// ===============================================================================
701// Name and path Handling
702// ===============================================================================
703
704QString BaseObject::filename() const
705{
706 return filename_;
707}
708
709void BaseObject::setFileName(const QString &_filename)
710{
711 filename_ = _filename;
712}
713
714void BaseObject::setFromFileName(const QString &_filename ) {
715 QFileInfo file_info(_filename);
716 setPath(file_info.path());
717 QString filename = file_info.fileName();
719}
720
721void BaseObject::setName(QString _name ) {
722 name_ = _name;
723
724 // Tell plugins about the name change
725 emit objectPropertiesChanged(id());
726}
727
728QString BaseObject::name() const {
729 return name_;
730}
731
732QString BaseObject::path() const {
733 return path_;
734}
735
736void BaseObject::setPath(const QString &_path ) {
737 path_ = _path;
738}
739
740// ===============================================================================
741// Content
742// ===============================================================================
744}
745
747
748 // Add spaces to visualize level
749 for ( int i = 0 ; i < level() ; ++i )
750 std::cerr << " ";
751
752 std::cerr << "Node ";
753 std::cerr << std::string(name().toLatin1());
754
755 std::cerr << " with id : ";
756 std::cerr << id();
757
758 // Write the type of this Object
759 std::cerr << " and type " << typeName(dataType()).toStdString() << std::endl;
760
761 // call function for all children of this node
762 for ( int i = 0 ; i < childItems_.size(); ++i)
763 childItems_[i]->dumpTree();
764
765}
766
768 std::cerr << "Copy not supported by this Object" << std::endl;
769 return 0;
770}
771
772
773// ===============================================================================
774// per Object data functions
775// ===============================================================================
776
777void
779setObjectData( QString _dataName , PerObjectData* _data ) {
780 dataMap_.insert( _dataName, _data );
781}
782
783void
785clearObjectData( QString _dataName ) {
786 if (dataMap_.contains(_dataName))
787 dataMap_.remove(_dataName);
788}
789
790
791bool
793hasObjectData( QString _dataName )
794{
795 return dataMap_.contains(_dataName);
796}
797
798
801objectData( QString _dataName ) {
802 if (dataMap_.contains(_dataName))
803 return dataMap_.value(_dataName);
804 else
805 return 0;
806}
807
808void
810deleteData() {
811
812 for (auto i = dataMap_.begin(); i != dataMap_.end(); ++i)
813 delete i.value();
814
815 dataMap_.clear();
816}
817
818QString& BaseObject::getCommentByKey(const QString &key) {
819 return commentsByKey_[key];
820 }
821
822
823 const QString BaseObject::getCommentByKey(const QString &key) const {
824 return commentsByKey_.value(key);
825 }
826
827
828 bool BaseObject::hasCommentForKey(const QString &key) const {
829 return commentsByKey_.contains(key);
830 }
831
832
834 return !commentsByKey_.empty();
835 }
836
837 void BaseObject::clearComment(const QString &key) {
838 commentsByKey_.remove(key);
839 }
840
842 commentsByKey_.clear();
843 }
844
845
846 const QMap<QString, QString>& BaseObject::getAllComments() const {
847 return commentsByKey_;
848 }
849
850const QString BaseObject::getAllCommentsFlat() const {
851 QStringList result;
852
853 result.append(QString("BEGIN Comments for object \"%1\"").arg(name()));
854
855 /*
856 * Compose JSON parsable object.
857 */
858 QJsonObject comment_obj;
859 for (QMap<QString, QString>::const_iterator it = commentsByKey_.begin(), it_end = commentsByKey_.end();
860 it != it_end; ++it) {
861
862 QJsonParseError json_error;
863 QString test_json_str = QString::fromUtf8("{\"test\": %1}").arg(it.value());
864 QByteArray test_json_ba = test_json_str.toUtf8();
865 QJsonDocument test_json = QJsonDocument::fromJson(test_json_ba, &json_error);
866 if (json_error.error != QJsonParseError::NoError) {
867 comment_obj[it.key()] = it.value();
868 } else {
869 comment_obj[it.key()] = test_json.object().value("test");
870 }
871 }
872 result.append(QString::fromUtf8(QJsonDocument(comment_obj).toJson(QJsonDocument::Indented)));
873
874 result.append(QString("END Comments for object \"%1\"\n").arg(name()));
875
876 return result.join("\n");
877}
878
879
880QMap<QString, PerObjectData*>& BaseObject::getPerObjectDataMap() {
881 return dataMap_;
882}
883
884
885//=============================================================================
const DataType DATA_UNKNOWN(0)
None of the other Objects.
DLLEXPORT QString typeName(DataType _id)
Get the name of a type with given id.
Definition: Types.cc:154
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
const DataType DATA_GROUP(1)
Items used for Grouping.
void setObjectData(QString _dataName, PerObjectData *_data)
Definition: BaseObject.cc:779
QString path_
path to the file from which the object is loaded ( defaults to "." )
Definition: BaseObject.hh:466
int group() const
Definition: BaseObject.cc:599
QStringList getGroupNames()
Definition: BaseObject.cc:679
void clearAllComments()
Get comment for the specified key.
Definition: BaseObject.cc:841
void setPath(const QString &_path)
set the path to the object.
Definition: BaseObject.cc:736
BaseObject * last()
Definition: BaseObject.cc:362
int row() const
get the row of this item from the parent
Definition: BaseObject.cc:456
static int NOOBJECT
Definition: BaseObject.hh:106
virtual QString getObjectinfo()
Get all Info for the Object as a string.
Definition: BaseObject.cc:242
void removeChild(BaseObject *_item)
Remove a child from this object.
Definition: BaseObject.cc:546
QString name() const
return the name of the object. The name defaults to NONAME if unset.
Definition: BaseObject.cc:728
BaseObject(const BaseObject &_object)
Definition: BaseObject.cc:77
virtual void printObjectInfo()
Print all information about the object.
Definition: BaseObject.cc:262
int childCount() const
get the number of children
Definition: BaseObject.cc:509
QList< BaseObject * > getLeafs()
get all leafes of the tree below this object ( These will be all visible objects )
Definition: BaseObject.cc:565
std::vector< int > getGroupIds()
Definition: BaseObject.cc:658
QMap< QString, QString > commentsByKey_
Get comment for the specified key.
Definition: BaseObject.hh:570
void setFileName(const QString &_filename)
set the filename for this object
Definition: BaseObject.cc:709
int level()
Definition: BaseObject.cc:439
QString filename() const
return the filename of the object
Definition: BaseObject.cc:704
BaseObject * parent()
Get the parent item ( 0 if rootitem )
Definition: BaseObject.cc:464
void setFlag(QString _flag, bool _set)
Definition: BaseObject.cc:302
BaseObject * next()
Definition: BaseObject.cc:402
QStringList flags()
Definition: BaseObject.cc:328
void setDataType(DataType _type)
Definition: BaseObject.cc:231
int persistentId_
Persistent ID for this Object.
Definition: BaseObject.hh:141
QString filename_
path to the file from which the object is loaded ( defaults to "." )
Definition: BaseObject.hh:467
int id_
Unique ID for this Object.
Definition: BaseObject.hh:134
void setParent(BaseObject *_parent)
Set the parent pointer.
Definition: BaseObject.cc:475
QStringList flags_
Definition: BaseObject.hh:243
BaseObject * childExists(int _objectId)
Check if the element exists in the subtree of this element.
Definition: BaseObject.cc:514
BaseObject * parentItem_
Parent item or 0 if rootnode.
Definition: BaseObject.hh:332
PerObjectData * objectData(QString _dataName)
Returns the object data pointer.
Definition: BaseObject.cc:801
void visibilityChanged(int _objectId)
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
Definition: BaseObject.cc:743
void deleteSubtree()
delete the whole subtree below this item ( The item itself is not touched )
Definition: BaseObject.cc:580
DataType objectType_
Definition: BaseObject.hh:167
const QMap< QString, QString > & getAllComments() const
Definition: BaseObject.cc:846
void appendChild(BaseObject *child)
add a child to this node
Definition: BaseObject.cc:496
QString & getCommentByKey(const QString &key)
Get comment for the specified key.
Definition: BaseObject.cc:818
void deleteData()
Delete all data attached to this object ( calls delete on each object )
Definition: BaseObject.cc:810
void dumpTree()
Debugging function, writing the subtree to output.
Definition: BaseObject.cc:746
QMap< QString, PerObjectData * > & getPerObjectDataMap()
get reference to map of all perObject Datas
Definition: BaseObject.cc:880
bool dataType(DataType _type) const
Definition: BaseObject.cc:219
DataType dataType() const
Definition: BaseObject.cc:227
bool hasObjectData(QString _dataName)
Checks if object data with given name is available.
Definition: BaseObject.cc:793
virtual BaseObject * copy()
Returns a full copy of the object.
Definition: BaseObject.cc:767
QString name_
Object/FileName ( defaults to NONAME )
Definition: BaseObject.hh:478
QList< BaseObject * > childItems_
Children of this node.
Definition: BaseObject.hh:335
bool isInGroup(int _id) const
Definition: BaseObject.cc:623
bool hasCommentForKey(const QString &key) const
Definition: BaseObject.cc:828
bool visible_
Definition: BaseObject.hh:274
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
Definition: BaseObject.cc:721
QString path() const
return the path to the object ( defaults to "." if unset )
Definition: BaseObject.cc:732
void objectSelectionChanged(int _objectId)
BaseObject * child(int row)
return a child
Definition: BaseObject.cc:504
bool flag(QString _flag)
Definition: BaseObject.cc:297
void objectPropertiesChanged(int _objectId)
virtual void cleanup()
Definition: BaseObject.cc:205
int persistentId() const
Definition: BaseObject.cc:192
bool source()
Definition: BaseObject.cc:289
void clearObjectData(QString _dataName)
Clear the object data pointer ( this will not delete the object!! )
Definition: BaseObject.cc:785
QMap< QString, PerObjectData * > dataMap_
get reference to map of all perObject Datas
Definition: BaseObject.hh:529
void setFromFileName(const QString &_filename)
Definition: BaseObject.cc:714
const QString getAllCommentsFlat() const
Definition: BaseObject.cc:850
bool hasComments() const
Definition: BaseObject.cc:833
bool isGroup() const
Check if object is a group.
Definition: BaseObject.cc:617
bool target()
Definition: BaseObject.cc:271
void clearComment(const QString &key)
Get comment for the specified key.
Definition: BaseObject.cc:837
int id() const
Definition: BaseObject.cc:188
virtual bool visible()
return if object is visible
Definition: BaseObject.cc:337
Predefined datatypes.
Definition: DataTypes.hh:83
Object Payload.
virtual PerObjectData * copyPerObjectData()
Copy Function.
Update type class.
Definition: UpdateType.hh:59
void increaseObjectCount()
Decrease the number of current Object.
void addObjectToMap(int _objectId, BaseObject *_object)
Add object to internal object map.
BaseObject *& objectRoot()
Get the root of the object structure.
void decreaseTargetCount()
Increase the number of current Object.
void increaseTargetCount()
Decrease the number of current Object.
void decreaseObjectCount()
Increase the number of current Object.