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
34 FGAPI fg_err fg_create_vector_field(fg_vector_field *pField,
35 const unsigned pNPoints,
36 const fg_dtype pType,
37 const fg_chart_type pChartType);
38
47 FGAPI fg_err fg_retain_vector_field(fg_vector_field *pOut, fg_vector_field pIn);
48
56 FGAPI fg_err fg_release_vector_field(fg_vector_field pField);
57
69 FGAPI fg_err fg_set_vector_field_color(fg_vector_field pField,
70 const float pRed, const float pGreen,
71 const float pBlue, const float pAlpha);
72
81 FGAPI fg_err fg_set_vector_field_legend(fg_vector_field pField, const char* pLegend);
82
91 FGAPI fg_err fg_get_vector_field_vertex_buffer(unsigned* pOut, const fg_vector_field pField);
92
101 FGAPI fg_err fg_get_vector_field_color_buffer(unsigned* pOut, const fg_vector_field pField);
102
111 FGAPI fg_err fg_get_vector_field_alpha_buffer(unsigned* pOut, const fg_vector_field pField);
112
121 FGAPI fg_err fg_get_vector_field_direction_buffer(unsigned* pOut, const fg_vector_field pField);
122
131 FGAPI fg_err fg_get_vector_field_vertex_buffer_size(unsigned* pOut, const fg_vector_field pField);
132
141 FGAPI fg_err fg_get_vector_field_color_buffer_size(unsigned* pOut, const fg_vector_field pField);
142
151 FGAPI fg_err fg_get_vector_field_alpha_buffer_size(unsigned* pOut, const fg_vector_field pField);
152
161 FGAPI fg_err fg_get_vector_field_direction_buffer_size(unsigned* pOut, const fg_vector_field pField);
162
165 #ifdef __cplusplus
166 }
167 #endif
168
169
170 #ifdef __cplusplus
171
172 namespace forge
173 {
174
180 class VectorField {
181 private:
182 fg_vector_field mValue;
183
184 public:
193 FGAPI VectorField(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType);
194
200 FGAPI VectorField(const VectorField& pOther);
201
210 FGAPI explicit VectorField(const fg_vector_field pHandle);
211
215 FGAPI ~VectorField();
216
222 FGAPI void setColor(const forge::Color pColor);
223
232 FGAPI void setColor(const float pRed, const float pGreen,
233 const float pBlue, const float pAlpha);
234
240 FGAPI void setLegend(const char* pLegend);
241
247 FGAPI unsigned vertices() const;
248
254 FGAPI unsigned colors() const;
255
261 FGAPI unsigned alphas() const;
262
268 FGAPI unsigned directions() const;
269
275 FGAPI unsigned verticesSize() const;
276
282 FGAPI unsigned colorsSize() const;
283
289 FGAPI unsigned alphasSize() const;
290
296 FGAPI unsigned directionsSize() const;
297
301 FGAPI fg_vector_field get() const;
302 };
303
304 }
305
306 #endif
fg_retain_vector_field
FGAPI fg_err fg_retain_vector_field(fg_vector_field *pOut, fg_vector_field pIn)
Increase reference count of the resource.
forge::VectorField
VectorField is a line graph to display two dimensional data.
Definition: vector_field.h:180
fg_get_vector_field_alpha_buffer
FGAPI fg_err fg_get_vector_field_alpha_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for alpha values buffer.
forge::VectorField::setLegend
FGAPI void setLegend(const char *pLegend)
Set VectorField legend.
fg_set_vector_field_legend
FGAPI fg_err fg_set_vector_field_legend(fg_vector_field pField, const char *pLegend)
Set vector field legend.
forge::VectorField::vertices
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
forge
Definition: chart.h:304
fg_color
fg_color
Definition: defines.h:139
forge::VectorField::VectorField
FGAPI VectorField(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType)
Creates a VectorField object.
forge::VectorField::colorsSize
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
forge::VectorField::alphasSize
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
fg_set_vector_field_color
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.
fg_get_vector_field_color_buffer_size
FGAPI fg_err fg_get_vector_field_color_buffer_size(unsigned *pOut, const fg_vector_field pField)
Get the colors buffer size in bytes.
forge::dtype
dtype
Definition: defines.h:188
forge::VectorField::alphas
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
fg_get_vector_field_direction_buffer_size
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
fg_chart_type
Definition: defines.h:117
fg_release_vector_field
FGAPI fg_err fg_release_vector_field(fg_vector_field pField)
Destroy vector field object.
fg_vector_field
void * fg_vector_field
Definition: defines.h:47
FGAPI
#define FGAPI
Definition: defines.h:28
fg_get_vector_field_color_buffer
FGAPI fg_err fg_get_vector_field_color_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for colors buffer.
defines.h
forge::VectorField::setColor
FGAPI void setColor(const forge::Color pColor)
Set global color for the field lines.
fg_get_vector_field_direction_buffer
FGAPI fg_err fg_get_vector_field_direction_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for directions buffer.
forge::VectorField::directions
FGAPI unsigned directions() const
Get the buffer identifier for field direction per vertex values.
fg_get_vector_field_vertex_buffer_size
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
fg_err
Definition: defines.h:49
fg_get_vector_field_vertex_buffer
FGAPI fg_err fg_get_vector_field_vertex_buffer(unsigned *pOut, const fg_vector_field pField)
Get the resource identifier for vertices buffer.
forge::VectorField::colors
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
forge::VectorField::~VectorField
FGAPI ~VectorField()
VectorField Destructor.
fg_create_vector_field
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.
forge::VectorField::verticesSize
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
fg_dtype
fg_dtype
Definition: defines.h:150
forge::VectorField::directionsSize
FGAPI unsigned directionsSize() const
Get the directions buffer size.
fg_get_vector_field_alpha_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.