Developer documentation | Axl-2.5.1

axlFieldParametricNormalVectorCreator.cpp
Go to the documentation of this file.
1 /* axlFieldParametricNormalVectorCreator.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 
21 
22 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
23 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
24 #include <dtkCoreSupport/dtkGlobal.h>
25 #include <QtGui>
26 
27 class axlFieldParametricNormalVectorCreatorPrivate
28 {
29 public:
31 };
32 
34 {
35  d->input = NULL;
36 
37 }
38 
40 {
41  delete d;
42 
43  d = NULL;
44 }
45 
46 
47 void axlFieldParametricNormalVectorCreator::setInput(dtkAbstractData *data, int channel)
48 {
49  if(axlAbstractSurfaceParametric *surface = dynamic_cast<axlAbstractSurfaceParametric *>(data))
50  d->input = surface;
51 
52 }
53 
54 
56 {
57 
58  if(!d->input)
59  return 0;
60 
62 
63  QString newName = d->input->changeFieldName(field->objectName());
64  field->setObjectName(newName);
65  d->input->addField(field);
66  field->setSurface(d->input);
67 
68 
69  QList<axlAbstractData *>list;
70  list << d->input;
71  emit dataSetFieldsChanged(list, field->objectName());
72 
73  return 1;
74 
75 }
76 
77 
79 {
80  return 0;
81 }
82 
83 
85 {
86  return "axlFieldParametricNormalVectorCreator created fields for input tha compute the normal vector in each parameter coordinates of the input support.";
87 }
88 
90 {
91  return "axlFieldParametricNormalVectorCreator";
92 }
93 
94 // /////////////////////////////////////////////////////////////////
95 // Type instanciation
96 // /////////////////////////////////////////////////////////////////
97 
99 {
101 }
102 
void setSurface(axlAbstractData *data)
Sets the BSpline on which the BSpline field is applied.
void setInput(dtkAbstractData *data, int channel)
dtkAbstractProcess * createaxlFieldParametricNormalVectorCreator(void)
void dataSetFieldsChanged(QList< axlAbstractData * > dataSet, QString fieldName)
Class axlFieldParametricNormalVector defines an API for field which owns a BSpline Surface as a funct...