VR-Forces 4.5 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
addEntity
spaceSR.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2004 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: spaceSR.h,v $ $Revision: 1.12 $ $State: Exp $
7
*******************************************************************************/
8
9
10
//
11
//File: spaceSR.h
12
//
13
//Class: DtSpaceEntityStateRepository
14
//
15
//Description: This repository holds all information that is common to all the
16
//forms of space entities within the system. It contains a pointer
17
//to the space entity parameters, and provides accessors and mutators
18
//for all parameter values. In this example, we add a single new parameter,
19
//myCurrentHullTemperature, representing the current hull temperature of this
20
//(e.g. such as during reentry). Any future controller and actuator components
21
//we build to simulate the entity's behavior can view or set this new parameter as necessary.
22
//
23
24
25
#ifndef DtSpaceEntityStateRepository_H_
26
#define DtSpaceEntityStateRepository_H_
27
28
29
#include <vlutil/vlMachineTypes.h>
30
#include "
vrfobjcore/vrfObject.h
"
31
#include "
vrfobjcore/groundInteractionPt.h
"
32
#include "
vrfobjcore/fixedWingEntityStateRepository.h
"
33
#include "
vrfobjcore/vrfObjectStateRepository.h
"
34
35
class
DtSpaceEntityParameters
;
36
37
class
DtSpaceEntityStateRepository
:
public
DtFixedWingEntityStateRepository
38
{
39
40
public
:
41
42
//Constructor with parameters to set up read/writability correctly.
43
DtSpaceEntityStateRepository
(
DtVrfObject
*
vrfObject
,
44
const
DtObjectType
&
objectType
,
DtVrfObjectParameters
*
parameters
,
45
const
DtString
&
name
,
DtReaderWriterRegistry
* parentRegistry = 0);
46
47
//copy constructor
48
DtSpaceEntityStateRepository
(
const
DtSpaceEntityStateRepository
& orig);
49
50
//assignment operator
51
const
DtSpaceEntityStateRepository
&
operator=
(
52
const
DtSpaceEntityStateRepository
& orig);
53
54
//destructor
55
virtual
~DtSpaceEntityStateRepository
();
56
57
virtual
bool
init
();
58
59
//Returns a unique string identifying the type of component,
60
//DtSpaceVehicleSRType (defined in spacetypes.h). Used a key in
61
//the state repository factory.
62
virtual
DtString
type
()
const
;
63
64
//Override to create an instance DtSpaceEntityParameters and
65
//set it in myParameters data member.
66
virtual
bool
createParameters
();
67
68
//Report hull temperature every 10 seconds
69
virtual
void
tick
();
70
71
//Override to initialize space entity specific parameters from
72
//our parameters object.
73
virtual
void
initializeFromParameters
();
74
75
//Implemented for convenience. Since we overrode createParameters()
76
//to create a DtSpaceEntityParameters object (a derived kind of
77
//DtSimObjectParameters), we provide an accessor casting it to the
78
//dervied type.
79
virtual
const
DtSpaceEntityParameters
*
spaceEntityParameters
()
const
;
80
81
//Accessor/mutator for our new parameter, myCurrentHullTemperature.
82
//Set/get hull temperature this entity can sustain (degrees C).
83
virtual
void
setCurrentHullTemperature
(DtReal temp);
84
virtual
DtReal
currentHullTemperature
()
const
;
85
86
//Returns a newly created instance of this class. To be registered
87
//with the state repository factory.
88
static
DtVrfObjectStateRepository
*
creator
(
const
DtString
& name,
89
DtVrfObject
* vrfObject,
const
DtObjectType
& objectType,
90
DtVrfObjectParameters
* parameters,
DtReaderWriterRegistry
* parentRegistry);
91
92
//Returns a the pointer the repository, if the repository passed
93
//in is of type DtSpaceEntityStateRepository, 0 if not. Implmementation
94
//is optional - may be useful for safe type checking.
95
static
DtSpaceEntityStateRepository
*
isSpaceEntityStateRepository
(
96
const
DtVrfObjectStateRepository
* repository);
97
98
protected
:
99
100
//Current hull temperature (in degrees Celsius).
101
DtRwReal
myCurrentHullTemperature
;
102
104
double
myLastHullTemperatureTime
;
105
};
106
107
#endif
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)