AnimatLab  2
Go to the documentation of this file.
7 #include "StdAfx.h"
8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
10 #include "AnimatBase.h"
12 #include "Gain.h"
13 #include "Node.h"
14 #include "Link.h"
15 #include "IPhysicsMovableItem.h"
16 #include "IPhysicsBody.h"
17 #include "BoundingBox.h"
18 #include "MovableItem.h"
19 #include "BodyPart.h"
20 #include "Joint.h"
21 #include "ReceptiveField.h"
22 #include "ContactSensor.h"
23 #include "RigidBody.h"
24 #include "Structure.h"
25 #include "NeuralModule.h"
26 #include "Adapter.h"
27 #include "NervousSystem.h"
28 #include "Organism.h"
29 #include "ActivatedItem.h"
30 #include "ActivatedItemMgr.h"
31 #include "DataColumn.h"
32 #include "DataChart.h"
33 #include "ArrayChart.h"
34 #include "DataChartMgr.h"
35 #include "ExternalStimuliMgr.h"
36 #include "KeyFrame.h"
37 #include "SimulationRecorder.h"
38 #include "OdorType.h"
39 #include "Odor.h"
40 #include "Light.h"
41 #include "LightManager.h"
42 #include "Simulator.h"
44 namespace AnimatSim
45 {
46  namespace Charting
47  {
55 {
56 }
65 {
67 try
68 {
69 }
70 catch(...)
71 {Std_TraceMsg(0, "Caught Error in desctructor of ArrayChart\r\n", "", -1, false, true);}
72 }
74 std::string ArrayChart::Type() {return "ArrayChart";}
86 void ArrayChart::CurrentRow(long iVal) {}
89 {
94  m_lCurrentRow = m_lRowCount; //Set this to row count so it will always put back that there are that many rows to go back
96  //First lets determine the buffer space that will be required for this chart.
97  long lBuffSize = m_lColumnCount * m_lRowCount;
99  if(lBuffSize > MAX_DATA_CHART_BUFFER)
100  THROW_PARAM_ERROR(Al_Err_lExceededMaxBuffer, Al_Err_strExceededMaxBuffer, "Buffer Size", lBuffSize);
102  if(m_aryDataBuffer) delete[] m_aryDataBuffer;
103  m_aryDataBuffer = NULL;
105  if(m_aryTimeBuffer) delete[] m_aryTimeBuffer;
106  m_aryTimeBuffer = NULL;
108  //Create the buffer and initialize it.
109  m_aryDataBuffer = new float[lBuffSize];
110  memset(m_aryDataBuffer, 0, (sizeof(float) * lBuffSize));
112  //Now initialize the data columns.
113  int iCount = m_aryDataColumns.GetSize();
114  for(int iCol=0; iCol<iCount; iCol++)
115  m_aryDataColumns[iCol]->Initialize();
116 }
119 {
120 }
123 {
125  {
126  int iCount = m_aryDataColumns.GetSize();
127  for(int iCol=0; iCol<iCount; iCol++)
129  }
130 }
132 void ArrayChart::Load(CStdXml &oXml)
133 {
134  DataChart::Load(oXml);
136  oXml.IntoElem(); //Into DataChart Element
137  Std_LoadPoint(oXml, "Size", m_vArraySize);
138  oXml.OutOfElem(); //OutOf DataChart Element
139 }
142  } //Charting
143 } //AnimatSim
Base class file for all Animat simulation objects.
Declares the nervous system class.
Declares the simulation recorder class.
Root namespace for the base simulation library for AnimatLab.
float * m_aryDataBuffer
Buffer for data variable points.
Definition: DataChart.h:66
Declares the body part class.
virtual long CurrentRow()
Gets the current row.
Definition: DataChart.cpp:386
Simulator * m_lpSim
The pointer to a Simulation.
Definition: AnimatBase.h:43
virtual bool IntoElem()
Goes into the next element where the cursor is located.
Definition: StdXml.cpp:42
virtual ~ArrayChart()
Definition: ArrayChart.cpp:64
virtual void StepSimulation()
Step the simulation for this object.
Definition: ArrayChart.cpp:122
Declares the key frame class.
Declares the joint class.
Declares the organism class.
Declares a light object.
long m_lColumnCount
Number of data columns.
Definition: DataChart.h:69
Declares the activated item class.
Declares the data column class.
virtual void Load(std::string strProjectPath, std::string strConfigFile)
Loads a data chart from a file.
Definition: DataChart.cpp:867
Declares a light manager object.
Declares the bounding box class.
Declares the gain base class.
A standard xml manipulation class.
Definition: StdXml.h:19
Declares the node class.
virtual std::string Type()
returns the string type name of this object.
Definition: ArrayChart.cpp:74
Declares the array chart class.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
Default constructor.
Definition: ArrayChart.cpp:54
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
Definition: StdXml.cpp:56
CStdPtrArray< DataColumn > m_aryDataColumns
The primary array of data columns. This array deletes the columns when destructed.
Definition: DataChart.h:60
Declares the data chart class.
long m_lRowCount
Number of rows in the buffer.
Definition: DataChart.h:72
Declares the data chart manager class.
Declares the rigid body class.
virtual void Initialize()
Initializes this object.
Definition: ArrayChart.cpp:88
bool Std_LoadPoint(CStdXml &oXml, std::string strName, CStdIPoint &oPoint, bool bThrowError)
Standard load point.
float * m_aryTimeBuffer
Buffer for time data points.
Definition: DataChart.h:63
CStdFPoint m_vArraySize
Size of the 3-D array of data.
Definition: ArrayChart.h:23
virtual long TimeSlice()
Gets the current time slice.
Definition: Simulator.cpp:613
Declares the structure class.
Declares the odor type class.
virtual void Initialize()
Initializes this object.
Declares the odor class.
Declares the simulator class.
virtual void ReInitialize()
Re-initialize this object.
Definition: ArrayChart.cpp:118
Declares the neural module class.
int m_lCurrentRow
The currently selected row.
Definition: DataChart.h:78
Declares the activated item manager class.
Declares the contact sensor class.
Declares the external stimuli manager class.
Declares the receptive field class.
short m_iCollectInterval
Tells what the time slice step interval to use when collecting data. This is.
Definition: DataChart.h:44