Developer documentation | Axl-2.5.1

axlFieldParametricCurveTangentVectorWriter.cpp
Go to the documentation of this file.
1 /* axlFieldParametricCurveTangentVectorWriter.cpp ---
2  *
3  * Author: Anais Ducoffe
4  * Copyright (C) 2013 - Anais Ducoffe, Inria.
5  */
6 
7 /* Commentary:
8  *
9  */
10 
11 /* Change log:
12  *
13  */
14 
16 
18 
19 #include <dtkCoreSupport/dtkAbstractData.h>
20 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
21 
22 // /////////////////////////////////////////////////////////////////
23 // axlFieldParametricCurveTangentVectorWriter
24 // /////////////////////////////////////////////////////////////////
25 
27 {
28  this->setObjectName(this->description());
29 }
30 
32 {
33 
34 }
35 
37 {
38  return "axlFieldParametricCurveTangentVectorWriter";
39 }
40 
42 {
43  return "axlFieldParametricCurveTangentVectorWriter";
44 }
45 
47 {
48  return QStringList() << "axlFieldParametricCurveTangentVector";
49 }
50 
52 {
53  return dtkAbstractDataFactory::instance()->registerDataWriterType("axlFieldParametricCurveTangentVectorWriter", QStringList(), createaxlFieldParametricCurveTangentVectorWriter);
54 }
55 
57 {
59  if(spatialField)
60  return true;
61 
62  return false;
63 }
64 
66 {
67  return !this->accept(data);
68 }
69 
70 QDomElement axlFieldParametricCurveTangentVectorWriter::write(QDomDocument *doc, dtkAbstractData *data)
71 {
73 
74  QDomElement fieldElement = doc->createElement("field");
75 
77  fieldElement.setAttribute("type", field->identifier());
78 
79  return fieldElement;
80 }
81 
82 
83 
84 QDomElement axlFieldParametricCurveTangentVectorWriter::elementByWriter(axlAbstractDataWriter *axl_writer, QDomDocument *doc, dtkAbstractData *data)
85 {
86  QDomElement element;
87 
88  if(!axl_writer)
89  return element;
90 
91  if(!axl_writer->accept(data))
92  return element;
93 
94  element = axl_writer->write(doc, data);
95 
96  return element;
97 }
98 
100 {
102 }
103 
virtual bool accept(dtkAbstractData *data)=0
dtkAbstractDataWriter * createaxlFieldParametricCurveTangentVectorWriter(void)
QDomElement write(QDomDocument *doc, dtkAbstractData *data)
Class axlFieldParametricCurveTangentVector defines an API for field which owns a BSpline Surface as a...
virtual QDomElement write(QDomDocument *doc, dtkAbstractData *data)=0
QString identifier(void) const
Returns the identifier of the field "axlFieldParametricCurveTangentVector".