Structural deformable models
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SensorDialog Class Reference

#include <sensordlg.h>

Inheritance diagram for SensorDialog:
Inheritance graph
[legend]
Collaboration diagram for SensorDialog:
Collaboration graph
[legend]

Public Types

enum  { ID_CANVAS = FXDialogBox::ID_LAST, ID_SENSEDIT, ID_SENSSEL, ID_LAST }
 

Public Member Functions

 SensorDialog (FXApp *a, ImageWindow *iw, SensorCollection &sc)
 
virtual ~SensorDialog ()
 
long onEdit (FXObject *, FXSelector, void *ptr)
 
void updateStrings ()
 
int getSelectedSensor () const
 
void setGeomMutex (vuMutex *mutex)
 

Protected Member Functions

 SensorDialog ()
 

Protected Attributes

SensorCollectionm_Sensors
 
FXListBox * m_SList
 
ImageWindowm_ImgWin
 
std::vector< int > m_SIndices
 
vuMutexm_PGeomMutex
 

Detailed Description

Definition at line 13 of file sensordlg.h.

Member Enumeration Documentation

anonymous enum
Enumerator
ID_CANVAS 
ID_SENSEDIT 
ID_SENSSEL 
ID_LAST 

Definition at line 26 of file sensordlg.h.

Constructor & Destructor Documentation

SensorDialog::SensorDialog ( FXApp *  a,
ImageWindow iw,
SensorCollection sc 
)
SensorDialog::~SensorDialog ( )
virtual

Definition at line 37 of file sensordlg.cpp.

References NULL.

38 {
39  if(m_SList) { delete m_SList; m_SList = NULL; }
40 }
#define NULL
Definition: simpletypes.h:9
FXListBox * m_SList
Definition: sensordlg.h:33
SensorDialog::SensorDialog ( )
inlineprotected

Definition at line 29 of file sensordlg.h.

References m_Sensors.

#define NULL
Definition: simpletypes.h:9
SensorCollection & m_Sensors
Definition: sensordlg.h:29

Member Function Documentation

int SensorDialog::getSelectedSensor ( ) const

Definition at line 96 of file sensordlg.cpp.

96  {
97  return shown() ? m_SIndices[m_SList->getCurrentItem()] : -1;
98 }
FXListBox * m_SList
Definition: sensordlg.h:33
std::vector< int > m_SIndices
Definition: sensordlg.h:35
long SensorDialog::onEdit ( FXObject *  ,
FXSelector  sel,
void *  ptr 
)

Definition at line 42 of file sensordlg.cpp.

43 {
44  if(sel == MKUINT(ID_SENSSEL,SEL_COMMAND)) {
45  vuMutex blah;
46  vuLock(m_PGeomMutex ? *m_PGeomMutex : blah);
48  } else {
49  FXInputDialog inpd(this, "Edit Sensor", "Sensor string");
50  inpd.setText(m_SList->getItem(m_SList->getCurrentItem()));
51  if(inpd.execute()) {
52  vuMutex blah;
53  vuLock(m_PGeomMutex ? *m_PGeomMutex : blah);
54  stringstream ss;
55  ss << inpd.getText().text();
56  ParseFile pf(ss);
57  sensor_ptr sensor = m_Sensors.readSensor(pf);
58  if(sensor) {
59  sensor = m_Sensors.addSensor(sensor);
61  //if(m_ImgWin) m_ImgWin->selectSensor(getSelectedSensor());
62  //m_SList->setItemText(m_SList->getCurrentItem(),
63  // inpd.getText());
64  updateStrings();
65  }
66  }
67  }
68  return 1;
69 }
int selectSensor(int sido)
Definition: deform.cpp:325
void updateModels() const
Definition: SensorColl.cpp:292
ImageWindow * m_ImgWin
Definition: sensordlg.h:34
std::shared_ptr< Sensor > sensor_ptr
Definition: types_fwd.h:15
vuMutex * m_PGeomMutex
Definition: sensordlg.h:36
FXListBox * m_SList
Definition: sensordlg.h:33
int getSelectedSensor() const
Definition: sensordlg.cpp:96
SensorCollection & m_Sensors
Definition: sensordlg.h:29
void updateStrings()
Definition: sensordlg.cpp:71
sensor_ptr readSensor(ParseFile &is)
Definition: SensorColl.cpp:101
sensor_ptr addSensor(const std::string &key, sensor_ptr s)
Definition: SensorColl.cpp:24
void SensorDialog::setGeomMutex ( vuMutex mutex)
inline

Definition at line 23 of file sensordlg.h.

References m_PGeomMutex.

23 { m_PGeomMutex = mutex; }
vuMutex * m_PGeomMutex
Definition: sensordlg.h:36
void SensorDialog::updateStrings ( )

Definition at line 71 of file sensordlg.cpp.

72 {
73  m_SIndices.clear();
74  m_SList->clearItems();
75  int sid=0;
76  for(SensorCollection::const_iterator s=m_Sensors.begin();
77  s!=m_Sensors.end();s++,sid++)
78  {
79  if(s->second->getID() != "0" && // zero sensor
80  s->second->getID() != "d0" &&
81  !s->second->getID().empty())
82  {
83  stringstream ss;
84  s->second->print(ss);
85  m_SList->appendItem(ss.str().c_str());
86  //cout << sid <<": " << ss.str() << endl;
87  m_SIndices.push_back(sid);
88  }
89  }
90  m_SList->appendItem("# new sensor #");
91  m_SIndices.push_back(sid);
92  m_SList->setNumVisible(m_SList->getNumItems());
93 
94 }
FXListBox * m_SList
Definition: sensordlg.h:33
SensorCollection & m_Sensors
Definition: sensordlg.h:29
std::vector< int > m_SIndices
Definition: sensordlg.h:35

Member Data Documentation

ImageWindow* SensorDialog::m_ImgWin
protected

Definition at line 34 of file sensordlg.h.

vuMutex* SensorDialog::m_PGeomMutex
protected

Definition at line 36 of file sensordlg.h.

Referenced by setGeomMutex().

SensorCollection& SensorDialog::m_Sensors
protected

Definition at line 29 of file sensordlg.h.

Referenced by SensorDialog().

std::vector<int> SensorDialog::m_SIndices
protected

Definition at line 35 of file sensordlg.h.

FXListBox* SensorDialog::m_SList
protected

Definition at line 33 of file sensordlg.h.


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