VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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/DtPage.h
>
16
#include <
vrvCore/DtUserInterfaceAssembler.h
>
17
#include <
vrvCore/DtStateViewCollection.h
>
18
#include <
vrfGuiCore/vrfStateViewCollectionManager.h
>
19
#include <
vrftasks/simTask.h
>
20
21
namespace
makVrv
22
{
23
class
DtDe;
24
}
25
26
namespace
makVrfEntityListExample
27
{
28
29
//A widget class that displays all existing entities
30
//as well as their current task and, if available, their destination.
31
class
DtEntityList
32
:
public
makVrv::DtPage
33
{
34
public
:
35
DtEntityList
(
makVrv::DtDe
& de,
QWidget
* parent = 0, Qt::WindowFlags flags = 0);
36
37
virtual
~DtEntityList
();
38
39
//Get the icon of the page.
40
virtual
QIcon
icon
();
41
42
//Get the title of the page.
43
virtual
QString
title
();
44
45
//Get the class name of the page.
46
virtual
const
std::string&
pageClassName
()
const
;
47
48
//Called when the page is displayed.
49
virtual
void
activate
();
50
51
//Called when the page is hidden.
52
virtual
void
deactivate
();
53
54
static
std::string
thePageClassName
();
55
56
//Goes through the entire list of entities and populates the tree
57
virtual
void
populateEntityList
();
58
59
protected
:
60
//Sets up the contents of the widget onto the supplied parent
61
void
setupUi
(
QWidget
* p);
62
63
//Clears out widget
64
virtual
void
clear
();
65
66
67
protected
:
68
virtual
void
slot_onObjectAdded
(
const
makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>
&);
69
virtual
void
slot_onObjectUpdated
(
makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>
*);
70
virtual
void
slot_onObjectAboutToBeRemoved
(
const
makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>
&);
71
virtual
void
slot_onCurrentTaskChanged
(
const
DtUUID
& entityName);
72
73
//Using the known task, fill in the destination line in the entity list
74
void
fillDestinationLine
(
DtSimTask
*
task
,
QTreeWidgetItem
* displayEntityItem);
75
76
public
:
77
Ui_DtEntityListUi
myUi
;
78
79
//A list of all simulated entities.
80
//Each State View is a collection of similar objects
81
//that the VR-Forces front end knows about. This particular view
82
//keeps a list of all simulated entities.
83
makVrf::DtVrfSimulatedEntityStateViewCollection
*
mySimulatedEntityStateView
;
84
85
//This maps keeps track of each line in the target list
86
std::map<const makVrv::DtStateView<makVrv::DtVrlinkSimulatedEntityState>*,
QTreeWidgetItem
*>
myLineToStateViewMap
;
87
};
88
89
//Create a "creator" helper class using the template.
90
typedef
makVrv::DtPageCreatorTemplate<DtEntityList>
DtEntityListWidgetCreator
;
91
}
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)