@@ -27,10 +27,8 @@ WidgetHandle WidgetFactory::createBox(const Core::GeometryIDGenerator& idGenerat
2727 const Point& origin,
2828 const BBox& bbox)
2929{
30- WidgetHandle widget = boost::make_shared<BoundingBoxWidget>(idGenerator, scale, pos, origin, bbox);
31- std::vector<std::string> ids = std::vector<std::string>(1 );
32- ids.push_back (widget->uniqueID ());
33- widget->connectedIds_ = ids;
30+ auto widget = boost::make_shared<BoundingBoxWidget>(idGenerator, scale, pos, origin, bbox);
31+ widget->addInitialId ();
3432 widget->setToTranslate ();
3533 return widget;
3634}
@@ -44,10 +42,8 @@ WidgetHandle WidgetFactory::createSphere(const Core::GeometryIDGenerator& idGene
4442 const BBox& bbox,
4543 int resolution)
4644{
47- WidgetHandle widget = boost::make_shared<SphereWidget>(idGenerator, name, radius, defaultColor, point, origin, bbox, resolution);
48- std::vector<std::string> ids = std::vector<std::string>(1 );
49- ids.push_back (widget->uniqueID ());
50- widget->connectedIds_ = ids;
45+ auto widget = boost::make_shared<SphereWidget>(idGenerator, name, radius, defaultColor, point, origin, bbox, resolution);
46+ widget->addInitialId ();
5147 widget->setToTranslate ();
5248 return widget;
5349}
@@ -62,10 +58,8 @@ WidgetHandle WidgetFactory::createCylinder(const Core::GeometryIDGenerator& idGe
6258 const BBox& bbox,
6359 int resolution)
6460{
65- WidgetHandle widget = boost::make_shared<CylinderWidget>(idGenerator, name, radius, defaultColor, p1, p2, origin, bbox, resolution);
66- std::vector<std::string> ids = std::vector<std::string>(1 );
67- ids.push_back (widget->uniqueID ());
68- widget->connectedIds_ = ids;
61+ auto widget = boost::make_shared<CylinderWidget>(idGenerator, name, radius, defaultColor, p1, p2, origin, bbox, resolution);
62+ widget->addInitialId ();
6963 widget->setToTranslate ();
7064 return widget;
7165}
@@ -81,10 +75,8 @@ WidgetHandle WidgetFactory::createCone(const Core::GeometryIDGenerator& idGenera
8175 bool renderBase,
8276 int resolution)
8377{
84- WidgetHandle widget = boost::make_shared<ConeWidget>(idGenerator, name, radius, defaultColor, p1, p2, origin, bbox, renderBase, resolution);
85- std::vector<std::string> ids = std::vector<std::string>(1 );
86- ids.push_back (widget->uniqueID ());
87- widget->connectedIds_ = ids;
78+ auto widget = boost::make_shared<ConeWidget>(idGenerator, name, radius, defaultColor, p1, p2, origin, bbox, renderBase, resolution);
79+ widget->addInitialId ();
8880 widget->setToTranslate ();
8981 return widget;
9082}
@@ -99,10 +91,8 @@ WidgetHandle WidgetFactory::createDisk(const Core::GeometryIDGenerator& idGenera
9991 const BBox& bbox,
10092 int resolution)
10193{
102- WidgetHandle widget = boost::make_shared<DiskWidget>(idGenerator, name, radius, defaultColor, p1, p2, origin, bbox, resolution);
103- std::vector<std::string> ids = std::vector<std::string>(1 );
104- ids.push_back (widget->uniqueID ());
105- widget->connectedIds_ = ids;
94+ auto widget = boost::make_shared<DiskWidget>(idGenerator, name, radius, defaultColor, p1, p2, origin, bbox, resolution);
95+ widget->addInitialId ();
10696 widget->setToTranslate ();
10797 return widget;
10898}
0 commit comments