#include <RoadFeature.h>
Public Member Functions | |
CRoadFeature () | |
virtual | ~CRoadFeature () |
void | Serialize (CArchive &ar) |
WORD | getType () |
bool | getDirPos () |
int | getStart () |
int | getEnd () |
double | getValue () |
void | setType (WORD type) |
void | setDirPos (bool dirpos) |
void | setStart (int start) |
void | setEnd (int end) |
void | setValue (double val) |
Private Attributes | |
double | m_Value |
int | m_End |
int | m_Start |
bool | m_DirPos |
WORD | m_Type |
Definition at line 14 of file RoadFeature.h.
CRoadFeature::CRoadFeature | ( | ) |
Definition at line 21 of file RoadFeature.cpp.
References FEAT_SPEEDLIMIT.
00022 { 00023 m_Type = FEAT_SPEEDLIMIT; 00024 m_DirPos = true; 00025 m_Start = 0; 00026 m_End = 1000; 00027 m_Value = 41.7; // in m/s - about 150 km/h! 00028 }
CRoadFeature::~CRoadFeature | ( | ) | [virtual] |
void CRoadFeature::Serialize | ( | CArchive & | ar | ) |
Definition at line 35 of file RoadFeature.cpp.
References m_DirPos, m_End, m_Start, m_Type, and m_Value.
00036 { 00037 if (ar.IsStoring()) 00038 { 00039 ar << m_Type 00040 << static_cast<int>(m_DirPos) // because I read in an int below 00041 << m_Start 00042 << m_End 00043 << m_Value; 00044 } 00045 else 00046 { 00047 int temp; 00048 ar >> m_Type 00049 >> temp 00050 >> m_Start 00051 >> m_End 00052 >> m_Value; 00053 00054 m_DirPos = temp == 0 ? false : true; 00055 } 00056 }
WORD CRoadFeature::getType | ( | ) |
Definition at line 58 of file RoadFeature.cpp.
References m_Type.
Referenced by CEvolveTrafficView::DrawRoadSegments(), CRoadFeaturesDlg::LoadFeaturesIntoGrid(), CRoadFeaturesDlg::OnValidate(), CRoadFeaturesDlg::SetParamData(), and Road::SetSegmentFromFeature().
00059 { 00060 return m_Type; 00061 }
bool CRoadFeature::getDirPos | ( | ) |
Definition at line 63 of file RoadFeature.cpp.
References m_DirPos.
Referenced by CEvolveTrafficView::DrawRoadSegments(), CRoadFeaturesDlg::LoadFeaturesIntoGrid(), CRoadFeaturesDlg::OnValidate(), Road::SetGradientSegment(), and Road::SetSpeedLimitSegment().
00064 { 00065 return m_DirPos; 00066 }
int CRoadFeature::getStart | ( | ) |
Definition at line 68 of file RoadFeature.cpp.
References m_Start.
Referenced by CEvolveTrafficView::DrawRoadSegments(), CRoadFeaturesDlg::LoadFeaturesIntoGrid(), CRoadFeaturesDlg::OnValidate(), Road::SetGradientSegment(), Road::SetSegmentFromFeature(), and Road::SetSpeedLimitSegment().
00069 { 00070 return m_Start; 00071 }
int CRoadFeature::getEnd | ( | ) |
Definition at line 73 of file RoadFeature.cpp.
References m_End.
Referenced by CEvolveTrafficView::DrawRoadSegments(), CRoadFeaturesDlg::LoadFeaturesIntoGrid(), CRoadFeaturesDlg::OnValidate(), Road::SetGradientSegment(), Road::SetSegmentFromFeature(), and Road::SetSpeedLimitSegment().
00074 { 00075 return m_End; 00076 }
double CRoadFeature::getValue | ( | ) |
Definition at line 78 of file RoadFeature.cpp.
References m_Value.
Referenced by CEvolveTrafficView::DrawRoadSegments(), CRoadFeaturesDlg::LoadFeaturesIntoGrid(), CRoadFeaturesDlg::OnValidate(), Road::SetGradientSegment(), and Road::SetSpeedLimitSegment().
00079 { 00080 return m_Value; 00081 }
void CRoadFeature::setType | ( | WORD | type | ) |
Definition at line 83 of file RoadFeature.cpp.
References m_Type.
Referenced by CRoadFeaturesDlg::SetParamData().
00084 { 00085 m_Type = type; 00086 }
void CRoadFeature::setDirPos | ( | bool | dirpos | ) |
Definition at line 88 of file RoadFeature.cpp.
References m_DirPos.
Referenced by CRoadFeaturesDlg::SetParamData().
00089 { 00090 m_DirPos = dirpos; 00091 }
void CRoadFeature::setStart | ( | int | start | ) |
Definition at line 93 of file RoadFeature.cpp.
References m_Start.
Referenced by CRoadFeaturesDlg::OnValidate(), and CRoadFeaturesDlg::SetParamData().
00094 { 00095 m_Start = start; 00096 }
void CRoadFeature::setEnd | ( | int | end | ) |
Definition at line 98 of file RoadFeature.cpp.
References m_End.
Referenced by CRoadFeaturesDlg::OnValidate(), and CRoadFeaturesDlg::SetParamData().
00099 { 00100 m_End = end; 00101 }
void CRoadFeature::setValue | ( | double | val | ) |
Definition at line 103 of file RoadFeature.cpp.
References m_Value.
Referenced by CRoadFeaturesDlg::SetParamData().
00104 { 00105 m_Value = val; 00106 }
double CRoadFeature::m_Value [private] |
int CRoadFeature::m_End [private] |
int CRoadFeature::m_Start [private] |
bool CRoadFeature::m_DirPos [private] |
Definition at line 42 of file RoadFeature.h.
Referenced by getDirPos(), Serialize(), and setDirPos().
WORD CRoadFeature::m_Type [private] |