Skip to content

Commit

Permalink
Add remove API for pie renderable
Browse files Browse the repository at this point in the history
  • Loading branch information
9prady9 committed Dec 24, 2019
1 parent d5424e5 commit 9b3014a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/fg/chart.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ Remove a Histogram object from the current chart
FGAPI fg_err fg_remove_histogram_from_chart(fg_chart pHandle,
fg_histogram pHistogram);

/**
Remove a Pie object from the current chart
\param[in] pHandle is chart handle
\param[in] pPie is the handle of the pie object to remove
\return \ref fg_err error code
*/
FGAPI fg_err fg_remove_pie_from_chart(fg_chart pHandle, fg_pie pPie);

/**
Remove a Plot object from the current chart
Expand Down Expand Up @@ -526,6 +536,13 @@ class Chart {
*/
FGAPI void remove(const Histogram &pHistogram);

/**
Remove an existing Pie object to the current chart
\param[in] pPie is the Pie to remove from the chart
*/
FGAPI void remove(const Pie &pPie);

/**
Remove an existing Plot object to the current chart
Expand Down
15 changes: 15 additions & 0 deletions src/api/c/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,21 @@ fg_err fg_remove_histogram_from_chart(fg_chart pChart,
return FG_ERR_NONE;
}

fg_err fg_remove_pie_from_chart(fg_chart pChart, fg_pie pPie) {
try {
ARG_ASSERT(0, (pPie != 0));
ARG_ASSERT(1, (pChart != 0));

common::Chart* chrt = getChart(pChart);

common::Pie* pie = getPie(pPie);
chrt->removeRenderable(pie->impl());
}
CATCHALL

return FG_ERR_NONE;
}

fg_err fg_remove_plot_from_chart(fg_chart pChart, fg_plot pPlot) {
try {
ARG_ASSERT(0, (pPlot != 0));
Expand Down
4 changes: 4 additions & 0 deletions src/api/cpp/chart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ void Chart::remove(const Histogram& pHistogram) {
FG_THROW(fg_remove_histogram_from_chart(get(), pHistogram.get()));
}

void Chart::remove(const Pie& pPie) {
FG_THROW(fg_remove_pie_from_chart(get(), pPie.get()));
}

void Chart::remove(const Plot& pPlot) {
FG_THROW(fg_remove_plot_from_chart(get(), pPlot.get()));
}
Expand Down

0 comments on commit 9b3014a

Please sign in to comment.