Skip to content

Commit

Permalink
Rename enums
Browse files Browse the repository at this point in the history
  • Loading branch information
9prady9 committed Mar 25, 2016
1 parent 67fa20c commit e912de2
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 158 deletions.
6 changes: 3 additions & 3 deletions examples/cpu/bubblechart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ int main(void)
fg::Window wnd(DIMX, DIMY, "Bubble chart with Transparency Demo");
wnd.makeCurrent();

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
chart.setAxesLimits(FRANGE_START, FRANGE_END, -1.1f, 1.1f);

/* Create several plot objects which creates the necessary
* vertex buffer objects to hold the different plot types
*/
fg::Plot plt1 = chart.plot(cosData.size()/2, f32,
FG_LINE, FG_TRIANGLE); //or specify a specific plot type
FG_PLOT_LINE, FG_MARKER_TRIANGLE); //or specify a specific plot type
fg::Plot plt2 = chart.plot(tanData.size()/2, f32,
FG_LINE, FG_CIRCLE); //last parameter specifies marker shape
FG_PLOT_LINE, FG_MARKER_CIRCLE); //last parameter specifies marker shape

/* Set plot colors */
plt1.setColor(FG_RED);
Expand Down
2 changes: 1 addition & 1 deletion examples/cpu/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(void)

fg::Image img(IMGW, IMGH, FG_RGBA, u8);

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
/* set x axis limits to maximum and minimum values of data
* and y axis limits to range [0, number of pixels ideally]
* but practically total number of pixels as y range will skew
Expand Down
2 changes: 1 addition & 1 deletion examples/cpu/plot3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main(void)
fg::Window wnd(DIMX, DIMY, "Plot3d Demo");
wnd.makeCurrent();

fg::Chart chart(FG_3D);
fg::Chart chart(FG_CHART_3D);
chart.setAxesLimits(-1.1f, 1.1f, -1.1f, 1.1f, 0.f, 10.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");

Expand Down
8 changes: 4 additions & 4 deletions examples/cpu/plotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ int main(void)
fg::Window wnd(DIMX, DIMY, "Plotting Demo");
wnd.makeCurrent();

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
chart.setAxesLimits(FRANGE_START, FRANGE_END, -1.1f, 1.1f);

/* Create several plot objects which creates the necessary
* vertex buffer objects to hold the different plot types
*/
fg::Plot plt0 = chart.plot(sinData.size()/2, f32); //create a default plot
fg::Plot plt1 = chart.plot(cosData.size()/2, f32, FG_LINE, FG_NONE); //or specify a specific plot type
fg::Plot plt2 = chart.plot(tanData.size()/2, f32, FG_LINE, FG_TRIANGLE); //last parameter specifies marker shape
fg::Plot plt3 = chart.plot(logData.size()/2, f32, FG_SCATTER, FG_CROSS);
fg::Plot plt1 = chart.plot(cosData.size()/2, f32, FG_PLOT_LINE, FG_MARKER_NONE); //or specify a specific plot type
fg::Plot plt2 = chart.plot(tanData.size()/2, f32, FG_PLOT_LINE, FG_MARKER_TRIANGLE); //last parameter specifies marker shape
fg::Plot plt3 = chart.plot(logData.size()/2, f32, FG_PLOT_SCATTER, FG_MARKER_CROSS);

