Developer documentation | Axl-2.5.1

axlAbstractDataWriter.h
Go to the documentation of this file.
1 /* axlAbstractDataWriter.h ---
2  *
3  * Author: Meriadeg Perrinel
4  * Copyright (C) 2008-2011 - Meriadeg Perrinel, Inria.
5  * Created: Wed Sep 21 10:36:05 2011 (+0200)
6  * Version: $Id$
7  * Last-Updated: Tue Jan 24 10:53:48 2012 (+0100)
8  * By: Julien Wintz
9  * Update #: 27
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
20 #ifndef AXLABSTRACTDATAWRITER_H
21 #define AXLABSTRACTDATAWRITER_H
22 
23 #include "axlCoreExport.h"
24 
26 #include <dtkCoreSupport/dtkAbstractDataWriter.h>
27 
28 #include <QtCore>
29 #include <QtXml>
30 
31 class axlMesh;
32 
33 class dtkAbstractData;
34 
35 class AXLCORE_EXPORT axlAbstractDataWriter : public dtkAbstractDataWriter
36 {
37  Q_OBJECT
38 
39 public:
41  virtual ~axlAbstractDataWriter(void);
42 
43 public:
44  virtual bool accept(dtkAbstractData *data) = 0;
45  virtual bool reject(dtkAbstractData *data) = 0;
46 
47  using dtkAbstractDataWriter::write;
48  virtual QDomElement write(QDomDocument *doc, dtkAbstractData *data) = 0;
49  // virtual axlMesh *toAxlMesh(dtkAbstractData *data);
50 
51  void setName (QDomElement& e, axlAbstractData *data);
52  void setColor (QDomElement& e, axlAbstractData *data);
53  void setSize (QDomElement& e, axlAbstractData *data);
54  void setShader (QDomElement& e, axlAbstractData *data);
55 
56 };
57 
58 #define append_element_doc(Elt, Doc, Name, fct) \
59 { QDomElement dom = Doc->createElement(Name); \
60  dom.appendChild(Doc->createTextNode(fct)); \
61  Elt.appendChild(dom); }
62 
63 #endif //AXLABSTRACTDATAWRITER_H
#define AXLCORE_EXPORT
Class axlAbstractData defines an API for all type of axel data.
Class axlMesh defines a piecewise-linear 3D object.
Definition: axlMesh.h:41