VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
examples
entityList
DtEntityList.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2011 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
6
//\file DtEntityList.h
7
//\brief Contains makVrf::makVrfEntityListExample::DtEntityList class.
8
9
#pragma once
10
11
#include <
vrvUtil/signalslib.h
>
12
13
#include "entityListUi.hpp"
14
15
#include <
vrvCoreQt/DtDockable.h
>
16
#include <
vrvCoreQt/DtPage.h
>
17
#include <
vrvCore/DtUserInterfaceAssembler.h
>
18
#include <
vrvCore/DtStateViewCollection.h
>
19
#include <
vrfGuiCore/DtVrfStateViewCollectionManager.h
>
20
#include <
vrftasks/simTask.h
>
21
22
namespace
makVrv
23
{
24
class
DtDe;
25
}
26
27
namespace
makVrfEntityListExample
28
{
29
30
//A widget class that displays all existing entities
31
//as well as their current task and, if available, their destination.
32
class
DtEntityList
33
:
public
makVrv::DtPage
34
,
public
makVrv::DtDockable
35
{
36
public
:
37
DtEntityList
(
makVrv::DtDe
& de,
QWidget
* parent = 0, Qt::WindowFlags flags = 0);
38
39
virtual
~DtEntityList
();
40
41
//Get the icon of the page.
42
virtual
QIcon
icon
();
43
44
//Get the title of the page.
45
virtual
QString
title
();
46
47
//Get the class name of the page.
48
virtual
const
std::string&
pageClassName
()
const
;
49
50
//Called when the page is displayed.
51
virtual
void
activate
();
52
53
//Called when the page is hidden.
54
virtual
void
deactivate
();
55
56
static
std::string
thePageClassName
();
57
58
//Goes through the entire list of entities and populates the tree
59
virtual
void
populateEntityList
();
60
61
protected
:
62
//Sets up the contents of the widget onto the supplied parent
63
void
setupUi
(
QWidget
* p);
64
65
//Clears out widget
66
virtual
void
clear
();
67
68
69
protected
:
70
virtual
void
slot_onObjectAdded
(
const
makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>
&);
71
virtual
void
slot_onObjectUpdated
(
makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>
*);
72
virtual
void
slot_onObjectAboutToBeRemoved
(
const
makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>
&);
73
virtual
void
slot_onCurrentTaskChanged
(
const
std::string& entityName);
74
75
//Using the known task, fill in the destination line in the entity list
76
void
fillDestinationLine
(
DtSimTask
*
task
,
QTreeWidgetItem
* displayEntityItem);
77
78
public
:
79
Ui_DtEntityListUi
myUi
;
80
81
//A list of all simulated entities.
82
//Each State View is a collection of similar objects
83
//that the VR-Forces front end knows about. This particular view
84
//keeps a list of all simulated entities.
85
makVrf::DtVrfSimulatedEntityStateViewCollection
*
mySimulatedEntityStateView
;
86
87
//This maps keeps track of each line in the target list
88
std::map<const makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>*,
QTreeWidgetItem
*>
myLineToStateViewMap
;
89
};
90
91
//Create a "creator" helper class using the template.
92
typedef
makVrv::DtPageCreatorTemplate<DtEntityList>
DtEntityListWidgetCreator
;
93
}
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)