DART  6.7.3
FileInfoC3D.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_UTILS_FILEINFOC3D_HPP_
34 #define DART_UTILS_FILEINFOC3D_HPP_
35 
36 #include <vector>
37 #include <Eigen/Dense>
38 
39 #include "dart/math/MathTypes.hpp"
40 
41 namespace dart {
42 namespace utils {
43 
44 class FileInfoC3D {
45 
46 public:
47  FileInfoC3D();
48  virtual ~FileInfoC3D(){}
49 
50  inline int getNumMarkers() const { return mNumMarkers; }
51  inline int getNumFrames() const { return mNumFrames; }
52  inline double getFPS() const { return mFPS; }
53 
54  inline Eigen::Vector3d getDataAt(int _frame, int _idx) const { return mData.at(_frame).at(_idx); }
55  inline void addData(const std::vector<Eigen::Vector3d>& _data) { mData.push_back(_data); }
56 
57  virtual bool loadFile(const char*);
58  virtual bool saveFile(const char*, int _start, int _end, double _sampleRate = 1);
59 
60 protected:
63  std::vector<std::vector<Eigen::Vector3d>> mData;
64  double mFPS;
65  char mFileName[256]; // change to string?
66 };
67 
68 } // namespace utils
69 } // namespace dart
70 
71 #endif // #ifndef DART_UTILS_FILEINFOC3D_HPP_
72 
Definition: FileInfoC3D.hpp:44
int mNumMarkers
Definition: FileInfoC3D.hpp:61
virtual ~FileInfoC3D()
Definition: FileInfoC3D.hpp:48
char mFileName[256]
Definition: FileInfoC3D.hpp:65
FileInfoC3D()
Definition: FileInfoC3D.cpp:41
double mFPS
Definition: FileInfoC3D.hpp:64
virtual bool saveFile(const char *, int _start, int _end, double _sampleRate=1)
Note: down sampling not implemented yet.
Definition: FileInfoC3D.cpp:59
std::vector< std::vector< Eigen::Vector3d > > mData
Definition: FileInfoC3D.hpp:63
virtual bool loadFile(const char *)
Definition: FileInfoC3D.cpp:46
int mNumFrames
Definition: FileInfoC3D.hpp:62
int getNumMarkers() const
Definition: FileInfoC3D.hpp:50
double getFPS() const
Definition: FileInfoC3D.hpp:52
void addData(const std::vector< Eigen::Vector3d > &_data)
Definition: FileInfoC3D.hpp:55
Eigen::Vector3d getDataAt(int _frame, int _idx) const
Note: not checking index range.
Definition: FileInfoC3D.hpp:54
int getNumFrames() const
Definition: FileInfoC3D.hpp:51
Definition: BulletCollisionDetector.cpp:63