Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/TeamBallLocator/GT2005Particles/GT2005ParticleContainerSend.cpp

Go to the documentation of this file.

    00001 /**
    00002  * @file GT2005ParticleContainerSend.cpp
    00003  *
    00004  * This file contains a particle container used by the GT2005TeamBallLocator.
    00005  *
    00006  * @author <a href="mailto:christinez@gmx.de">Christine Zarges</a>
    00007  * @author <a href="mailto:Thorsten.Kerkhof@gmx.de">Thorsten Kerkhof</a>
    00008  */
    00009 //------------------------------------------------------------------------------
    00010 #include "GT2005ParticleContainerSend.h"
    00011 #include "Tools/Debugging/Debugging.h"
    00012 #include "Tools/Actorics/RobotDimensions.h"
    00013 #include "Tools/FieldDimensions.h"
    00014 #include "Platform/SystemCall.h"
    00015 #include "Tools/Debugging/DebugDrawings.h"
    00016 #include "Platform/GTAssert.h"
    00017 //------------------------------------------------------------------------------
    00018 GT2005ParticleContainerSend::GT2005ParticleContainerSend()
    00019 {
    00020   for (int i = 0; i < getNumberOfSamples(); i++)
    00021     array[i].setParameters(0, 0, 0, 0, 0, 0);
    00022 }
    00023 //------------------------------------------------------------------------------
    00024 int GT2005ParticleContainerSend::getNumberOfUsedSamples() const
    00025 {
    00026   int count = 0;
    00027   for (int i = 0; i < getNumberOfSamples(); i++)
    00028     if (((*this)[i]).probability != 0)
    00029       count++;
    00030   return count;
    00031 }
    00032 //------------------------------------------------------------------------------
    00033 Out& operator<<(Out& stream, const GT2005ParticleContainerSend& pbs)
    00034 {
    00035   stream << pbs.getNumberOfUsedSamples();
    00036   for (int i = 0; i < pbs.getNumberOfSamples(); i++)
    00037   {
    00038     if (pbs[i].probability != 0) stream << pbs[i];
    00039   }
    00040   return stream;
    00041 }
    00042 //------------------------------------------------------------------------------
    00043 In& operator>>(In& stream, GT2005ParticleContainerSend& pbs)
    00044 {
    00045   for (int i = 0; i < pbs.getNumberOfSamples(); i++)
    00046     pbs[i].setParameters(0, 0, 0, 0, 0, 0);
    00047   int numberOfUsedSamples;
    00048   stream >> numberOfUsedSamples;
    00049   for (int i = 0; i < numberOfUsedSamples; i++)
    00050     stream >> pbs[i];
    00051   return stream;
    00052 }
    00053 //------------------------------------------------------------------------------