snark
ModelReader.h
1 // This file is part of snark, a generic and flexible library
2 // for robotics research.
3 //
4 // Copyright (C) 2011 The University of Sydney
5 //
6 // snark is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 3 of the License, or (at your option) any later version.
10 //
11 // snark is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 // for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with snark. If not, see <http://www.gnu.org/licenses/>.
18 
20 
21 #ifndef SNARK_GRAPHICS_APPLICATIONS_VIEWPOINTS_MODEL_READER_H_
22 #define SNARK_GRAPHICS_APPLICATIONS_VIEWPOINTS_MODEL_READER_H_
23 
24 
25 #include "./Reader.h"
26 #include "./PlyLoader.h"
27 
28 class QGLAbstractScene;
29 
30 namespace snark { namespace graphics { namespace View {
31 
33 class ModelReader : public Reader
34 {
35  public:
36  ModelReader( QGLView& viewer, comma::csv::options& options, const std::string& file, bool flip, coloured* c, const std::string& label );
37 
38  void start();
39  void update( const Eigen::Vector3d& offset );
40  const Eigen::Vector3d& somePoint() const;
41  bool readOnce();
42  void render( QGLPainter *painter );
43  bool empty() const;
44 
45  protected:
46  boost::scoped_ptr< comma::csv::input_stream< PointWithId > > m_stream;
47  const std::string m_file;
48  QGLAbstractScene* m_scene;
49  bool m_flip;
50  boost::optional< PlyLoader > m_plyLoader;
51 };
52 
53 } } } // namespace snark { namespace graphics { namespace View {
54 
55 #endif /*SNARK_GRAPHICS_APPLICATIONS_VIEWPOINTS_MODEL_READER_H_*/