CoViS3DObservationIO.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_COVIS3DOBSERVATIONSERIAL_H
8 #define NUKLEI_COVIS3DOBSERVATIONSERIAL_H
9 
10 
11 #include <nuklei/Definitions.h>
12 #include <nuklei/ObservationIO.h>
14 
15 #ifdef NUKLEI_USE_TICPP
16 namespace ticpp {
17  class Document;
18  class Node;
19  class Element;
20  template < class T > class Iterator;
21 }
22 #endif
23 
24 namespace nuklei {
25 
27  {
28  public:
29  CoViS3DReader(const std::string &observationFileName);
30  ~CoViS3DReader();
31 
32  Observation::Type type() const { return Observation::COVIS3D; }
33 
34  void reset();
35 
36  protected:
37  void init_();
38  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
39  std::string observationFileName;
40  private:
41  boost::shared_ptr<CoViS3DReader> reader_;
42  };
43 
45  {
46  public:
47  CoViS3DXMLReader(const std::string &observationFileName);
49 
50  void reset();
51 
52  protected:
53  void init_();
54  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
55  private:
56 #ifdef NUKLEI_USE_TICPP
57  boost::shared_ptr<ticpp::Document> in_;
58  typedef ticpp::Iterator< ticpp::Element > ElementIterator;
59  boost::shared_ptr<ElementIterator> e_;
60 #endif
61  };
62 
63 
65  {
66  public:
67  CoViS3DWandererReader(const std::string &observationFileName);
69 
70  void reset();
71 
72  protected:
73  void init_();
74  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
75  private:
76  std::ifstream in_;
77  };
78 
80  {
81  public:
82  CoViS3DXMLWriter(const std::string &observationFileName);
84 
85  Observation::Type type() const { return Observation::COVIS3D; }
86 
87  void init();
88  void reset();
89 
90  NUKLEI_UNIQUE_PTR<Observation> templateObservation() const
91  { return NUKLEI_UNIQUE_PTR<Observation>(NUKLEI_MOVE(new CoViS3DObservation)); }
92 
93  void writeObservation(const Observation &o);
94  void writeBuffer();
95 
96  private:
97  std::string observationFileName;
98 #ifdef NUKLEI_USE_TICPP
99  boost::shared_ptr<ticpp::Document> out_;
100  ticpp::Element* scene_;
101 #endif
102  };
103 
104 }
105 
106 #endif
107 
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.