Developer documentation | Axl-2.5.1

axlFieldParametricCurveTangentVector.cpp
Go to the documentation of this file.
1 /* axlFieldParametricCurveTangentVector.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 #include <sstream>
15 
17 #include "axlAbstractProcess.h"
18 
19 #include "axlPoint.h"
20 #include "axlMesh.h"
21 
22 #include <dtkCoreSupport/dtkGlobal.h>
23 
24 #include <dtkCoreSupport/dtkAbstractDataFactory.h>
25 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
26 
28 
29 class axlFieldParametricCurveTangentVectorPrivate
30 {
31 public:
35 
37 };
38 
39 // /////////////////////////////////////////////////////////////////
40 // axlFieldParametricCurveTangentVector implementation
41 // /////////////////////////////////////////////////////////////////
42 
44 
48 {
49  d->input = NULL;
50  this->setObjectName(this->identifier());
54 }
55 
56 
57 
59 
63 {
64  delete d;
65 
66  d = NULL;
67 }
68 
69 
71 
74 double *axlFieldParametricCurveTangentVector::vector(double u, double v, double w)
75 {
76  if(!(this->kind() == Vector)) {
77  qDebug() << "Getting vector value on non vector field.";
78  return NULL;
79  }
80  axlMesh mesh = d->input->eval(u,1);
81  axlPoint *deriv1u = new axlPoint() ;
82  mesh.vertex(1, deriv1u);
83  double *tangent = deriv1u->coordinates();
84 
85  return tangent;
86 
87 }
88 
89 
90 
92 
96 {
97  return "axlFieldParametricCurveTangentVector";
98 }
99 
100 
102 
106 {
107  QString qstr;
108 
109  qstr.append("axlFieldParametricCurveTangentVector : \n");
110  qstr.append("Type : Double ");
111  qstr.append(";Kind : Vector ");
112  qstr.append(";Support : Point");
113 
114 
115  return qstr;
116 
117 }
118 
119 
121 
125  if(dynamic_cast<axlAbstractCurveParametric*>(data))
126  d->input = dynamic_cast<axlAbstractCurveParametric*>(data);
127 }
128 
129 
131 
135 
136  return d->input->startParam();
137 
138 }
139 
140 
141 
143 
147 
148  return d->input->endParam();
149 }
150 
151 
152 
154 
158 
159  return d->input->numSamples();
160 }
161 
162 
163 
165 
169  return d->input->numSamples();
170 }
171 
172 
173 
176 
180 {
181  emit updated();
182 }
183 
184 // /////////////////////////////////////////////////////////////////
185 // axlFieldParametricCurveTangentVector documentation
186 // /////////////////////////////////////////////////////////////////
187 
194 // /////////////////////////////////////////////////////////////////
195 // Type instanciation
196 // /////////////////////////////////////////////////////////////////
197 
199 {
201 }
202 
203 
204 
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
double * vector(double u, double v=0., double w=0.)
Returns the value of the spatial field at the coordinates point entered.
double * coordinates(void) const
Returns coordinates of this point.
Definition: axlPoint.cpp:445
Class axlAbstractFieldParametricCurve defines an API for parametric field.
void setCurve(axlAbstractData *data)
Sets the BSpline on which the BSpline field is applied.
axlMesh * mesh(void)
Return the mesh of that object is computed.
virtual Kind kind(void)
Generic interface for parametric curve.
virtual ~axlFieldParametricCurveTangentVector(void)
Destroys a Bspline field.
double start_u(void)
Returns the first parameter value of the field.
void vertex(const int &ind, double vertex[3])
set vertex values of vertices with index ind.
Definition: axlMesh.cpp:322
QString description(void) const
Returns the description of the field.
dtkAbstractData * createaxlFieldParametricCurveTangentVector(void)
int size(void)
Returns the number of values evaluated for this BSpline field on each samples of the input BSpline...
virtual void setType(Type type)
Sets the type of the field which can be either int, float or double.
Class axlFieldParametricCurveTangentVector defines an API for field which owns a BSpline Surface as a...
virtual void setSupport(Support support)
double end_u(void)
Returns the last parameter value of the field.
virtual void setKind(Kind kind)
Sets the kind of the field which can be either scalar, vector or tensor.
double numbersample_u(void)
Returns the number of parameters.
QString identifier(void) const
Returns the identifier of the field "axlFieldParametricCurveTangentVector".
Class axlAbstractData defines an API for all type of axel data.
Class axlMesh defines a piecewise-linear 3D object.
Definition: axlMesh.h:41