/*
* Set plot colors
Expand Down
2 changes: 1 addition & 1 deletion examples/cpu/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main(void)
fg::Window wnd(1024, 768, "3d Surface Demo");
wnd.makeCurrent();

fg::Chart chart(FG_3D);
fg::Chart chart(FG_CHART_3D);
chart.setAxesLimits(-10.f, 10.f, -10.f, 10.f, -0.5f, 1.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");

Expand Down
2 changes: 1 addition & 1 deletion examples/cuda/histogram.cu
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main(void)

fg::Image img(IMGW, IMGH, FG_RGBA, u8);

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
/* set x axis limits to maximum and minimum values of data
* and y axis limits to range [0, number of pixels ideally]
* but practically total number of pixels as y range will skew
Expand Down
2 changes: 1 addition & 1 deletion examples/cuda/plot3.cu
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main(void)
fg::Window wnd(DIMX, DIMY, "Plot 3d Demo");
wnd.makeCurrent();

fg::Chart chart(FG_3D);
fg::Chart chart(FG_CHART_3D);
chart.setAxesLimits(-1.1f, 1.1f, -1.1f, 1.1f, 0.f, 10.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");

Expand Down
8 changes: 4 additions & 4 deletions examples/cuda/plotting.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ int main(void)
wnd.makeCurrent();
wnd.grid(1,2);

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
chart.setAxesLimits(FRANGE_START, FRANGE_END, -1.1f, 1.1f);

/* Create several plot objects which creates the necessary
* vertex buffer objects to hold the different plot types
*/
fg::Plot plt0 = chart.plot( DATA_SIZE, f32); //create a default plot
fg::Plot plt1 = chart.plot( DATA_SIZE, f32, FG_LINE, FG_NONE); //or specify a specific plot type
fg::Plot plt2 = chart.plot( DATA_SIZE, f32, FG_LINE, FG_TRIANGLE); //last parameter specifies marker shape
fg::Plot plt3 = chart.plot( DATA_SIZE, f32, FG_SCATTER, FG_CROSS);
fg::Plot plt1 = chart.plot( DATA_SIZE, f32, FG_PLOT_LINE, FG_MARKER_NONE); //or specify a specific plot type
fg::Plot plt2 = chart.plot( DATA_SIZE, f32, FG_PLOT_LINE, FG_MARKER_TRIANGLE); //last parameter specifies marker shape
fg::Plot plt3 = chart.plot( DATA_SIZE, f32, FG_PLOT_SCATTER, FG_MARKER_CROSS);

/*
* Set plot colors
Expand Down
2 changes: 1 addition & 1 deletion examples/cuda/surface.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(void)
fg::Window wnd(1024, 768, "3d Surface Demo");
wnd.makeCurrent();

fg::Chart chart(FG_3D);
fg::Chart chart(FG_CHART_3D);
chart.setAxesLimits(-10.f, 10.f, -10.f, 10.f, -0.5f, 1.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");

Expand Down
2 changes: 1 addition & 1 deletion examples/opencl/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ int main(void)

fg::Image img(IMGW, IMGH, FG_RGBA, u8);

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
/* set x axis limits to maximum and minimum values of data
* and y axis limits to range [0, number of pixels ideally]
* but practically total number of pixels as y range will skew
Expand Down
2 changes: 1 addition & 1 deletion examples/opencl/plot3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int main(void)
fg::Window wnd(DIMX, DIMY, "Plot3d Demo");
wnd.makeCurrent();

fg::Chart chart(FG_3D);
fg::Chart chart(FG_CHART_3D);
chart.setAxesLimits(-1.1f, 1.1f, -1.1f, 1.1f, 0.f, 10.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");

Expand Down
8 changes: 4 additions & 4 deletions examples/opencl/plotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ int main(void)
fg::Window wnd(DIMX, DIMY, "Plotting Demo");
wnd.makeCurrent();

fg::Chart chart(FG_2D);
fg::Chart chart(FG_CHART_2D);
chart.setAxesLimits(FRANGE_START, FRANGE_END, -1.1f, 1.1f);

/* Create several plot objects which creates the necessary
* vertex buffer objects to hold the different plot types
*/
fg::Plot plt0 = chart.plot(DATA_SIZE, f32); //create a default plot
fg::Plot plt1 = chart.plot(DATA_SIZE, f32, FG_LINE, FG_NONE); //or specify a specific plot type
fg::Plot plt2 = chart.plot(DATA_SIZE, f32, FG_LINE, FG_TRIANGLE); //last parameter specifies marker shape
fg::Plot plt3 = chart.plot(DATA_SIZE, f32, FG_SCATTER, FG_CROSS);
fg::Plot plt1 = chart.plot(DATA_SIZE, f32, FG_PLOT_LINE, FG_MARKER_NONE); //or specify a specific plot type
fg::Plot plt2 = chart.plot(DATA_SIZE, f32, FG_PLOT_LINE, FG_MARKER_TRIANGLE); //last parameter specifies marker shape
fg::Plot plt3 = chart.plot(DATA_SIZE, f32, FG_PLOT_SCATTER, FG_MARKER_CROSS);

/*
* Set plot colors
Expand Down
2 changes: 1 addition & 1 deletion examples/opencl/surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int main(void)
fg::Window wnd(1024, 768, "3d Surface Demo");
wnd.makeCurrent();

fg::Chart chart(FG_3D);
fg::Chart chart(FG_CHART_3D);
chart.setAxesLimits(-10.f, 10.f, -10.f, 10.f, -0.5f, 1.f);
chart.setAxesTitles("x-axis", "y-axis", "z-axis");

Expand Down
4 changes: 2 additions & 2 deletions include/fg/chart.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class Chart {
the values of \ref MarkerType.
*/
FGAPI Plot plot(const uint pNumPoints, const dtype pDataType,
const PlotType pPlotType=FG_LINE, const MarkerType pMarkerType=FG_NONE);
const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE);

