@@ -71,20 +71,53 @@ namespace SCIRun
7171 std::vector<WidgetHandle> widgets_;
7272 };
7373
74- class SCISHARE WidgetFactory
74+ class SCISHARE LinkedCompositeWidget : public WidgetBase
7575 {
7676 public:
77- static WidgetHandle createBox (const Core::GeometryIDGenerator& idGenerator, double scale,
78- const BoxPosition& pos, const Core::Geometry::BBox& bbox);
79- static WidgetHandle createSphere (const Core::GeometryIDGenerator& idGenerator,
80- const std::string& name,
81- double radius, const std::string& defaultColor,
82- const Core::Geometry::Point& point, const Core::Geometry::BBox& bbox);
8377 template <typename WidgetIter>
78+ LinkedCompositeWidget (const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end)
79+ : WidgetBase(idGenerator, tag, true ), widgets_(begin, end)
80+ {}
81+ ~LinkedCompositeWidget ();
82+ void addToList (Core::Datatypes::GeometryBaseHandle handle, Core::Datatypes::GeomList& list) override ;
83+ private:
84+ std::vector<WidgetHandle> widgets_;
85+ };
86+
87+ class SCISHARE WidgetFactory
88+ {
89+ public:
90+ static WidgetHandle createBox (const Core::GeometryIDGenerator& idGenerator, double scale,
91+ const BoxPosition& pos, const Core::Geometry::BBox& bbox);
92+ static WidgetHandle createSphere (const Core::GeometryIDGenerator& idGenerator,
93+ const std::string& name,
94+ double radius, const std::string& defaultColor,
95+ const Core::Geometry::Point& point, const Core::Geometry::BBox& bbox);
96+ static WidgetHandle createCylinder (const Core::GeometryIDGenerator& idGenerator,
97+ const std::string& name,
98+ double scale,
99+ const std::string& defaultColor,
100+ const Core::Geometry::Point& p1,
101+ const Core::Geometry::Point& p2,
102+ const Core::Geometry::BBox& bbox);
103+ static WidgetHandle createCone (const Core::GeometryIDGenerator& idGenerator,
104+ const std::string& name,
105+ double scale,
106+ const std::string& defaultColor,
107+ const Core::Geometry::Point& p1,
108+ const Core::Geometry::Point& p2,
109+ const Core::Geometry::BBox& bbox);
110+ template <typename WidgetIter>
84111 static WidgetHandle createComposite (const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end)
85112 {
86113 return boost::make_shared<CompositeWidget>(idGenerator, tag, begin, end);
87114 }
115+
116+ template <typename WidgetIter>
117+ static WidgetHandle createLinkedComposite (const Core::GeometryIDGenerator& idGenerator, const std::string& tag, WidgetIter begin, WidgetIter end)
118+ {
119+ return boost::make_shared<LinkedCompositeWidget>(idGenerator, tag, begin, end);
120+ }
88121 };
89122 }
90123 }
0 commit comments