Forge
vector_field.h
Go to the documentation of this file.
1 /*******************************************************
2  * Copyright (c) 2015-2019, ArrayFire
3  * All rights reserved.
4  *
5  * This file is distributed under 3-clause BSD license.
6  * The complete license agreement can be obtained at:
7  * http://arrayfire.com/licenses/BSD-3-Clause
8  ********************************************************/
9 
10 #pragma once
11 
12 #include <fg/defines.h>
13 
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
35  const unsigned pNPoints,
36  const fg_dtype pType,
37  const fg_chart_type pChartType);
38 
47 
60  const float pRed, const float pGreen,
61  const float pBlue, const float pAlpha);
62 
71 FGAPI fg_err fg_set_vector_field_legend(fg_vector_field pField, const char* pLegend);
72 
82 
91 FGAPI fg_err fg_get_vector_field_color_buffer(unsigned* pOut, const fg_vector_field pField);
92 
101 FGAPI fg_err fg_get_vector_field_alpha_buffer(unsigned* pOut, const fg_vector_field pField);
102 
112 
122 
132 
142 
152 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 
160 #ifdef __cplusplus
161 
162 namespace forge
163 {
164 
170 class VectorField {
171  private:
172  fg_vector_field mValue;
173 
174  public:
183  FGAPI VectorField(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType);
184 
190  FGAPI VectorField(const VectorField& pOther);
191 
196 
202  FGAPI void setColor(const forge::Color pColor);
203 
212  FGAPI void setColor(const float pRed, const float pGreen,
213  const float pBlue, const float pAlpha);
214 
220  FGAPI void setLegend(const char* pLegend);
221 
227  FGAPI unsigned vertices() const;
228 
234  FGAPI unsigned colors() const;
235 
241  FGAPI unsigned alphas() const;
242 
248  FGAPI unsigned directions() const;
249 
255  FGAPI unsigned verticesSize() const;
256 
262  FGAPI unsigned colorsSize() const;
263 
269  FGAPI unsigned alphasSize() const;
270 
276  FGAPI unsigned directionsSize() const;
277 
281  FGAPI fg_vector_field get() const;
282 };
283 
284 }
285 
286 #endif
VectorField is a line graph to display two dimensional data.
Definition: vector_field.h:170
FGAPI fg_err fg_get_vector_field_alpha_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for alpha values buffer.
FGAPI void setLegend(const char *pLegend)
Set VectorField legend.
FGAPI fg_err fg_set_vector_field_legend(fg_vector_field pField, const char *pLegend)
Set vector field legend.
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
Definition: chart.h:231
fg_color
Definition: defines.h:139
FGAPI VectorField(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType)
Creates a VectorField object.
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
FGAPI fg_err fg_set_vector_field_color(fg_vector_field pField, const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set the color of vector field.
FGAPI fg_err fg_get_vector_field_color_buffer_size(unsigned *pOut, const fg_vector_field pField)
Get the colors buffer size in bytes.
dtype
Definition: defines.h:189
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
FGAPI fg_err fg_get_vector_field_direction_buffer_size(unsigned *pOut, const fg_vector_field pField)
Get the directions buffer size in bytes.
fg_chart_type
Definition: defines.h:117
void * fg_vector_field
Definition: defines.h:47
#define FGAPI
Definition: defines.h:28
FGAPI fg_err fg_get_vector_field_color_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for colors buffer.
FGAPI void setColor(const forge::Color pColor)
Set global color for the field lines.
FGAPI fg_err fg_get_vector_field_direction_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for directions buffer.
FGAPI unsigned directions() const
Get the buffer identifier for field direction per vertex values.
FGAPI fg_err fg_destroy_vector_field(fg_vector_field pField)
Destroy vector field object.
FGAPI fg_err fg_get_vector_field_vertex_buffer_size(unsigned *pOut, const fg_vector_field pField)
Get the vertices buffer size in bytes.
fg_err
Definition: defines.h:49
FGAPI fg_err fg_get_vector_field_vertex_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for vertices buffer.
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
FGAPI ~VectorField()
VectorField Destructor.
FGAPI fg_err fg_create_vector_field(fg_vector_field *pField, const unsigned pNPoints, const fg_dtype pType, const fg_chart_type pChartType)
Create a Vector field object.
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
fg_dtype
Definition: defines.h:150
FGAPI unsigned directionsSize() const
Get the directions buffer size.
FGAPI fg_err fg_get_vector_field_alpha_buffer_size(unsigned *pOut, const fg_vector_field pField)
Get the alpha values buffer size in bytes.