#include <WidgetFactory.h>
Inheritance diagram for WidgetFactory:
this hides the "appearance" from the behavior levels of the hierarchy, this way we can re-use widgets even if we don't have openGL or don't like the way they look.
This class should be restricted to generating only "basic" widget items like, nodes, edges, sliders, and cones. More complex, composite, widgets should take a factory in it's constructor to generate the correct "kind" of basic widgets using the gen*() functions.
This is a prototype factory, which means all widgets must implement some form of clone() function. The WidgetItem interface requires you to be able to implement
WidgetItem *clone() const
To create a custom factory is simplest to just create a new factory or use/copy an existing "const default" one, for instance here is the definition of the default GLUWidgetFactory :
const WidgetFactory GLUWidgetFactory(new GLUNodeWidget(...), new GLUEdgeWidget(...));
WidgetFactory myWF = GLUWidgetFactory; ... /// change atributes of the widget protos to suite
Definition at line 68 of file WidgetFactory.h.
NodeWidget prototypes | |
virtual NodeWidget * | genNode () const |
virtual NodeWidgetSP | getNodeProto () |
virtual const NodeWidget *const | getNodeProto () const |
virtual void | setNodeProto (NodeWidget *nw) |
EdgeWidget prototypes | |
virtual EdgeWidget * | genEdge () const |
virtual EdgeWidgetSP | getEdgeProto () |
virtual const EdgeWidget *const | getEdgeProto () const |
virtual void | setEdgeProto (EdgeWidget *ew) |
Public Member Functions | |
WidgetFactory (NodeWidget *nodeProto, EdgeWidget *edgeProto) | |
WidgetFactory (const WidgetFactory &wf) | |
virtual | ~WidgetFactory () |
WidgetFactory & | operator= (const WidgetFactory &wf) |
Protected Member Functions | |
WidgetFactory () | |
not used | |
virtual void | _incCount () |
gutz::Counted interface, increment reference count by one. | |
virtual void | _decCount () |
gutz::Counted interface, decrement reference count by one. | |
virtual int | _getCount () const |
gutz::Counted interface, get the current reference count. | |
Protected Attributes | |
NodeWidgetSP | _nodeProto |
EdgeWidgetSP | _edgeProto |
Friends | |
class | SmartPtr |
class | SmartPtrRef |
|
Definition at line 70 of file WidgetFactory.h. References _edgeProto, and _nodeProto. |
|
Definition at line 76 of file WidgetFactory.h. References _edgeProto, and _nodeProto. |
|
Definition at line 81 of file WidgetFactory.h. |
|
not used
Definition at line 115 of file WidgetFactory.h. |
|
gutz::Counted interface, decrement reference count by one. Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr Definition at line 54 of file smartptr.h. Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax(). |
|
gutz::Counted interface, get the current reference count. Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Definition at line 58 of file smartptr.h. |
|
gutz::Counted interface, increment reference count by one. Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr Definition at line 48 of file smartptr.h. Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax(). |
|
Definition at line 103 of file WidgetFactory.h. References _edgeProto. |
|
Definition at line 91 of file WidgetFactory.h. References _nodeProto. |
|
Definition at line 107 of file WidgetFactory.h. References _edgeProto, and gutz::SmartPtr< EdgeWidget >::getPtr(). |
|
Definition at line 105 of file WidgetFactory.h. References _edgeProto. Referenced by FrameWidget::FrameWidget(). |
|
Definition at line 95 of file WidgetFactory.h. References _nodeProto, and gutz::SmartPtr< NodeWidget >::getPtr(). |
|
Definition at line 93 of file WidgetFactory.h. References _nodeProto. Referenced by FrameWidget::FrameWidget(). |
|
Definition at line 83 of file WidgetFactory.h. References _edgeProto, and _nodeProto. |
|
Definition at line 109 of file WidgetFactory.h. References _edgeProto. |
|
Definition at line 97 of file WidgetFactory.h. References _nodeProto. |
|
Definition at line 40 of file smartptr.h. Referenced by Nrro::NrroIter< T >::NrroIter(). |
|
Definition at line 41 of file smartptr.h. |
|
Definition at line 118 of file WidgetFactory.h. Referenced by genEdge(), getEdgeProto(), operator=(), setEdgeProto(), and WidgetFactory(). |
|
Definition at line 117 of file WidgetFactory.h. Referenced by genNode(), getNodeProto(), operator=(), setNodeProto(), and WidgetFactory(). |