Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
LoadsEditor Class Reference

A clean dialog to edit (add, modify, delete), loads and their parameters, directly from Core. More...

#include <LoadsEditor.h>

Public Slots

void apply ()
 when the user clic on apply
void applyToClicked ()
 when user clicked on the applyTo button
void applyToReturnPressed ()
 when user pressed return in the applyTo line edit
void applyToTextChanged (const QString &)
 when user has typed some text in the applyTo line edit
void deleteLoad ()
 when user click to delete current load
void deleteValueEvent ()
 when user wants to delete current value event
void loadTableItemClicked (QTableWidgetItem *)
 when the user click on the load list
void newLoad ()
 when user click to add a new load
void newValueEvent ()
 when user wants to add a new value event
void nullDisplacementClicked ()
 when user toggle null displacement
void reject ()
 when the user clic on cancel
void reset ()
 when the user clic on reset, reset the loads (using load manager loads)
void unitChanged ()
 when user changed the current unit
void valueEventTableItemClicked (QTableWidgetItem *)
 when user double clic on a value event
void xChanged ()
 when user changed the direction x
void yChanged ()
 when user changed the direction y
void zChanged ()
 when user changed the direction z

Public Member Functions

 LoadsEditor (LoadsManager *myLoadsManager, QWidget *parent=0)
 default constructor
 LoadsEditor (std::vector< camitk::Component * > selectedDC, LoadsManager *myLoadsManager, QWidget *parent=0)
 another constructor allowing for creating a new load for a particular atom dc
virtual void show ()
 overloaded so that it can update the load list
void updateLoads ()
 copy the loads from the manager to a local list
 ~LoadsEditor ()
 Destructor.

Private Member Functions

void createDCLoads (std::vector< camitk::Component * > *)
 create a new load using this DC as targets
Load * createNewLoad ()
 create a new load by asking the user for the load type.
void editLoad ()
 let user play with a current load
void init ()
 initialize everything
void updateLoadsTable ()
 refresh load list display
void updateND ()
 update the null displacement display
void updateValueEventTable ()
 refresh the value event display

Private Attributes

QColor bgColor
 the initial bg color
Load * editedLoad
 the currently edited load
Loads * loads
 local copy of the loads
LoadsManagermyLM
 my load manager
Ui::LoadsEditor ui
 the ui dialog designed in qtdesigner

Detailed Description

A clean dialog to edit (add, modify, delete), loads and their parameters, directly from Core.

Constructor & Destructor Documentation

LoadsEditor::LoadsEditor ( LoadsManager myLoadsManager,
QWidget *  parent = 0 
)

default constructor

References init(), myLM, and ui.

LoadsEditor::LoadsEditor ( std::vector< camitk::Component * >  selectedDC,
LoadsManager myLoadsManager,
QWidget *  parent = 0 
)

another constructor allowing for creating a new load for a particular atom dc

References createDCLoads(), init(), myLM, and ui.

LoadsEditor::~LoadsEditor ( )

Destructor.

References loads.

Member Function Documentation

void LoadsEditor::apply ( )
slot

when the user clic on apply

References LoadsManager::addLoad(), LoadsManager::deleteAllLoads(), loads, myLM, and LoadsManager::updateLoadsDisplay().

Referenced by init().

void LoadsEditor::applyToClicked ( )
slot

when user clicked on the applyTo button

References editedLoad.

Referenced by init().

void LoadsEditor::applyToReturnPressed ( )
slot

when user pressed return in the applyTo line edit

References bgColor, editedLoad, PMManagerDC::getPhysicalModel(), LoadsManager::getPMManagerDC(), myLM, ui, and updateLoadsTable().

Referenced by init().

void LoadsEditor::applyToTextChanged ( const QString &  )
slot

when user has typed some text in the applyTo line edit

References ui.

Referenced by init().

void LoadsEditor::createDCLoads ( std::vector< camitk::Component * > *  selectedDC)
private

create a new load using this DC as targets

References createNewLoad(), editedLoad, editLoad(), AtomDC::getAtom(), CellDC::getCell(), and loads.

