VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
planStatementItem.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 #include <vrvCore/DtUniqueID.h>
14 
15 #include <vrfplan/stmtIndex.h>
16 #include <vlutil/vlString.h>
17 
18 #include <QtGui/QImage>
19 #include <QtWidgets/QTreeWidget>
20 #include <boost/signals2.hpp>
21 
22 namespace makVrv
23 {
24  class DtDe;
25 }
26 
27 class DtPlan;
28 class DtSimBlock;
29 
30 namespace makVrf
31 {
32  class DtPlanTreeWidget;
33  class DtPlanListBoxItem;
34 
36  {
37  public:
38  DtPlanStatementItem(makVrv::DtDe&, DtSimBlock* = nullptr, DtPlanStatementItem* parentItem = nullptr, const DtStmtIndex* index = nullptr,
39  makVrv::DtUniqueID id = 0);
40  virtual ~DtPlanStatementItem() override;
41 
42  virtual void setStatementIndex(const DtStmtIndex index);
43  virtual const DtStmtIndex& statementIndex() const;
44 
45  virtual void setBlockIndex(int index);
46  virtual int blockIndex() const;
47 
48  virtual void setPlanText(const QString&);
49 
50  virtual makVrv::DtUniqueID entityId() const;
51 
52  void setParentItem(DtPlanStatementItem* i) { myParentItem = i; };
53  DtPlanStatementItem* parentItem() const { return myParentItem; };
54 
55  virtual void planLockStatusChanged(bool);
56 
57  virtual bool parentIsTriggerItem() const;
58 
59  DtSimBlock* parentBlock() const { return myParentBlock; };
60  DtSimBlock* blockHeader() const { return myBlockHeader; };
61  DtSimStatement* parentStatement() const;
62 
64  DtSimStatement* blockStatement() const;
65  DtSimStatement* parentBlockStatement() const;
66  DtSimStatement* statement() const;
67 
68  virtual void expandToParent();
69 
70  virtual DtPlanListBoxItem* parentPlanItem() const;
71 
73  virtual QString planItemText() const;
74 
75  QTreeWidgetItem* prev();
76 
79  virtual void setCurrent(bool);
80  bool current() const;
81 
82  virtual void setDraggingOver(bool);
83  bool draggingOver() const;
84 
85  virtual bool isHeaderItem() const;
86 
87  virtual QString indent() const;
88 
90  virtual QVariant data(int col, int role) const override;
91  virtual QString stringRep(bool includeIndent = true, bool removeLineBreaks = false) const;
92 
93  bool isLastStatementInBlock() const;
94  bool isFirstStatementInBlock() const;
95 
96  virtual bool within(DtSimBlock*) const;
97  virtual bool within(DtSimStatement*) const;
98 
99  virtual DtPlan* plan() const;
100 
101  virtual DtPlanStatementItem* displayStatement(DtSimBlock* block, const DtStmtIndex& stmt, DtPlanStatementItem* parentItem);
102  virtual void displayBlock(DtSimBlock* block, DtPlanStatementItem* parentItem);
103 
104  virtual DtPlanTreeWidget* planTreeWidget() const;
105 
106  virtual void addChildItem(DtPlanStatementItem*);
107 
109  virtual void clearChildren();
110 
113  {
114  return myParentBlockItem;
115  }
116 
117  virtual bool isCopyable() const;
118 
119  virtual void setParentBlockItem(DtPlanStatementItem*);
120 
121  protected:
122  virtual void childStatementDeleted(const DtPlanStatementItem*);
123 
124  public:
125  boost::signals2::signal<void (DtPlanStatementItem*)> signal_itemDeleted;
126 
127  public:
128  static QString theIndentSize;
129 
130  protected:
139  bool myClearing = false;
140  bool myCurrent = false;
141  bool myDraggingOver = false;
142  typedef std::map<const DtPlanStatementItem*, boost::signals2::scoped_connection> Children;
144 
145  };
146 
147  inline bool DtPlanStatementItem::current() const
148  {
149  return myCurrent;
150  }
151 
153  {
154  return myDraggingOver;
155  }
156 
158  {
159  public:
162 
164  virtual ~DtPlanStatementItemCreator() override;
165 
166  static DtPlanStatementItemCreator& instance(makVrv::DtDe& de);
167  static void registerInstance(makVrv::DtDe& de, DtPlanStatementItemCreator*);
168 
169  virtual DtPlanStatementItem* create(DtSimBlock* block = nullptr,
170  DtPlanStatementItem* parentItem = nullptr, const DtStmtIndex* index = nullptr, makVrv::DtUniqueID id = 0);
171 
172  protected:
174  };
175 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
bool draggingOver() const
Definition: planStatementItem.h:152
makVrv::DtDe & myDe
Definition: planStatementItem.h:173
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
int myBlockIndex
Definition: planStatementItem.h:133
Children myChildItems
Definition: planStatementItem.h:143
Definition: planStatementItem.h:35
class DtStmtIndex:
Definition: stmtIndex.h:24
This class will support the listing of plan items and the dragging/dropping thereof.
Definition: planTreeWidget.h:57
DtSimBlock * blockHeader() const
Definition: planStatementItem.h:60
bool myCurrent
Definition: planStatementItem.h:140
void setParentItem(DtPlanStatementItem *i)
Definition: planStatementItem.h:52
DtPlanTreeWidget * myPlanTreeWidget
Definition: planStatementItem.h:136
static QString theIndentSize
Definition: planStatementItem.h:128
DtStmtIndex myStatementIndex
Definition: planStatementItem.h:132
Definition: planStatementItem.h:157
class DtSimBlock:
Definition: simBlock.h:27
DtPlanStatementItem * parentItem() const
Definition: planStatementItem.h:53
Contains makVrv::DtVirtualBaseClass class.
This item will be the root node for a plan item – this will create children of type DtPlanStatementIt...
Definition: planListBoxItem.h:32
DtPlanStatementItem * parentBlockItem() const
If this is part of a parent block (an else, an end while, an end if) statement then set this will be ...
Definition: planStatementItem.h:112
DtPlanStatementItem * myParentItem
Definition: planStatementItem.h:137
DtSimBlock * parentBlock() const
Definition: planStatementItem.h:59
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
class DtPlan:
Definition: plan.h:92
class DtSimStatement:
Definition: simStatement.h:38
DtSimBlock * myParentBlock
Definition: planStatementItem.h:134
bool myDraggingOver
Definition: planStatementItem.h:141
DtSimBlock * myBlockHeader
Definition: planStatementItem.h:135
Contains makVrv::DtUniqueID type.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
makVrv::DtDe & myDe
Definition: planStatementItem.h:131
boost::signals2::signal< void(DtPlanStatementItem *)> signal_itemDeleted
Definition: planStatementItem.h:125
std::map< const DtPlanStatementItem *, boost::signals2::scoped_connection > Children
Definition: planStatementItem.h:142
bool current() const
Definition: planStatementItem.h:147
DtPlanStatementItem * myParentBlockItem
Definition: planStatementItem.h:138

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)