/**
Create and add an Plot object to the current chart
Expand All @@ -211,7 +211,7 @@ class Chart {
\param[in] pMarkerType is the type of \ref MarkerType to draw for \ref FG_SCATTER plot type
*/
FGAPI Surface surface(const uint pNumXPoints, const uint pNumYPoints, const dtype pDataType,
const PlotType pPlotType=FG_SURFACE, const MarkerType pMarkerType=FG_NONE);
const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE);

/**
Render the chart to given window
Expand Down
42 changes: 21 additions & 21 deletions include/fg/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef unsigned short ushort;
typedef unsigned char uchar;

typedef enum {
FG_SUCCESS = 0, ///< Fuction returned successfully.
FG_ERR_NONE = 0, ///< Fuction returned successfully.
/*
* Arguement related error codes that are
* generated when invalid arguments are
Expand Down Expand Up @@ -128,8 +128,8 @@ typedef enum {
} fg_channel_format;

typedef enum {
FG_2D = 2, ///< Two dimensional charts
FG_3D = 3 ///< Three dimensional charts
FG_CHART_2D = 2, ///< Two dimensional charts
FG_CHART_3D = 3 ///< Three dimensional charts
} fg_chart_type;

/**
Expand All @@ -138,13 +138,13 @@ typedef enum {
\image html gfx_palette.png
*/
typedef enum {
FG_DEFAULT_MAP = 0, ///< Default [0-255] grayscale colormap
FG_SPECTRUM_MAP = 1, ///< Spectrum color
FG_COLORS_MAP = 2, ///< Pure Colors
FG_RED_MAP = 3, ///< Red color map
FG_MOOD_MAP = 4, ///< Mood color map
FG_HEAT_MAP = 5, ///< Heat color map
FG_BLUE_MAP = 6 ///< Blue color map
FG_COLOR_MAP_DEFAULT = 0, ///< Default [0-255] grayscale colormap
FG_COLOR_MAP_SPECTRUM = 1, ///< Spectrum color
FG_COLOR_MAP_COLORS = 2, ///< Pure Colors
FG_COLOR_MAP_RED = 3, ///< Red color map
FG_COLOR_MAP_MOOD = 4, ///< Mood color map
FG_COLOR_MAP_HEAT = 5, ///< Heat color map
FG_COLOR_MAP_BLUE = 6 ///< Blue color map
} fg_color_map;

typedef enum {
Expand All @@ -169,20 +169,20 @@ typedef enum {
} fg_dtype;

typedef enum {
FG_LINE = 0, ///< Line plot
FG_SCATTER = 1, ///< Scatter plot
FG_SURFACE = 2 ///< Surface plot
FG_PLOT_LINE = 0, ///< Line plot
FG_PLOT_SCATTER = 1, ///< Scatter plot
FG_PLOT_SURFACE = 2 ///< Surface plot
} fg_plot_type;

typedef enum {
FG_NONE = 0, ///< No marker
FG_POINT = 1, ///< Point marker
FG_CIRCLE = 2, ///< Circle marker
FG_SQUARE = 3, ///< Square marker
FG_TRIANGLE = 4, ///< Triangle marker
FG_CROSS = 5, ///< Cross-hair marker
FG_PLUS = 6, ///< Plus symbol marker
FG_STAR = 7 ///< Star symbol marker
FG_MARKER_NONE = 0, ///< No marker
FG_MARKER_POINT = 1, ///< Point marker
FG_MARKER_CIRCLE = 2, ///< Circle marker
FG_MARKER_SQUARE = 3, ///< Square marker
FG_MARKER_TRIANGLE = 4, ///< Triangle marker
FG_MARKER_CROSS = 5, ///< Cross-hair marker
FG_MARKER_PLUS = 6, ///< Plus symbol marker
FG_MARKER_STAR = 7 ///< Star symbol marker
} fg_marker_type;


Expand Down
2 changes: 1 addition & 1 deletion include/fg/plot.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Plot {
the values of \ref MarkerType.
*/
FGAPI Plot(const uint pNumPoints, const dtype pDataType, const ChartType pChartType,
const PlotType pPlotType=FG_LINE, const MarkerType pMarkerType=FG_NONE);
const PlotType pPlotType=FG_PLOT_LINE, const MarkerType pMarkerType=FG_MARKER_NONE);

/**
Copy constructor for Plot
Expand Down
2 changes: 1 addition & 1 deletion include/fg/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Surface {
\param[in] pMarkerType is the type of \ref MarkerType to draw for \ref FG_SCATTER plot type
*/
FGAPI Surface(const uint pNumXPoints, const uint pNumYPoints, const dtype pDataType,
const PlotType pPlotType=FG_SURFACE, const MarkerType pMarkerType=FG_NONE);
const PlotType pPlotType=FG_PLOT_SURFACE, const MarkerType pMarkerType=FG_MARKER_NONE);

