public:
Widget();
Widget(const Widget &other);
+ Widget& operator =(const Widget &other);
+
+ void copyTo(Widget &dst);
void setColor(const Color &color);
void setPose(const Affine3f &pose);
class LineWidget : public Widget
{
public:
- LineWidget(const Point3f &pt1, const Point3f &pt2, const Color &color);
+ LineWidget(const Point3f &pt1, const Point3f &pt2, const Color &color = Color(255,255,255));
};
}
return Affine3f(matrix_cv);
}
- void setActorMapperInput(const vtkSmartPointer<vtkDataSet> &data)
- {
- vtkSmartPointer<vtkDataSetMapper> mapper = reinterpret_cast<vtkDataSetMapper*>(actor->GetMapper ());
- if (mapper == 0)
- {
- mapper = vtkSmartPointer<vtkDataSetMapper>::New ();
- actor->SetMapper(mapper);
- }
- mapper->SetInput (data);
- }
-
protected:
vtkSmartPointer<vtkMatrix4x4> convertToVtkMatrix (const cv::Matx44f &m) const
impl_ = other.impl_;
}
+temp_viz::Widget& temp_viz::Widget::operator =(const Widget &other)
+{
+ if (this != &other)
+ impl_ = other.impl_;
+ return *this;
+}
+
+void temp_viz::Widget::copyTo(Widget &dst)
+{
+ // TODO Deep copy the data if there is any
+}
+
void temp_viz::Widget::setColor(const Color &color)
{
impl_->setColor(color);
temp_viz::LineWidget lw(cv::Point3f(0.0,0.0,0.0), cv::Point3f(1.0,1.0,1.0), temp_viz::Color(0,255,0));
v.showWidget("line", lw);
+ temp_viz::LineWidget lw2 = lw;
+
while(!v.wasStopped())
{
// Creating new point cloud with id cloud1
v.setShapePose("circle1", cloudPosition);
v.setShapePose("sphere1", cloudPosition);
v.setShapePose("arrow1", cloudPosition);
- lw.setColor(temp_viz::Color(col_blue, col_green, col_red));
+ lw2.setColor(temp_viz::Color(col_blue, col_green, col_red));
angle_x += 0.1f;
angle_y -= 0.1f;