#include <srDoc.h>
Public Member Functions | |
Simulation * | GetSimulation () |
CString | GetSelectedObject () |
const std::vector< ObjectDescription > & | GetObjectDescriptionTree () const |
ObjectType | GetType (CString fullName) const |
bool | IsRestoringLayout () |
const char * | GetLayoutFile () |
void | NewSection (const CString &sSection) |
void | WriteString (const CString &sName, const CString &sValue) |
void | WriteInt (const CString &sName, int nValue) |
void | WriteDouble (const CString &sName, double value) |
CString | ReadString (const CString &sName) |
int | ReadInt (const CString &sName) |
double | ReadDouble (const CString &sName) |
void | OnSelected (SimObject *) |
void | OnConsoleCommand (const char *command) |
void | OnConsoleCompletion (char *command, bool forard) |
virtual BOOL | OnNewDocument () |
virtual void | Serialize (CArchive &ar) |
virtual void | OnCloseDocument () |
virtual BOOL | OnOpenDocument (LPCTSTR lpszPathName) |
virtual BOOL | CanCloseFrame (CFrameWnd *pFrame) |
virtual | ~CDoc () |
Public Attributes | |
CString | m_sLayoutFile |
Static Public Attributes | |
static CDoc * | theDocument = 0 |
Protected Member Functions | |
CDoc () | |
afx_msg void | OnSimReset () |
afx_msg void | OnUpdateSimReset (CCmdUI *pCmdUI) |
afx_msg void | OnSimStart () |
afx_msg void | OnUpdateSimStart (CCmdUI *pCmdUI) |
afx_msg void | OnSimStep () |
afx_msg void | OnUpdateSimStep (CCmdUI *pCmdUI) |
afx_msg void | OnViewTree () |
afx_msg void | OnUpdateSteps (CCmdUI *pCmdUI) |
afx_msg void | OnKey0 () |
afx_msg void | OnKey1 () |
afx_msg void | OnKey2 () |
afx_msg void | OnKey3 () |
afx_msg void | OnKey4 () |
afx_msg void | OnKey5 () |
afx_msg void | OnKey6 () |
afx_msg void | OnKey7 () |
afx_msg void | OnKey8 () |
afx_msg void | OnKey9 () |
afx_msg void | OnKeyDec () |
Private Member Functions | |
void | Compile () |
virtual void | OnIdle () |
virtual void | UpdateFrameCounts () |
bool | InitLayoutFile () |
int | GetNumberFromWindow (CWnd *pWnd) |
CView * | GetViewFromNumber (int n) |
void | WriteLayout () |
void | RestoreLayout () |
Private Attributes | |
bool | m_bRunning |
bool | m_bStep |
Controller * | m_pController |
Simulation * | m_pSim |
CString | m_sStatusMessage |
CString | m_sSection |
CMapStringToPtr | m_map |
std::vector< ObjectDescription > | m_objectDescriptionTree |
ErrorDescription | m_errorDescription |
Definition at line 21 of file srDoc.h.
CDoc::~CDoc | ( | ) | [virtual] |
Definition at line 105 of file srDoc.cpp.
References Controller::destroy(), m_pController, m_pSim, and theDocument.
void CDoc::Compile | ( | ) | [private] |
Definition at line 159 of file srDoc.cpp.
References Connection::createController(), Simulation::getFirstError(), Simulation::getObjectDescriptionTree(), Simulation::hasSceneGraphChanged(), IDS_NOCONTROLLER, IDS_SUCCESS, Simulation::loadFile(), m_errorDescription, m_objectDescriptionTree, m_pController, m_pSim, m_sStatusMessage, Connection::next, Simulation::resetSceneGraphChanged(), Connection::sceneName, and Connection::start.
Referenced by OnSimReset(), and RestoreLayout().
const char* CDoc::GetLayoutFile | ( | ) | [inline] |
int CDoc::GetNumberFromWindow | ( | CWnd * | pWnd | ) | [private] |
const std::vector<ObjectDescription>& CDoc::GetObjectDescriptionTree | ( | ) | const [inline] |
Definition at line 47 of file srDoc.h.
References m_objectDescriptionTree.
Referenced by CTree::OnUpdate().
CString CDoc::GetSelectedObject | ( | ) |
Definition at line 209 of file srDoc.cpp.
References ASSERT.
Referenced by CSensor::OnInitialUpdate(), CObjectView::OnInitialUpdate(), and CActuator::OnInitialUpdate().
Simulation* CDoc::GetSimulation | ( | ) | [inline] |
Definition at line 45 of file srDoc.h.
References m_pSim.
Referenced by CObjectView::computeZoom(), Controller::Controller(), CSensor::DrawDirect(), CObjectView::OnLButtonDown(), CObjectView::OnLButtonUp(), CObjectView::OnMouseMove(), CObjectView::OnRButtonDown(), CObjectView::OnRButtonUp(), CSensor::OnUpdate(), CActuator::OnUpdate(), OnUpdateSteps(), CObjectFrame::OnUpdateViewTurn(), CTree::OnViewSelected(), CObjectFrame::OnViewTurn(), CSensor::SetClipboardText(), and CTree::WriteLayout().
ObjectType CDoc::GetType | ( | CString | fullName | ) | const |
Definition at line 223 of file srDoc.cpp.
References m_objectDescriptionTree, m_pSim, and OBJECT_TYPE_NONE.
Referenced by CObjectView::OnUpdate().
CView * CDoc::GetViewFromNumber | ( | int | n | ) | [private] |
bool CDoc::InitLayoutFile | ( | ) | [private] |
Definition at line 233 of file srDoc.cpp.
References m_map, and m_sLayoutFile.
Referenced by RestoreLayout(), and WriteLayout().
bool CDoc::IsRestoringLayout | ( | ) | [inline] |
Definition at line 50 of file srDoc.h.
References m_sLayoutFile.
Referenced by CTree::RestoreLayout(), CSensor::RestoreLayout(), CObjectView::RestoreLayout(), CFrame::RestoreLayout(), CEditor::RestoreLayout(), and CActuator::RestoreLayout().
void CDoc::NewSection | ( | const CString & | sSection | ) |
Definition at line 246 of file srDoc.cpp.
References m_map, and m_sSection.
Referenced by CTree::RestoreLayout(), CSensor::RestoreLayout(), CObjectFrame::RestoreLayout(), CObjectView::RestoreLayout(), CFrame::RestoreLayout(), CEditor::RestoreLayout(), RestoreLayout(), CActuator::RestoreLayout(), CTree::WriteLayout(), CSensor::WriteLayout(), CObjectFrame::WriteLayout(), CObjectView::WriteLayout(), CFrame::WriteLayout(), CEditor::WriteLayout(), WriteLayout(), and CActuator::WriteLayout().
void CDoc::OnCloseDocument | ( | ) | [virtual] |
void CDoc::OnConsoleCommand | ( | const char * | command | ) |
Definition at line 448 of file srDoc.cpp.
References m_pController, and Controller::onConsoleCommand().
Referenced by CConsoleEdit::OnChar().
void CDoc::OnConsoleCompletion | ( | char * | command, | |
bool | forard | |||
) |
Definition at line 454 of file srDoc.cpp.
References m_pController, and Controller::onConsoleCompletion().
Referenced by CConsoleEdit::OnChar().
void CDoc::OnIdle | ( | ) | [private, virtual] |
Definition at line 536 of file srDoc.cpp.
References Simulation::doSimulationStep(), Controller::execute(), Simulation::getObjectDescriptionTree(), Simulation::hasSceneGraphChanged(), m_bRunning, m_bStep, m_objectDescriptionTree, m_pController, m_pSim, m_sStatusMessage, UPDATE_ACTORS, and UPDATE_SENSORS.
void CDoc::OnKey0 | ( | ) | [protected] |
void CDoc::OnKey1 | ( | ) | [protected] |
void CDoc::OnKey2 | ( | ) | [protected] |
void CDoc::OnKey3 | ( | ) | [protected] |
void CDoc::OnKey4 | ( | ) | [protected] |
void CDoc::OnKey5 | ( | ) | [protected] |
void CDoc::OnKey6 | ( | ) | [protected] |
void CDoc::OnKey7 | ( | ) | [protected] |
void CDoc::OnKey8 | ( | ) | [protected] |
void CDoc::OnKey9 | ( | ) | [protected] |
void CDoc::OnKeyDec | ( | ) | [protected] |
BOOL CDoc::OnOpenDocument | ( | LPCTSTR | lpszPathName | ) | [virtual] |
void CDoc::OnSelected | ( | SimObject * | ) |
Definition at line 442 of file srDoc.cpp.
References m_pController, and Controller::onSelected().
Referenced by CObjectView::OnLButtonDblClk().
void CDoc::OnSimReset | ( | ) | [protected] |
Definition at line 467 of file srDoc.cpp.
References ErrorDescription::column, Compile(), Controller::destroy(), ID_VIEW_TREE, ErrorDescription::line, m_bRunning, m_errorDescription, m_pController, m_pSim, UPDATE_ERROR, and UPDATE_SUCCESS.
Referenced by OnSimStart(), and OnSimStep().
void CDoc::OnSimStart | ( | ) | [protected] |
void CDoc::OnSimStep | ( | ) | [protected] |
void CDoc::OnUpdateSimReset | ( | CCmdUI * | pCmdUI | ) | [protected] |
void CDoc::OnUpdateSimStart | ( | CCmdUI * | pCmdUI | ) | [protected] |
void CDoc::OnUpdateSimStep | ( | CCmdUI * | pCmdUI | ) | [protected] |
void CDoc::OnUpdateSteps | ( | CCmdUI * | pCmdUI | ) | [protected] |
double CDoc::ReadDouble | ( | const CString & | sName | ) |
Definition at line 293 of file srDoc.cpp.
References ReadString().
Referenced by CObjectView::RestoreLayout().
int CDoc::ReadInt | ( | const CString & | sName | ) |
Definition at line 284 of file srDoc.cpp.
References ReadString().
Referenced by CTree::RestoreLayout(), CSensor::RestoreLayout(), CObjectFrame::RestoreLayout(), CObjectView::RestoreLayout(), CFrame::RestoreLayout(), CEditor::RestoreLayout(), RestoreLayout(), and CActuator::RestoreLayout().
CString CDoc::ReadString | ( | const CString & | sName | ) |
Definition at line 278 of file srDoc.cpp.
References m_sSection.
Referenced by ReadDouble(), ReadInt(), CTree::RestoreLayout(), CSensor::RestoreLayout(), CObjectView::RestoreLayout(), RestoreLayout(), and CActuator::RestoreLayout().
void CDoc::RestoreLayout | ( | ) | [private] |
Definition at line 386 of file srDoc.cpp.
References Compile(), CApp::CreateActuator(), CApp::CreateObject(), CApp::CreateSensor(), CApp::CreateTree(), GetViewFromNumber(), InitLayoutFile(), m_bRunning, m_pSim, m_sLayoutFile, NewSection(), ReadInt(), ReadString(), and CApp::SetOrder().
Referenced by OnOpenDocument().
void CDoc::WriteDouble | ( | const CString & | sName, | |
double | value | |||
) |
Definition at line 271 of file srDoc.cpp.
References WriteString().
Referenced by CObjectView::WriteLayout().
void CDoc::WriteInt | ( | const CString & | sName, | |
int | nValue | |||
) |
Definition at line 264 of file srDoc.cpp.
References WriteString().
Referenced by CTree::WriteLayout(), CSensor::WriteLayout(), CObjectFrame::WriteLayout(), CObjectView::WriteLayout(), CFrame::WriteLayout(), CEditor::WriteLayout(), WriteLayout(), and CActuator::WriteLayout().
void CDoc::WriteLayout | ( | ) | [private] |
Definition at line 323 of file srDoc.cpp.
References GetNumberFromWindow(), InitLayoutFile(), m_bRunning, m_pSim, m_sLayoutFile, NewSection(), WriteInt(), CFrame::WriteLayout(), and WriteString().
Referenced by OnCloseDocument().
void CDoc::WriteString | ( | const CString & | sName, | |
const CString & | sValue | |||
) |
Definition at line 259 of file srDoc.cpp.
References m_sSection.
Referenced by WriteDouble(), WriteInt(), CTree::WriteLayout(), CSensor::WriteLayout(), CObjectView::WriteLayout(), WriteLayout(), and CActuator::WriteLayout().
bool CDoc::m_bRunning [private] |
Definition at line 24 of file srDoc.h.
Referenced by OnIdle(), OnSimReset(), OnSimStart(), OnSimStep(), OnUpdateSimStart(), OnUpdateSimStep(), RestoreLayout(), and WriteLayout().
bool CDoc::m_bStep [private] |
ErrorDescription CDoc::m_errorDescription [private] |
CMapStringToPtr CDoc::m_map [private] |
std::vector<ObjectDescription> CDoc::m_objectDescriptionTree [private] |
Controller* CDoc::m_pController [private] |
Definition at line 26 of file srDoc.h.
Referenced by Compile(), OnConsoleCommand(), OnConsoleCompletion(), OnIdle(), OnKey0(), OnKey1(), OnKey2(), OnKey3(), OnKey4(), OnKey5(), OnKey6(), OnKey7(), OnKey8(), OnKey9(), OnKeyDec(), OnSelected(), OnSimReset(), and ~CDoc().
Simulation* CDoc::m_pSim [private] |
Definition at line 27 of file srDoc.h.
Referenced by Compile(), GetSimulation(), GetType(), OnIdle(), OnSimReset(), OnSimStart(), OnSimStep(), RestoreLayout(), WriteLayout(), and ~CDoc().
CString CDoc::m_sLayoutFile |
Definition at line 44 of file srDoc.h.
Referenced by GetLayoutFile(), InitLayoutFile(), IsRestoringLayout(), RestoreLayout(), and WriteLayout().
CString CDoc::m_sSection [private] |
CString CDoc::m_sStatusMessage [private] |
CDoc * CDoc::theDocument = 0 [static] |