/**
Copy constructor for Plot
Expand Down
30 changes: 15 additions & 15 deletions src/api/c/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fg_err fg_create_chart(fg_chart *pHandle,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_destroy_chart(fg_chart pHandle)
Expand All @@ -41,7 +41,7 @@ fg_err fg_destroy_chart(fg_chart pHandle)
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_set_chart_axes_titles(fg_chart pHandle,
Expand All @@ -54,7 +54,7 @@ fg_err fg_set_chart_axes_titles(fg_chart pHandle,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_set_chart_axes_limits(fg_chart pHandle,
Expand All @@ -67,7 +67,7 @@ fg_err fg_set_chart_axes_limits(fg_chart pHandle,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_set_chart_legend_position(fg_chart pHandle, const float pX, const float pY)
Expand All @@ -77,7 +77,7 @@ fg_err fg_set_chart_legend_position(fg_chart pHandle, const float pX, const floa
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_add_image_to_chart(fg_image* pImage, fg_chart pHandle,
Expand All @@ -92,7 +92,7 @@ fg_err fg_add_image_to_chart(fg_image* pImage, fg_chart pHandle,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_add_histogram_to_chart(fg_histogram* pHistogram, fg_chart pHandle,
Expand All @@ -101,7 +101,7 @@ fg_err fg_add_histogram_to_chart(fg_histogram* pHistogram, fg_chart pHandle,
try {
common::Chart* chrt = getChart(pHandle);

if (chrt->chartType()== FG_2D) {
if (chrt->chartType()== FG_CHART_2D) {
common::Histogram* hist = new common::Histogram(pNBins, pType);
chrt->addRenderable(hist->impl());
*pHistogram = getHandle(hist);
Expand All @@ -112,7 +112,7 @@ fg_err fg_add_histogram_to_chart(fg_histogram* pHistogram, fg_chart pHandle,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_add_plot_to_chart(fg_plot* pPlot, fg_chart pHandle,
Expand All @@ -123,19 +123,19 @@ fg_err fg_add_plot_to_chart(fg_plot* pPlot, fg_chart pHandle,
common::Chart* chrt = getChart(pHandle);
fg::ChartType ctype = chrt->chartType();

if (ctype == FG_2D) {
common::Plot* plt = new common::Plot(pNPoints, pType, pPlotType, pMarkerType, FG_2D);
if (ctype == FG_CHART_2D) {
common::Plot* plt = new common::Plot(pNPoints, pType, pPlotType, pMarkerType, FG_CHART_2D);
chrt->addRenderable(plt->impl());
*pPlot = getHandle(plt);
} else {
common::Plot* plt = new common::Plot(pNPoints, pType, pPlotType, pMarkerType, FG_3D);
common::Plot* plt = new common::Plot(pNPoints, pType, pPlotType, pMarkerType, FG_CHART_3D);
chrt->addRenderable(plt->impl());
*pPlot = getHandle(plt);
}
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_add_surface_to_chart(fg_surface* pSurface, fg_chart pHandle,
Expand All @@ -146,7 +146,7 @@ fg_err fg_add_surface_to_chart(fg_surface* pSurface, fg_chart pHandle,
common::Chart* chrt = getChart(pHandle);
fg::ChartType ctype = chrt->chartType();

if (ctype == FG_3D) {
if (ctype == FG_CHART_3D) {
common::Surface* surf = new common::Surface(pXPoints, pYPoints, pType,
pPlotType, pMarkerType);
chrt->addRenderable(surf->impl());
Expand All @@ -158,7 +158,7 @@ fg_err fg_add_surface_to_chart(fg_surface* pSurface, fg_chart pHandle,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}

fg_err fg_render_chart(const fg_window pWindow, const fg_chart pChart,
Expand All @@ -172,5 +172,5 @@ fg_err fg_render_chart(const fg_window pWindow, const fg_chart pChart,
}
CATCHALL

return FG_SUCCESS;
return FG_ERR_NONE;
}
Loading

0 comments on commit e912de2

Please sign in to comment.