VR-Forces 4.0.4 Class Documentation
examples/addEntity/spaceSR.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2004 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: spaceSR.h,v $ $Revision: 1.12 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 
00010 //
00011 //File:        spaceSR.h
00012 //
00013 //Class:       DtSpaceEntityStateRepository
00014 //
00015 //Description: This repository holds all information that is common to all the
00016 //forms of space entities within the system.  It contains a pointer
00017 //to the space entity parameters, and provides accessors and mutators
00018 //for all parameter values.  In this example, we add a single new parameter,
00019 //myMaxHullTemperature, representing the maximum outer hull temperature that
00020 //this entity can sustain (e.g. such as during reentry).  Any future 
00021 //controller and actuator components we build to simulate the entity's 
00022 //behavior can view or set this new parameter as necessary.
00023 //
00024 
00025 
00026 #ifndef DtSpaceEntityStateRepository_H_
00027 #define DtSpaceEntityStateRepository_H_
00028 
00029 
00030 #include <vlutil/vlMachineTypes.h>
00031 #include "vrfobjcore/vrfObject.h"
00032 #include "vrfobjcore/groundInter.h"
00033 #include "vrfobjcore/vrfMvObjSR.h"
00034 #include "vrfobjcore/vrfObjSR.h"
00035 
00036 class DtSpaceEntityParameters;
00037 class DtVector;
00038 
00039 class DtSpaceEntityStateRepository : public DtVrfMovingObjectStateRepository
00040 {
00041 
00042 public:
00043 
00044    //Constructor with parameters to set up read/writability correctly.
00045    DtSpaceEntityStateRepository(DtVrfObject* vrfObject, 
00046       const DtObjectType& objectType, DtVrfObjectParameters* parameters, 
00047       const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
00048 
00049    //copy constructor
00050    DtSpaceEntityStateRepository(const DtSpaceEntityStateRepository& orig);
00051 
00052    //assignment operator
00053    const DtSpaceEntityStateRepository& operator=(
00054       const DtSpaceEntityStateRepository& orig);
00055 
00056    //destructor
00057    virtual ~DtSpaceEntityStateRepository();
00058 
00059    virtual bool init();
00060 
00061    //Returns a unique string identifying the type of component, 
00062    //DtSpaceVehicleSRType (defined in spacetypes.h).  Used a key in 
00063    //the state repository factory.
00064    virtual DtString type() const;
00065 
00066    //Override to create an instance DtSpaceEntityParameters and
00067    //set it in myParameters data member.
00068    virtual bool createParameters();
00069 
00070    //Override to initialize space entity specific parameters from
00071    //our parameters object.
00072    virtual void initializeFromParameters();
00073 
00074    //Implemented for convenience.  Since we overrode createParameters()
00075    //to create a DtSpaceEntityParameters object (a derived kind of 
00076    //DtSimObjectParameters), we provide an accessor casting it to the
00077    //dervied type.
00078    virtual const DtSpaceEntityParameters * spaceEntityParameters() const;
00079 
00080    //Accessor/mutator for our new parameter, myMaxHullTemperature.
00081    //Set/get maximum hull temperature this entity can sustain (degrees C).
00082    virtual void setMaxHullTemperature(DtReal temp);
00083    virtual DtReal maxHullTemperature() const;
00084 
00085    //Returns a newly created instance of this class.  To be registered
00086    //with the state repository factory.
00087    static DtVrfObjectStateRepository * creator(const DtString& name, 
00088       DtVrfObject* vrfObject,const DtObjectType& objectType, 
00089       DtVrfObjectParameters* parameters, DtReaderWriterRegistry* parentRegistry);
00090 
00091    //Returns a the pointer the repository, if the repository passed
00092    //in is of type DtSpaceEntityStateRepository, 0 if not.  Implmementation
00093    //is optional - may be useful for safe type checking.
00094    static DtSpaceEntityStateRepository* isSpaceEntityStateRepository(
00095       const DtVrfObjectStateRepository* repository);
00096 
00097 protected:
00098 
00099    //Maximum hull temperature (in degrees Celsius).
00100    DtRwReal myMaxHullTemperature;
00101 };
00102 
00103 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)