Version: 8.3.0
YACS::HMI::RootSceneItem Class Reference

#include <SceneItem.hxx>

Inheritance diagram for YACS::HMI::RootSceneItem:
Collaboration diagram for YACS::HMI::RootSceneItem:

Public Member Functions

 RootSceneItem (YACS::HMI::Subject *context)
 
virtual ~RootSceneItem ()
 
virtual void update (GuiEvent event, int type, Subject *son)
 
- Public Member Functions inherited from YACS::HMI::GuiObserver
 GuiObserver ()
 
virtual ~GuiObserver ()
 
virtual void select (bool isSelected)
 
virtual void incrementSubjects (Subject *subject)
 
virtual void decrementSubjects (Subject *subject)
 
int getNbSubjects ()
 
bool isDestructible ()
 

Protected Member Functions

void setNewRoot (YACS::HMI::Subject *root)
 

Protected Attributes

Subject_context
 
Subject_root
 
- Protected Attributes inherited from YACS::HMI::GuiObserver
std::set< Subject * > _subjectSet
 
bool _destructible
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::HMI::GuiObserver
static std::string eventName (GuiEvent event)
 
static void setEventMap ()
 
- Static Protected Attributes inherited from YACS::HMI::GuiObserver
static std::map< int, std::string > _eventNameMap
 

Detailed Description

Definition at line 45 of file SceneItem.hxx.

Constructor & Destructor Documentation

RootSceneItem::RootSceneItem ( YACS::HMI::Subject context)

Definition at line 48 of file SceneItem.cxx.

References YACS::HMI::Subject::attach().

49 {
50  _context=context;
51  _context->attach(this);
52 }
RootSceneItem::~RootSceneItem ( )
virtual

Definition at line 54 of file SceneItem.cxx.

55 {
56 }

Member Function Documentation

void RootSceneItem::setNewRoot ( YACS::HMI::Subject root)
protected

Definition at line 75 of file SceneItem.cxx.

References YACS::HMI::SceneNodeItem::addHeader(), DEBTRACE, and YACS::HMI::Subject::getName().

76 {
77  DEBTRACE("RootSceneItem::setNewRoot");
78  _root = root;
79  QString name = _root->getName().c_str();
81  SceneProcItem *procItem = new SceneProcItem(scene, 0, name, root);
82  scene->addItem(procItem);
83  procItem->addHeader();
84 }
void RootSceneItem::update ( GuiEvent  event,
int  type,
Subject son 
)
virtual

Reimplemented from YACS::HMI::GuiObserver.

Definition at line 58 of file SceneItem.cxx.

References DEBTRACE, YACS::HMI::ENDLOAD, and YACS::HMI::NEWROOT.

Referenced by gui.graph.MyCanvas::customEvent().

59 {
60  DEBTRACE("RootSceneItem::update "<<eventName(event)<<" "<<type<<" "<<son);
61  GuiEditor *guiEditor = 0;
62  switch (event)
63  {
64  case YACS::HMI::NEWROOT:
65  setNewRoot(son);
66  break;
67  case YACS::HMI::ENDLOAD:
70  //guiEditor->rebuildLinks();
71  break;
72  }
73 }

Member Data Documentation

Subject* YACS::HMI::RootSceneItem::_context
protected

Definition at line 53 of file SceneItem.hxx.

Subject* YACS::HMI::RootSceneItem::_root
protected

Definition at line 54 of file SceneItem.hxx.


The documentation for this class was generated from the following files: