DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaGraphicsScene.cpp
Go to the documentation of this file.
1
2#include <QGraphicsSceneDragDropEvent>
3#include <QEvent>
4#include <QMimeData>
5#include <QWidget>
6
7#include <QMenu>
8#include <QApplication>
18
19using namespace dunedaq::oks;
20
22 : QGraphicsScene ( parent ),
23 m_line ( nullptr ),
24 m_context_menu ( nullptr ),
25 CurrentObject ( nullptr ),
26 m_current_arrow ( nullptr ),
27 m_inherited_properties_visible(false),
28 m_highlight_abstract(false),
29 m_highlight_active(false),
30 m_modified(false)
31{
33 setSceneRect ( QRectF ( 0, 0, 10000, 10000 ) );
34}
35
39
41{
42 // Add new class
43 m_add_class = new QAction ( "&Add new class", this );
44 connect ( m_add_class, SIGNAL ( triggered() ), this, SLOT ( new_class_slot() ) );
45
46 // Edit current class
47 m_edit_class = new QAction ( "&Edit class", this );
48 connect ( m_edit_class, SIGNAL ( triggered() ), this, SLOT ( EditClassSlot() ) );
49
50 // Toggle inherited properties of all classes in view
51 m_toggle_indirect_infos = new QAction ( "Toggle &inherited properties", this );
52 connect ( m_toggle_indirect_infos, SIGNAL ( triggered() ), this, SLOT ( ToggleIndirectInfos() ) );
53
54 // Toggle highlighting of all classes in active schema
55 m_toggle_highlight_active = new QAction ( "Toggle &highlighting of classes in active schema", this );
56 connect ( m_toggle_highlight_active, SIGNAL ( triggered() ), this, SLOT ( ToggleHighlightActive() ) );
57
58 // Toggle highlighting of all abstract classes in view
59 m_toggle_highlight_abstract = new QAction ( "Toggle &highlighting of abstract classes in view", this );
60 connect ( m_toggle_highlight_abstract, SIGNAL ( triggered() ), this, SLOT ( ToggleHighlightAbstract() ) );
61
62 // Toggle displaying default values of attributes
63 m_toggle_default = new QAction ( "Toggle showing of &default values of attributes", this );
64 connect ( m_toggle_default, SIGNAL ( triggered() ), this, SLOT ( ToggleDefault() ) );
65
66 // Toggle highlighting of current class
67 m_toggle_highlight_class = new QAction ( "Toggle &highlighting of this class", this );
68 connect ( m_toggle_highlight_class, SIGNAL ( triggered() ), this, SLOT ( ToggleHighlightClass() ) );
69
70 m_add_note = new QAction ( "&Add note to view", this );
71 connect ( m_add_note, SIGNAL ( triggered() ), this, SLOT ( new_note_slot() ) );
72
73 m_edit_note = new QAction ( "&Edit note", this );
74 connect ( m_edit_note, SIGNAL ( triggered() ), this, SLOT ( edit_note_slot() ) );
75
76 m_remove_note = new QAction ( "&Remove note", this );
77 connect ( m_remove_note, SIGNAL ( triggered() ), this, SLOT ( remove_note_slot() ) );
78
79 // Show superclasses of the current class
80 m_add_direct_super_classes = new QAction ( "Add direct &superclasses to view", this );
81 connect ( m_add_direct_super_classes, SIGNAL ( triggered() ), this, SLOT ( AddDirectSuperClassesSlot() ) );
82
83 // Show relationship classes of the current clas
84 m_add_direct_relationship_classes = new QAction ( "Add direct &relationship classes to view", this );
85 connect ( m_add_direct_relationship_classes, SIGNAL ( triggered() ), this, SLOT ( AddDirectRelationshipClassesSlot() ) );
86
87 // Show superclasses of the current class
88 m_add_all_super_classes = new QAction ( "Add all &superclasses to view", this );
89 connect ( m_add_all_super_classes, SIGNAL ( triggered() ), this, SLOT ( AddAllSuperClassesSlot() ) );
90
91 // Show subclasses of the current clas
92 m_add_all_sub_classes = new QAction ( "Add all s&ubclasses to view", this );
93 connect ( m_add_all_sub_classes, SIGNAL ( triggered() ), this, SLOT ( AddAllSubClassesSlot() ) );
94
95 // Show indirect relationship classes of the current class
96 m_add_all_relationship_classes = new QAction ( "Add all &relationship classes to view", this );
97 connect ( m_add_all_relationship_classes, SIGNAL ( triggered() ), this, SLOT ( AddAllRelationshipClassesSlot() ) );
98
99 // Remove class
100 m_remove_class = new QAction ( "&Remove Class from view", this );
101 connect ( m_remove_class, SIGNAL ( triggered() ), this, SLOT ( RemoveClassSlot() ) );
102
103 // Remove arrow
104 m_remove_arrow = new QAction ( "&Remove Arrow", this );
105 connect ( m_remove_arrow, SIGNAL ( triggered() ), this, SLOT ( RemoveArrowSlot() ) );
106}
107
108void dbse::SchemaGraphicsScene::dragEnterEvent ( QGraphicsSceneDragDropEvent * event )
109{
110 if ( event->mimeData()->hasFormat ( "application/vnd.text.list" ) )
111 {
112 event->accept();
113 }
114}
115
116void dbse::SchemaGraphicsScene::dragMoveEvent ( QGraphicsSceneDragDropEvent * event )
117{
118 if ( event->mimeData()->hasFormat ( "application/vnd.text.list" ) )
119 {
120 event->accept();
121 }
122}
123
124void dbse::SchemaGraphicsScene::dropEvent ( QGraphicsSceneDragDropEvent * event )
125{
126 QByteArray encodedData = event->mimeData()->data ( "application/vnd.text.list" );
127 QDataStream stream ( &encodedData, QIODevice::ReadOnly );
128
129 if (stream.atEnd()) {
130 return;
131 }
132
133 QStringList schema_classes;
134 while ( !stream.atEnd() )
135 {
136 QString class_name;
137 stream >> class_name;
138 schema_classes.append ( class_name );
139 }
140
141 QList<QPointF> positions;
142 for ( int i = 0; i < schema_classes.size(); ++i )
143 {
144 positions.push_back ( event->scenePos() );
145 }
146
147 AddItemsToScene ( schema_classes, positions );
148}
149
150void dbse::SchemaGraphicsScene::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event )
151{
152 if ( m_context_menu == nullptr ) {
153 m_context_menu = new QMenu();
154 m_context_menu->addAction ( m_add_class );
155 m_context_menu->addAction ( m_add_note );
156 m_context_menu->addAction ( m_toggle_indirect_infos );
157 m_context_menu->addAction ( m_toggle_highlight_abstract );
158 m_context_menu->addAction ( m_toggle_highlight_active );
159 m_context_menu->addAction ( m_toggle_default );
160
161 m_seperator_pos = m_context_menu->actions().size();
162 m_context_menu->addSeparator();
163
164 m_class_pos = m_context_menu->actions().size();
165 m_context_menu->addAction ( m_edit_class );
166 m_context_menu->addAction ( m_remove_class );
167 m_context_menu->addAction ( m_toggle_highlight_class );
168 m_context_menu->addAction ( m_add_direct_super_classes );
169 m_context_menu->addAction ( m_add_direct_relationship_classes );
170 m_context_menu->addAction ( m_add_all_super_classes );
171 m_context_menu->addAction ( m_add_all_sub_classes );
172 m_context_menu->addAction ( m_add_all_sub_classes );
173 m_context_menu->addAction ( m_add_all_relationship_classes );
174
175 m_arrow_pos = m_context_menu->actions().size();
176 m_context_menu->addAction ( m_remove_arrow );
177
178 m_note_pos = m_context_menu->actions().size();
179 m_context_menu->addAction ( m_edit_note );
180 m_context_menu->addAction ( m_remove_note );
181 }
182
183 bool active = KernelWrapper::GetInstance().IsActive ( );
184 m_context_menu->actions().at ( 0 )->setVisible ( active );
185
186 for (int item=1; item<m_seperator_pos; item++) {
187 m_context_menu->actions().at ( item )->setVisible ( true );
188 }
189
190 // Set all other items invisible
191 const auto nitems = m_context_menu->actions().size();
192 for (int item=m_seperator_pos; item<nitems; item++) {
193 m_context_menu->actions().at ( item )->setVisible ( false );
194 }
195
196 if ( itemAt ( event->scenePos(), QTransform() ) ) {
197 // Something under mouse pointer, set additional items visible
198 // depending on what it is
199 m_context_menu->actions().at ( m_seperator_pos )->setVisible ( true );
200
201 auto object = dynamic_cast<SchemaGraphicObject *> (
202 itemAt ( event->scenePos(), QTransform() ) );
203 auto arrow = dynamic_cast<SchemaGraphicSegmentedArrow *> (
204 itemAt ( event->scenePos(), QTransform() ) );
205 auto note = dynamic_cast<SchemaGraphicNote *> (
206 itemAt ( event->scenePos(), QTransform() ) );
207
208 if ( object != nullptr) {
209 CurrentObject = object;
210 auto filename =
211 CurrentObject->GetClass()->get_file()->get_full_file_name();
213 m_context_menu->actions().at ( m_class_pos )->setVisible ( writable );
214
215 for (int item=m_class_pos+1; item<m_arrow_pos; item++) {
216 m_context_menu->actions().at ( item )->setVisible ( true );
217 }
218 }
219 else if ( arrow != nullptr ) {
220 m_context_menu->actions().at ( m_arrow_pos )->setVisible ( true );
221 m_current_arrow = arrow;
222 }
223 else if ( note != nullptr) {
224 for (int item=m_note_pos; item<nitems; item++) {
225 m_context_menu->actions().at ( item )->setVisible ( true );
226 }
227 m_current_note = note;
228 }
229 }
230 m_current_pos = event->scenePos();
231 m_context_menu->exec ( event->screenPos() );
232}
233
235 QStringList SchemaClasses,
236 QList<QPointF> Positions )
237{
238 QStringList missingItems{};
239
240 for ( QString & ClassName : SchemaClasses )
241 {
242 if ( !ItemMap.contains ( ClassName ) )
243 {
244
245 if ( !KernelWrapper::GetInstance().FindClass ( ClassName.toStdString() ) ) {
246 std::cout << "ERROR: class " << ClassName.toStdString() << " not found" << std::endl;
247 missingItems.append(ClassName);
248 continue;
249 }
250
251 SchemaGraphicObject * Object = new SchemaGraphicObject ( ClassName, this );
252 Object->setPos ( Positions.at ( SchemaClasses.indexOf ( ClassName ) ) );
253 addItem ( Object );
255 ItemMap.insert ( ClassName, Object );
256 }
257 }
258
259 for ( QString & ClassName : ItemMap.keys() )
260 {
261 OksClass * ClassInfo = KernelWrapper::GetInstance().FindClass ( ClassName.toStdString() );
262
263 const std::list<OksRelationship *> * DirectRelationshipList =
264 ClassInfo->direct_relationships();
265 const std::list<std::string *> * DirectSuperClassesList = ClassInfo->direct_super_classes();
266
267 std::map<std::string, unsigned int> arrow_count;
268
270 if ( DirectRelationshipList != nullptr )
271 {
272 for ( OksRelationship * ClassRelationship : * ( DirectRelationshipList ) )
273 {
274 auto rct = ClassRelationship->get_class_type()->get_name();
275 QString RelationshipClassType = QString::fromStdString (rct);
276
277 if ( ItemMap.contains ( RelationshipClassType ) ) //&& !ItemMap[ClassName]->HasArrow (
278 //ItemMap[RelationshipClassType] ) )
279 {
280 QString SchemaCardinality =
283 ItemMap[ClassName], ItemMap[RelationshipClassType],
284 arrow_count[rct],
285 false,
286 ClassRelationship->get_is_composite(),
287 QString::fromStdString ( ClassRelationship->get_name() ), SchemaCardinality );
288 ItemMap[ClassName]->AddArrow ( NewArrow );
289 ItemMap[RelationshipClassType]->AddArrow ( NewArrow );
290 addItem ( NewArrow );
291 //NewArrow->SetLabelScene(this);
292 NewArrow->setZValue ( -1000.0 );
293 NewArrow->UpdatePosition();
294 arrow_count[rct]++;
295 }
296 }
297 }
298
300 if ( DirectSuperClassesList != nullptr )
301 {
302 for ( std::string * SuperClassNameStd : * ( DirectSuperClassesList ) )
303 {
304 QString SuperClassName = QString::fromStdString ( *SuperClassNameStd );
305
306 if ( ItemMap.contains ( SuperClassName ) ) // && !ItemMap[ClassName]->HasArrow (
307 // ItemMap[SuperClassName] ) )
308 {
310 ItemMap[ClassName],
311 ItemMap[SuperClassName],
312 arrow_count[*SuperClassNameStd],
313 true,
314 false, "", "" );
315 ItemMap[ClassName]->AddArrow ( NewArrow );
316 ItemMap[SuperClassName]->AddArrow ( NewArrow );
317 addItem ( NewArrow );
318 //NewArrow->SetLabelScene(this);
319 NewArrow->setZValue ( -1000.0 );
320 NewArrow->UpdatePosition();
321 arrow_count[*SuperClassNameStd]++;
322 }
323 }
324 }
325 }
326 modified(true);
327 return missingItems;
328}
329
331 removeItem ( item );
332 modified(true);
333}
334
336 QList<QPointF> positions ) {
337 for ( int index = 0; index<notes.size(); index++) {
338 auto note = new SchemaGraphicNote (
339 QString("#" + QString::number(m_next_note++)),
340 notes.at(index) );
341 note->setPos ( positions.at ( index ) );
342 addItem(note);
343 }
344
345}
347 if (note == nullptr) {
348 return;
349 }
350 RemoveItemFromScene (note);
351}
352
354{
355 if ( Object == nullptr )
356 {
357 return;
358 }
359
360 Object->RemoveArrows();
361 RemoveItemFromScene ( Object );
362 ItemMap.remove ( Object->GetClassName() );
363}
364
366{
367 ItemMap.clear();
368}
369
370void dbse::SchemaGraphicsScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent )
371{
372 if ( itemAt ( mouseEvent->scenePos(), QTransform() ) ) {
373 // Save position of item under mouse so we can see if it has been
374 // moved in mouseReleaseEvent
375 m_mouse_item_pos = itemAt(mouseEvent->scenePos(), QTransform())->pos();
376 }
377 if ( mouseEvent->button() != Qt::LeftButton )
378 {
379 return;
380 }
381
382 if ( mouseEvent->widget()->cursor().shape() == Qt::CrossCursor )
383 {
384 m_line = new QGraphicsLineItem ( QLineF ( mouseEvent->scenePos(), mouseEvent->scenePos() ) );
385 m_line->setPen ( QPen ( Qt::black, 2 ) );
386 addItem ( m_line );
387 modified(true);
388 return;
389 }
390
391 QGraphicsScene::mousePressEvent ( mouseEvent );
392}
393
394void dbse::SchemaGraphicsScene::mouseMoveEvent ( QGraphicsSceneMouseEvent * mouseEvent )
395{
396 if ( m_line != nullptr )
397 {
398 QLineF newLine ( m_line->line().p1(), mouseEvent->scenePos() );
399 m_line->setLine ( newLine );
400 }
401 else
402 {
403 QGraphicsScene::mouseMoveEvent ( mouseEvent );
404 }
405}
406
408 modified(false);
409}
410
412 m_modified = state;
413 emit sceneModified(state);
414}
415
417 modified(true);
418}
419void dbse::SchemaGraphicsScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent * mouseEvent )
420{
421 if ( itemAt ( mouseEvent->scenePos(), QTransform() ) ) {
422 auto item = itemAt(mouseEvent->scenePos(), QTransform() );
423 if (!m_mouse_item_pos.isNull()) {
424 if (m_mouse_item_pos != item->pos()) {
425 modified(true);
426 }
427 m_mouse_item_pos = QPointF();
428 }
429 }
430 if ( m_line != nullptr )
431 {
432 QList<QGraphicsItem *> startItems = items ( m_line->line().p1() );
433
434 if ( startItems.count() && startItems.first() == m_line )
435 {
436 startItems.removeFirst();
437 }
438
439 QList<QGraphicsItem *> endItems = items ( m_line->line().p2() );
440
441 if ( endItems.count() && endItems.first() == m_line )
442 {
443 endItems.removeFirst();
444 }
445
446 RemoveItemFromScene ( m_line );
447 delete m_line;
448
449 if ( startItems.count() > 0 && endItems.count() > 0
450 && startItems.first() != endItems.first() )
451 {
452
453 bool Inheritance = KernelWrapper::GetInstance().GetInheritanceMode();
454 SchemaGraphicObject * startItem = qgraphicsitem_cast<SchemaGraphicObject *> (
455 startItems.first() );
456 SchemaGraphicObject * endItem = qgraphicsitem_cast<SchemaGraphicObject *> (
457 endItems.first() );
458
459 if ( Inheritance )
460 {
461 startItem->GetClass()->add_super_class ( endItem->GetClassName().toStdString() );
464 startItem, endItem,
465 0,
466 Inheritance,
467 true, "", "" );
468 startItem->AddArrow ( newArrow );
469 endItem->AddArrow ( newArrow );
470 newArrow->setZValue ( -1000.0 );
471 addItem ( newArrow );
472 //newArrow->SetLabelScene(this);
473 newArrow->UpdatePosition();
474 }
475 else
476 {
478 startItem->GetClass(), endItem->GetClassName() );
479 connect ( Editor, SIGNAL ( MakeGraphConnection ( QString, QString, QString ) ), this,
480 SLOT ( DrawArrow ( QString, QString, QString ) ) );
481 Editor->show();
482 }
483 }
484 }
485
486 m_line = nullptr;
487 QGraphicsScene::mouseReleaseEvent ( mouseEvent );
488}
489
491 m_current_note->open_editor();
492}
493
495 remove_note_object(m_current_note);
496}
497
499 addItem(note);
500 modified(true);
501}
505
507 auto note = new SchemaGraphicNote (
508 QString("#") + QString::number(m_next_note++), QString());
509 note->setPos(m_current_pos);
510 auto editor = new SchemaNoteEditor(note);
511 connect(editor, SIGNAL(note_accepted(SchemaGraphicNote*)), this, SLOT(add_note_slot(SchemaGraphicNote*)));
512 connect(editor, SIGNAL(cancelled(SchemaGraphicNote*)), this, SLOT(cancel_note_slot(SchemaGraphicNote*)));
513 editor->show();
514}
515
517 disconnect(m_addclass_connection);
518
519 auto object = new SchemaGraphicObject(class_name, this);
520 object->setPos(m_current_pos);
521 addItem (object);
523 ItemMap.insert(class_name, object);
524}
526 m_addclass_connection = connect (
527 &KernelWrapper::GetInstance(), SIGNAL ( ClassCreated(QString) ),
528 this, SLOT ( add_class_slot(QString) ) );
530}
531
533{
534 QString class_name = QString::fromStdString ( CurrentObject->GetClass()->get_name() );
535 SchemaClassEditor::launch(class_name);
536}
537
539 CurrentObject->toggle_highlight_class();
540 this->update();
541}
542
544 m_highlight_active = !m_highlight_active;
545 this->update();
546}
547
549 m_highlight_abstract = !m_highlight_abstract;
550 this->update();
551}
552
554 m_show_defaults = !m_show_defaults;
555 for ( SchemaGraphicObject * item : ItemMap.values() ) {
556 item->update_arrows();
557 }
558 this->update();
559}
560
562 m_inherited_properties_visible = !m_inherited_properties_visible;
563
564 for ( SchemaGraphicObject * item : ItemMap.values() ) {
565 item->update_arrows();
566 }
567 this->update();
568}
569
571
572 QString class_name = QString::fromStdString ( CurrentObject->GetClass()->get_name() );
573 OksClass * class_info = KernelWrapper::GetInstance().FindClass ( class_name.toStdString() );
574
575 QStringList super_class_list;
576 QList<QPointF> positions;
577
578 const std::list<std::string *>* direct_classes = class_info->direct_super_classes();
579 if(direct_classes != nullptr) {
580 for(std::string * cl_name : *direct_classes) {
581 super_class_list.push_back(QString::fromStdString(*cl_name));
582 positions.push_back({0,0});
583 }
584 }
585
586 this->AddItemsToScene ( super_class_list, positions );
587
588}
589
591
592 QString class_name = QString::fromStdString ( CurrentObject->GetClass()->get_name() );
593 OksClass * class_info = KernelWrapper::GetInstance().FindClass ( class_name.toStdString() );
594
595 QStringList super_class_list;
596 QList<QPointF> positions;
597
598 const OksClass::FList* all_classes = class_info->all_super_classes();
599 if(all_classes != nullptr) {
600 for(const OksClass* cl : *all_classes) {
601 super_class_list.push_back(QString::fromStdString(cl->get_name()));
602 positions.push_back({0,0});
603 }
604 }
605
606
607 this->AddItemsToScene ( super_class_list, positions );
608
609}
610
612
613 QString class_name = QString::fromStdString ( CurrentObject->GetClass()->get_name() );
614 OksClass * class_info = KernelWrapper::GetInstance().FindClass ( class_name.toStdString() );
615
616 QStringList sub_class_list;
617 QList<QPointF> positions;
618
619 const OksClass::FList* all_classes = class_info->all_sub_classes();
620 if(all_classes != nullptr) {
621 for(const OksClass* cl : *all_classes) {
622 sub_class_list.push_back(QString::fromStdString(cl->get_name()));
623 positions.push_back({0,0});
624 }
625 }
626
627 this->AddItemsToScene ( sub_class_list, positions );
628
629}
630
632
633 QString class_name = QString::fromStdString ( CurrentObject->GetClass()->get_name() );
634 OksClass * class_info = KernelWrapper::GetInstance().FindClass ( class_name.toStdString() );
635
636 QStringList relationship_classes;
637 QList<QPointF> positions;
638
639 const std::list<OksRelationship *> * direct_relationship_list = class_info->direct_relationships();
640 if ( direct_relationship_list != nullptr ) {
641 for(const OksRelationship* rl : *direct_relationship_list) {
642 relationship_classes.push_back(QString::fromStdString(rl->get_type()));
643 positions.push_back({0,0});
644 }
645
646 }
647
648 this->AddItemsToScene ( relationship_classes, positions );
649
650}
651
653
654 QString class_name = QString::fromStdString ( CurrentObject->GetClass()->get_name() );
655 OksClass * class_info = KernelWrapper::GetInstance().FindClass ( class_name.toStdString() );
656
657 QStringList relationship_classes;
658 QList<QPointF> positions;
659
660 const std::list<OksRelationship *> * all_relationship_list = class_info->all_relationships();
661 if ( all_relationship_list != nullptr ) {
662 for(const OksRelationship* rl : *all_relationship_list) {
663 relationship_classes.push_back(QString::fromStdString(rl->get_type()));
664 positions.push_back({0,0});
665 }
666
667 }
668
669 this->AddItemsToScene ( relationship_classes, positions );
670}
671
673{
674 if ( CurrentObject == nullptr )
675 {
676 return;
677 }
678
679 CurrentObject->RemoveArrows();
680 RemoveItemFromScene ( CurrentObject );
681 ItemMap.remove ( CurrentObject->GetClassName() );
682}
683
685{
686 RemoveItemFromScene ( m_current_arrow );
687 m_current_arrow->GetStartItem()->RemoveArrow ( m_current_arrow );
688 m_current_arrow->GetEndItem()->RemoveArrow ( m_current_arrow );
689 m_current_arrow->RemoveArrow();
690}
691
692void dbse::SchemaGraphicsScene::DrawArrow ( QString ClassName, QString RelationshipType,
693 QString RelationshipName )
694{
695 if ( !ItemMap.contains ( ClassName ) || !ItemMap.contains ( RelationshipType ) )
696 {
697 return;
698 }
699
700 SchemaGraphicObject * startItem = ItemMap[ClassName];
701 SchemaGraphicObject * endItem = ItemMap[RelationshipType];
702
703 OksClass * SchemaClass = KernelWrapper::GetInstance().FindClass ( ClassName.toStdString() );
704 OksRelationship * SchemaRelationship = SchemaClass->find_direct_relationship (
705 RelationshipName.toStdString() );
706
707 if ( SchemaRelationship != nullptr )
708 {
709 QString RelationshipCardinality =
712 startItem, endItem,
713 0,
714 false, SchemaRelationship->get_is_composite(),
715 QString::fromStdString ( SchemaRelationship->get_name() ), RelationshipCardinality );
716 startItem->AddArrow ( newArrow );
717 endItem->AddArrow ( newArrow );
718 newArrow->setZValue ( -1000.0 );
719 addItem ( newArrow );
720 //newArrow->SetLabelScene(this);
721 newArrow->UpdatePosition();
722 }
723}
static KernelWrapper & GetInstance()
QString GetCardinalityStringRelationship(dunedaq::oks::OksRelationship *SchemaRelationship) const
dunedaq::oks::OksClass * FindClass(std::string ClassName) const
bool IsFileWritable(const std::string &FileName) const
static void launch(QString class_name)
void AddArrow(SchemaGraphicSegmentedArrow *Arrow)
Arrow API.
dunedaq::oks::OksClass * GetClass() const
QStringList AddItemsToScene(QStringList SchemaClasses, QList< QPointF > Positions)
SchemaGraphicsScene(QObject *parent=nullptr)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Drag & Drop.
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
void add_note_slot(SchemaGraphicNote *)
void dropEvent(QGraphicsSceneDragDropEvent *event)
void add_notes(QStringList notes, QList< QPointF > positions)
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
void DrawArrow(QString ClassName, QString RelationshipType, QString RelationshipName)
void remove_note_object(SchemaGraphicNote *obj)
void RemoveItemFromScene(QGraphicsItem *item)
void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
void RemoveClassObject(SchemaGraphicObject *Object)
void cancel_note_slot(SchemaGraphicNote *)
The OKS class.
Definition class.hpp:200
const FList * all_sub_classes() const noexcept
Definition class.hpp:466
OksRelationship * find_direct_relationship(const std::string &name) const noexcept
Find direct relationship.
Definition class.cpp:1173
void add_super_class(const std::string &name)
Definition class.cpp:878
const FList * all_super_classes() const noexcept
Definition class.hpp:408
const std::list< OksRelationship * > * direct_relationships() const noexcept
Definition class.hpp:590
const std::list< std::string * > * direct_super_classes() const noexcept
Definition class.hpp:413
std::list< OksClass *, boost::fast_pool_allocator< OksClass * > > FList
Definition class.hpp:235
const std::list< OksRelationship * > * all_relationships() const noexcept
Definition class.hpp:585
bool get_is_composite() const noexcept
const std::string & get_name() const noexcept