Referenced by LoadsEditor().

Load * LoadsEditor::createNewLoad ( )
private

create a new load by asking the user for the load type.

Returns
a new load of type choose by the user or NULL if user cancelled

References reject().

Referenced by createDCLoads(), and newLoad().

void LoadsEditor::deleteLoad ( )
slot

when user click to delete current load

References editedLoad, loads, ui, and updateLoadsTable().

Referenced by init().

void LoadsEditor::deleteValueEvent ( )
slot

when user wants to delete current value event

References editedLoad, ui, and updateValueEventTable().

Referenced by init().

void LoadsEditor::editLoad ( )
private

let user play with a current load

References bgColor, editedLoad, ui, updateLoadsTable(), updateND(), and updateValueEventTable().

Referenced by createDCLoads(), loadTableItemClicked(), newLoad(), and show().

void LoadsEditor::init ( )
private
void LoadsEditor::loadTableItemClicked ( QTableWidgetItem *  )
slot

when the user click on the load list

References editedLoad, editLoad(), loads, and ui.

Referenced by init().

void LoadsEditor::newLoad ( )
slot

when user click to add a new load

References createNewLoad(), editedLoad, editLoad(), and loads.

Referenced by init().

void LoadsEditor::newValueEvent ( )
slot

when user wants to add a new value event

References editedLoad, LoadsValueEvent::getDate(), LoadsValueEvent::getValue(), and updateValueEventTable().

Referenced by init().

void LoadsEditor::nullDisplacementClicked ( )
slot

when user toggle null displacement

References editedLoad, ui, updateLoadsTable(), and updateND().

Referenced by init().

void LoadsEditor::reject ( )
slot

when the user clic on cancel

Referenced by createNewLoad().

void LoadsEditor::reset ( )
slot

when the user clic on reset, reset the loads (using load manager loads)

References init().

Referenced by init().

void LoadsEditor::show ( )
virtual

overloaded so that it can update the load list

References editedLoad, and editLoad().

Referenced by LoadsManager::addLoad(), and LoadsManager::editLoads().

void LoadsEditor::unitChanged ( )
slot

when user changed the current unit

References editedLoad, ui, and updateLoadsTable().

Referenced by init().

void LoadsEditor::updateLoads ( )

copy the loads from the manager to a local list

References LoadsManager::getLoads(), loads, and myLM.

Referenced by LoadsManager::editLoads(), and init().

void LoadsEditor::updateLoadsTable ( )
private
void LoadsEditor::updateND ( )
private

update the null displacement display

References editedLoad, and ui.

Referenced by editLoad(), nullDisplacementClicked(), xChanged(), yChanged(), and zChanged().

void LoadsEditor::updateValueEventTable ( )
private

refresh the value event display

References editedLoad, and ui.

Referenced by deleteValueEvent(), editLoad(), newValueEvent(), and valueEventTableItemClicked().

void LoadsEditor::valueEventTableItemClicked ( QTableWidgetItem *  )
slot

when user double clic on a value event

References editedLoad, LoadsValueEvent::getDate(), LoadsValueEvent::getValue(), ui, and updateValueEventTable().

Referenced by init().

void LoadsEditor::xChanged ( )
slot

when user changed the direction x

References editedLoad, ui, updateLoadsTable(), and updateND().

Referenced by init().

void LoadsEditor::yChanged ( )
slot

when user changed the direction y

References editedLoad, ui, updateLoadsTable(), and updateND().

Referenced by init().

void LoadsEditor::zChanged ( )
slot

when user changed the direction z

References editedLoad, ui, updateLoadsTable(), and updateND().

Referenced by init().

Member Data Documentation

QColor LoadsEditor::bgColor
private

the initial bg color

Referenced by applyToReturnPressed(), and editLoad().

Load* LoadsEditor::editedLoad
private
Loads* LoadsEditor::loads
private
LoadsManager* LoadsEditor::myLM
private

my load manager

Referenced by apply(), applyToReturnPressed(), LoadsEditor(), and updateLoads().

Ui::LoadsEditor LoadsEditor::ui
private

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