VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
examples
addSet
addSetSim
setSpeedAndHeading.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2006 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: setSpeedAndHeading.h,v $ $Revision: 1.3 $ $State: Exp $
7
*******************************************************************************/
8
#pragma once
9
10
#include "
vrftasks/setDataReq.h
"
11
#include <vlpi/NetStructs.h>
12
#include "
vrfutil/rwReal.h
"
13
#include "
vrftasks/radioMsgTypes.h
"
14
15
namespace
vrfAddSetExample
16
{
17
//class DtSetSpeedAndHeadingRequest:
18
//
19
//Instances of DtSetSpeedAndHeading are an example of a new kind of set that tells
20
//an entity to set their current speed and heading.
21
22
//DtSetSpeedAndHeadingString must be a unique string representing the set
23
//(existing string types are defined in msgTypes.h).
24
const
DtSetMessageType
DtSetSpeedAndHeadingType
=
DtString
(
"set-speed-and-heading"
);
25
26
//DtSetSpeedAndHeadingMenuItemIdName must be a unique string identifying the
27
//DtSetSpeedAndHeadingMenuItem object, which inherits from DtVrfTaskSetMenuItem
28
const
char
DtSetSpeedAndHeadingMenuItemIdName
[] =
"DtSetSpeedAndHeadingMenuItem"
;
29
30
class
DtSetSpeedAndHeadingRequest
:
public
DtSetDataRequest
31
{
32
33
public
:
34
35
//default constructor
36
DtSetSpeedAndHeadingRequest
();
37
38
//constructor;
39
//If you have a request 'put' itself, the writeName will preface it.
40
DtSetSpeedAndHeadingRequest
(
const
DtString
& writeName,
41
DtReaderWriterRegistry
* parentRegistry = 0);
42
43
//copy constructor
44
DtSetSpeedAndHeadingRequest
(
const
DtString
& writeName,
const
DtSetSpeedAndHeadingRequest
&
45
orig,
DtReaderWriterRegistry
* parentRegistry = 0);
46
47
//assignment operator
48
const
DtSetSpeedAndHeadingRequest
&
operator=
(
const
DtSetSpeedAndHeadingRequest
& orig);
49
50
virtual
~DtSetSpeedAndHeadingRequest
();
51
52
//Returns DtSetSpeedAndHeadingRequestType.
53
virtual
const
DtSetMessageType
&
type
()
const
;
54
55
//Creates a copy of the request.
56
virtual
DtSetDataRequest
*
clone
(
const
DtString
&
name
,
57
DtReaderWriterRegistry
* parentRegistry = 0)
const
;
58
59
//Get a readable string representation of this setDataRequest.
60
virtual
DtString
stringRep
()
const
;
61
62
//In meters/second.
63
virtual
DtReal
speed
()
const
;
64
virtual
void
setSpeed
(DtReal speed);
65
66
//In radians
67
virtual
DtReal
heading
()
const
;
68
virtual
void
setHeading
(DtReal heading);
69
70
//Returns the size of the full network representation
71
//padded to an 8-byte boundary.
72
virtual
int
netRepSize
()
const
;
73
74
//Fills in the task from the network buffer.
75
virtual
bool
setFromNet
(
const
char
* contentBuffer,
76
unsigned
contentSize);
77
78
//Fills in the network buffer (created by base class setDataRequest) with
79
//the set data request contents.
80
virtual
bool
setToNet
();
81
82
static
DtSetDataRequest
*
creator
();
83
84
protected
:
85
86
DtRwReal
mySpeed
;
87
DtRwReal
myHeading
;
88
};
89
}
90
91
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
)