VR-Forces 4.0.4 Class Documentation
include/vrfutil/railSegment.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2010 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: railSegment.h,v $ $Revision: 1.1 $ $State: Exp $
00007 ** Created: 4/4/10 MEM
00008 *******************************************************************************/
00011 
00013 #pragma once
00014 
00015 #include "vrfutil/vrfutilDefines.h"
00016 #include <list>
00017 
00018 #include <matrix/vlVector.h>
00019 #include <vrfExtObjects/vrfWeatherStateEnums.h>
00020 #include <gdb/specMgr.h>
00026 class DT_DLL_vrfutil DtRailSegment 
00027 {
00028 public:
00029 
00030    DtRailSegment();
00031    DtRailSegment(const DtVector& start,const DtVector& end);
00032 
00033    virtual ~DtRailSegment();
00034 
00035    DtRailSegment(const DtRailSegment& orig);
00036 
00037    DtRailSegment& operator=(const DtRailSegment& orig);
00038    virtual DtRailSegment* clone();
00039 
00041 
00042    virtual void setStartPoint(const DtVector& start);
00043    virtual const DtVector & startPoint() const;
00045 
00047 
00048    virtual void setEndPoint(const DtVector & end);
00049    virtual const DtVector & endPoint() const;
00051 
00055 
00056    virtual void setSegmentSpeed(double speed);
00057    virtual double segmentSpeed() const;
00059 
00061 
00062    virtual void setLaneWidth(double width);
00063    virtual double laneWidth() const;
00065 
00067 
00068    virtual void setNumberOfLanes(unsigned int lanes);
00069    virtual unsigned int numberOfLanes() const;
00071 
00075 
00076    virtual int leftLaneOfLane(unsigned lane) const;
00077    virtual int rightLaneOfLane(unsigned lane) const;
00079 
00082    virtual double findLaneShift(const int fromLane, const int toLane) const;
00084 
00090 
00091    virtual double laneOffset(int lanePos) const;
00093 
00097    virtual double laneCenterOffset(int lane) const;
00098 
00100 
00101    virtual void setIsOneWay(bool way);
00102    virtual bool isOneWay() const;
00104 
00106    virtual std::list<int> availableLanes() const;
00107 
00112 
00113    virtual void setSpecificationID(const DtSpecificationID id);
00114    virtual const DtSpecificationID specificationID() const;
00116 
00120 
00121    virtual void setPathId(const unsigned int id);
00122    virtual const unsigned int pathId() const;
00124 
00127 
00128    virtual void setSegmentSurfaceConditions(DtVrfWeatherPrecipitationType condition);
00129    virtual DtVrfWeatherPrecipitationType segmentSurfaceConditions() const;
00131 
00134    virtual double length() const;
00135 
00136    static unsigned int nextPathId();
00137 
00138 protected:
00139 
00140    DtVector       myStartPoint;
00141    DtVector       myEndPoint;
00144    double         mySpeed;
00146    double         myLaneWidth;
00148    unsigned int   myNumberOfLanes;
00150    bool           myIsOneWay;
00153    unsigned int   myPathId;
00155    DtSpecificationID mySpecId;
00157    DtVrfWeatherPrecipitationType   mySurfaceCondition;
00159    mutable double      myLength;
00160    mutable bool        myRecomputeLength;
00161 
00162    static unsigned int theNextPathId;
00163 };
00164 
00165 typedef std::list<DtRailSegment *> DtRailSegmentList;
00166 typedef DtRailSegmentList::iterator DtRailSegmentListIterator;
00167 typedef DtRailSegmentList::const_iterator DtRailSegmentListConstIterator;
00168 
00169 namespace DtBufferSerialize
00170 {
00172    DT_DLL_vrfutil int getSize(const DtRailSegment& data);
00173 
00179    DT_DLL_vrfutil char *encode(const DtRailSegment& data, char *buffer);
00180 
00186    DT_DLL_vrfutil const char *decode(DtRailSegment &data, const char *buffer) ;
00187 }

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)