Select Git revision
conftest.py
Frame.cpp 11.68 KiB
/**
* @file Frame.cpp
* @author Ulrich Kemloh <kemlohulrich@gmail.com>
* @version 0.1
* Copyright (C) <2009-2010>
*
* @section LICENSE
* This file is part of OpenPedSim.
*
* OpenPedSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenPedSim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenPedSim. If not, see <http://www.gnu.org/licenses/>.
*
* @section DESCRIPTION
* this class contains the collection of all
* pedestrians coordinates (trajectoryPoint) belonging to the same frame(i.e at the same time)
*
* @brief Hold all information that will be displayed on the screen (one frame)
*
* Created on: 10.07.2009
*
*/
#include <vector>
#include <iostream>
#include "general/Macros.h"
#include "FrameElement.h"
#include "Frame.h"
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkFloatArray.h>
#include <vtkPointData.h>
#include <vtkMath.h>
#include <vtkMatrix3x3.h>
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
Frame::Frame(int id)
{
_elementCursor=0;
_id=id;
_polydata2D = vtkPolyData::New();
_polydata3D = vtkPolyData::New();
_framePoints.reserve(1500);
}
Frame::~Frame()
{
while (!_framePoints.empty()) {
delete _framePoints.back();
_framePoints.pop_back();
}
_framePoints.clear();
_polydata2D->Delete();
_polydata3D->Delete();
}
int Frame::getSize()