vector_field.h
Go to the documentation of this file.
/*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
#include <fg/defines.h>
#ifdef __cplusplus
extern "C" {
#endif
FGAPI fg_err fg_create_vector_field(fg_vector_field *pField,
const unsigned pNPoints,
const fg_dtype pType,
const fg_chart_type pChartType);
FGAPI fg_err fg_retain_vector_field(fg_vector_field *pOut, fg_vector_field pIn);
FGAPI fg_err fg_release_vector_field(fg_vector_field pField);
FGAPI fg_err fg_set_vector_field_color(fg_vector_field pField,
const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI fg_err fg_set_vector_field_legend(fg_vector_field pField, const char* pLegend);
FGAPI fg_err fg_get_vector_field_vertex_buffer(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_color_buffer(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_alpha_buffer(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_direction_buffer(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_vertex_buffer_size(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_color_buffer_size(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_alpha_buffer_size(unsigned* pOut, const fg_vector_field pField);
FGAPI fg_err fg_get_vector_field_direction_buffer_size(unsigned* pOut, const fg_vector_field pField);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
namespace forge
{
class VectorField {
private:
fg_vector_field mValue;
public:
FGAPI VectorField(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType);
FGAPI VectorField(const VectorField& pOther);
FGAPI explicit VectorField(const fg_vector_field pHandle);
FGAPI ~VectorField();
FGAPI void setColor(const forge::Color pColor);
FGAPI void setColor(const float pRed, const float pGreen,
const float pBlue, const float pAlpha);
FGAPI void setLegend(const char* pLegend);
FGAPI unsigned vertices() const;
FGAPI unsigned colors() const;
FGAPI unsigned alphas() const;
FGAPI unsigned directions() const;
FGAPI unsigned verticesSize() const;
FGAPI unsigned colorsSize() const;
FGAPI unsigned alphasSize() const;
FGAPI unsigned directionsSize() const;
FGAPI fg_vector_field get() const;
};
}
#endif
forge::VectorField::vertices
FGAPI unsigned vertices() const
Get the buffer identifier for vertices.
forge::VectorField::directions
FGAPI unsigned directions() const
Get the buffer identifier for field direction per vertex values.
forge::VectorField::setColor
FGAPI void setColor(const float pRed, const float pGreen, const float pBlue, const float pAlpha)
Set global color for the field lines.
forge::VectorField::VectorField
FGAPI VectorField(const VectorField &pOther)
Copy constructor for VectorField.
forge::VectorField::VectorField
FGAPI VectorField(const fg_vector_field pHandle)
Construct VectorField ojbect from fg_vector_field resource handle.
forge::VectorField::verticesSize
FGAPI unsigned verticesSize() const
Get the vertex buffer size in bytes.
forge::VectorField::setLegend
FGAPI void setLegend(const char *pLegend)
Set VectorField legend.
forge::VectorField::setColor
FGAPI void setColor(const forge::Color pColor)
Set global color for the field lines.
forge::VectorField::get
FGAPI fg_vector_field get() const
Get the handle to internal implementation of VectorField.
forge::VectorField::directionsSize
FGAPI unsigned directionsSize() const
Get the directions buffer size.
forge::VectorField::alphasSize
FGAPI unsigned alphasSize() const
Get the alpha values buffer size in bytes.
forge::VectorField::colorsSize
FGAPI unsigned colorsSize() const
Get the colors buffer size in bytes.
forge::VectorField::~VectorField
FGAPI ~VectorField()
VectorField Destructor.
forge::VectorField::alphas
FGAPI unsigned alphas() const
Get the buffer identifier for alpha values per vertex.
forge::VectorField::colors
FGAPI unsigned colors() const
Get the buffer identifier for color values per vertex.
forge::VectorField::VectorField
FGAPI VectorField(const unsigned pNumPoints, const dtype pDataType, const ChartType pChartType)
Creates a VectorField object.
defines.h
FGAPI
#define FGAPI
Definition defines.h:28
fg_err
fg_err
Definition defines.h:49
fg_dtype
fg_dtype
Definition defines.h:150
fg_vector_field
void * fg_vector_field
Definition defines.h:47
fg_chart_type
fg_chart_type
Definition defines.h:117
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.
fg_release_vector_field
FGAPI fg_err fg_release_vector_field(fg_vector_field pField)
Destroy vector field object.
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.
fg_set_vector_field_legend
FGAPI fg_err fg_set_vector_field_legend(fg_vector_field pField, const char *pLegend)
Set vector field legend.
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.
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_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_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.
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.
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.
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.
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_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
Definition chart.h:305
forge::Color
fg_color Color
Definition defines.h:184
forge::ChartType
fg_chart_type ChartType
Definition defines.h:182
forge::dtype
dtype
Definition defines.h:188