Commit 5bb95c41 authored by ozantonkal's avatar ozantonkal

remove widget implementation

parent ecdd8513
...@@ -72,6 +72,7 @@ namespace temp_viz ...@@ -72,6 +72,7 @@ namespace temp_viz
bool wasStopped() const; bool wasStopped() const;
void showWidget(const String &id, const Widget &widget); void showWidget(const String &id, const Widget &widget);
bool removeWidget(const String &id);
private: private:
Viz3d(const Viz3d&); Viz3d(const Viz3d&);
Viz3d& operator=(const Viz3d&); Viz3d& operator=(const Viz3d&);
......
...@@ -247,6 +247,8 @@ public: ...@@ -247,6 +247,8 @@ public:
void setSize (int xw, int yw); void setSize (int xw, int yw);
void showWidget(const String &id, const Widget &widget); void showWidget(const String &id, const Widget &widget);
bool removeWidget(const String &id);
void all_data(); void all_data();
private: private:
......
...@@ -143,3 +143,8 @@ void temp_viz::Viz3d::showWidget(const String &id, const Widget &widget) ...@@ -143,3 +143,8 @@ void temp_viz::Viz3d::showWidget(const String &id, const Widget &widget)
{ {
impl_->showWidget(id, widget); impl_->showWidget(id, widget);
} }
bool temp_viz::Viz3d::removeWidget(const String &id)
{
return impl_->removeWidget(id);
}
...@@ -1183,3 +1183,21 @@ void temp_viz::Viz3d::VizImpl::showWidget(const String &id, const Widget &widget ...@@ -1183,3 +1183,21 @@ void temp_viz::Viz3d::VizImpl::showWidget(const String &id, const Widget &widget
renderer_->AddActor(WidgetAccessor::getActor(widget)); renderer_->AddActor(WidgetAccessor::getActor(widget));
(*widget_actor_map_)[id].actor = WidgetAccessor::getActor(widget); (*widget_actor_map_)[id].actor = WidgetAccessor::getActor(widget);
} }
bool temp_viz::Viz3d::VizImpl::removeWidget(const String &id)
{
WidgetActorMap::iterator wam_itr = widget_actor_map_->find(id);
bool exists = !(wam_itr == widget_actor_map_->end());
if (!exists)
{
std::cout << "[removeWidget] A widget with id <" << id << "> does not exist!" << std::endl;
return false;
}
if (!removeActorFromRenderer (wam_itr->second.actor))
return false;
widget_actor_map_->erase(wam_itr);
return true;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment