PLYObservationIO.h
Go to the documentation of this file.
1 // (C) Copyright Renaud Detry 2007-2015.
2 // Distributed under the GNU General Public License and under the
3 // BSD 3-Clause License (See accompanying file LICENSE.txt).
4 
5 /** @file */
6 
7 #ifndef NUKLEI_PLYOBSERVATIONSERIAL_H
8 #define NUKLEI_PLYOBSERVATIONSERIAL_H
9 
10 
11 #include <nuklei/Definitions.h>
12 #include <nuklei/ObservationIO.h>
13 #include <nuklei/PLYObservation.h>
14 
15 
16 namespace nuklei {
17 
18 
20  {
21  public:
22  PLYReader(const std::string &observationFileName);
23  ~PLYReader();
24 
25  Observation::Type type() const { return Observation::PLY; }
26 
27  void reset();
28 
29  protected:
30  void init_();
31  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
32  private:
33  std::ifstream in_;
34  int index_;
35  int n_;
36  std::string observationFileName_;
37  };
38 
40  {
41  public:
42  PLYWriter(const std::string &observationFileName);
43  ~PLYWriter();
44 
45  Observation::Type type() const { return Observation::PLY; }
46 
47  void init();
48  void reset();
49 
50  NUKLEI_UNIQUE_PTR<Observation> templateObservation() const
51  { return NUKLEI_UNIQUE_PTR<Observation>(NUKLEI_MOVE(new PLYObservation)); }
52 
53  void writeObservation(const Observation &o);
54  void writeBuffer();
55 
56  private:
57  std::string observationFileName_;
58  std::vector<Vector3> points_;
59  };
60 
61 }
62 
63 #endif
64 
Definition: Observation.h:17
Public namespace.
Definition: Color.cpp:9
Base class for kernel reader and point reader classes.
Definition: ObservationIO.h:34
Base class for kernel writer and point writer classes.
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:06.