DART 6.12.2
Loading...
Searching...
No Matches
FileInfoC3D.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2021, 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
38#include <Eigen/Dense>
39
41
42namespace dart {
43namespace utils {
44
46{
47public:
49 virtual ~FileInfoC3D() {}
50
51 inline int getNumMarkers() const
52 {
53 return mNumMarkers;
54 }
55 inline int getNumFrames() const
56 {
57 return mNumFrames;
58 }
59 inline double getFPS() const
60 {
61 return mFPS;
62 }
63
64 inline Eigen::Vector3d getDataAt(int _frame, int _idx) const
65 {
66 return mData.at(_frame).at(_idx);
67 }
68 inline void addData(const std::vector<Eigen::Vector3d>& _data)
69 {
70 mData.push_back(_data);
71 }
72
73 virtual bool loadFile(const char*);
74 virtual bool saveFile(
75 const char*,
76 int _start,
77 int _end,
78 double _sampleRate = 1);
79
80protected:
83 std::vector<std::vector<Eigen::Vector3d>> mData;
84 double mFPS;
85 char mFileName[256]; // change to string?
86};
87
88} // namespace utils
89} // namespace dart
90
91#endif // #ifndef DART_UTILS_FILEINFOC3D_HPP_
Definition FileInfoC3D.hpp:46
int mNumMarkers
Definition FileInfoC3D.hpp:81
virtual ~FileInfoC3D()
Definition FileInfoC3D.hpp:49
char mFileName[256]
Definition FileInfoC3D.hpp:85
FileInfoC3D()
Definition FileInfoC3D.cpp:42
double mFPS
Definition FileInfoC3D.hpp:84
virtual bool saveFile(const char *, int _start, int _end, double _sampleRate=1)
Note: down sampling not implemented yet.
Definition FileInfoC3D.cpp:63
std::vector< std::vector< Eigen::Vector3d > > mData
Definition FileInfoC3D.hpp:83
virtual bool loadFile(const char *)
Definition FileInfoC3D.cpp:47
int mNumFrames
Definition FileInfoC3D.hpp:82
int getNumMarkers() const
Definition FileInfoC3D.hpp:51
double getFPS() const
Definition FileInfoC3D.hpp:59
void addData(const std::vector< Eigen::Vector3d > &_data)
Definition FileInfoC3D.hpp:68
Eigen::Vector3d getDataAt(int _frame, int _idx) const
Note: not checking index range.
Definition FileInfoC3D.hpp:64
int getNumFrames() const
Definition FileInfoC3D.hpp:55
Definition BulletCollisionDetector.cpp:60