MOOS 0.2375
|
00001 00002 // 00003 // MOOS - Mission Oriented Operating Suite 00004 // 00005 // A suit of Applications and Libraries for Mobile Robotics Research 00006 // Copyright (C) 2001-2005 Massachusetts Institute of Technology and 00007 // Oxford University. 00008 // 00009 // This software was written by Paul Newman at MIT 2001-2002 and Oxford 00010 // University 2003-2005. email: pnewman@robots.ox.ac.uk. 00011 // 00012 // This file is part of a MOOS Utility Component. 00013 // 00014 // This program is free software; you can redistribute it and/or 00015 // modify it under the terms of the GNU General Public License as 00016 // published by the Free Software Foundation; either version 2 of the 00017 // License, or (at your option) any later version. 00018 // 00019 // This program is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 // General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with this program; if not, write to the Free Software 00026 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00027 // 02111-1307, USA. 00028 // 00030 00031 // AcousticNode.cpp: implementation of the CAcousticNode class. 00032 // 00034 #ifdef _WIN32 00035 #pragma warning(disable : 4786) 00036 #endif 00037 00038 #include "AcousticNode.h" 00039 00041 // Construction/Destruction 00043 00044 CAcousticNode::CAcousticNode() 00045 { 00046 m_OffsetPos.ReSize(3,1); 00047 m_OffsetPos = 0; 00048 00049 m_bEnabled = true; 00050 00051 00052 00053 00054 } 00055 00056 CAcousticNode::CAcousticNode(double dfX,double dfY,double dfZ) 00057 { 00058 m_OffsetPos.ReSize(3,1); 00059 00060 m_OffsetPos <<dfX 00061 <<dfY 00062 <<dfZ; 00063 00064 } 00065 00066 CAcousticNode::~CAcousticNode() 00067 { 00068 00069 } 00070 00071 CSimEntity * CAcousticNode::GetParent() 00072 { 00073 return m_pParent; 00074 } 00075 00076 00077 void CAcousticNode::SetParent(CSimEntity *pParent) 00078 { 00079 m_pParent = pParent; 00080 } 00081 00082 00083 bool CAcousticNode::Listening(AcousticChannel eChan) 00084 { 00085 if(!m_bEnabled) 00086 return false; 00087 00088 return m_RxChannels.find(eChan)!=m_RxChannels.end(); 00089 } 00090 00091 bool CAcousticNode::SetRxChan(AcousticChannel eChan, bool bAdd) 00092 { 00093 if(bAdd) 00094 { 00095 m_RxChannels.insert(eChan); 00096 } 00097 else 00098 { 00099 m_RxChannels.erase(eChan); 00100 } 00101 00102 return true; 00103 } 00104 00105 bool CAcousticNode::SetTxChan(AcousticChannel eChan) 00106 { 00107 m_TxChannel = eChan; 00108 00109 return true; 00110 } 00111 00112 00113 AcousticChannel CAcousticNode::GetTxChannel() 00114 { 00115 return m_TxChannel; 00116 } 00117 00118 bool CAcousticNode::OnAcousticHit(CAcousticSignal &Signal, double dfTime) 00119 { 00120 return true; 00121 } 00122 00123 bool CAcousticNode::Iterate(double dfTimeNow) 00124 { 00125 return true; 00126 } 00127 00128 bool CAcousticNode::SetEnvironment(CSimEnvironment *pEnv) 00129 { 00130 m_pEnvironment = pEnv; 00131 00132 return pEnv!=NULL; 00133 } 00134 00135 string CAcousticNode::GetFullName() 00136 { 00137 return ((CSimBase*)m_pParent)->GetName()+"/"+GetName(); 00138 }