IpsaDialog Class Reference
[libipsaViewer classes]

#include <IpsaDialog.h>

Collaboration diagram for IpsaDialog:

Collaboration graph
[legend]

List of all members.

Public Slots

virtual void commandSelected (const QString &command)
virtual void getSetValue ()
virtual void modeSelected (const QString &mode)
virtual void nodeSelected (const QString &node)
virtual void reloadData ()

Public Member Functions

 IpsaDialog (IpsaSimulator *simulator, QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~IpsaDialog ()

Public Attributes

QPushButton * action
QComboBox * commandList
QComboBox * modeSelector
QComboBox * nodeList
QLineEdit * value1
QLabel * value1label
QLineEdit * value2
QLabel * value2lable
QLineEdit * value3
QLabel * value3label

Protected Slots

virtual void languageChange ()

Protected Member Functions

void evaluateAnswer (const std::ostringstream &answer, unsigned int numberOfReturnValues)

Protected Attributes

QVBoxLayout * Layout5
QSpacerItem * Spacer1

Private Member Functions

void buildGui ()

Private Attributes

const QString bodySelectionName
std::map< std::string,
Instruction * > 
commandMap
QString currentCommand
QString currentNode
IpsaSimulatoripsaSimulator
const QString jointSelectionName


Detailed Description

Defines the IpsaDialog class.

Definition at line 53 of file IpsaDialog.h.


Constructor & Destructor Documentation

IpsaDialog::IpsaDialog ( IpsaSimulator simulator,
QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0 
)

Constructs an IpsaDialog as a child of 'parent', with the name 'name' and widget flags set to 'f'.

The dialog will by default be modeless, unless you set 'modal' to TRUE to construct a modal dialog.

Definition at line 63 of file IpsaDialog.cpp.

References NVInstructions::CreateInstructionMap().

IpsaDialog::~IpsaDialog (  ) 

Destroys the object and frees any allocated resources

Definition at line 91 of file IpsaDialog.cpp.


Member Function Documentation

void IpsaDialog::buildGui (  )  [private]

Creates the widget and all necessary connections.

Definition at line 248 of file IpsaDialog.cpp.

References action, commandList, commandSelected(), getSetValue(), languageChange(), Layout5, modeSelected(), modeSelector, nodeList, nodeSelected(), value1, value1label, value2, value2lable, value3, and value3label.

void IpsaDialog::commandSelected ( const QString &  command  )  [virtual, slot]

Stores the currently selected command and enables as many value fields as necessary for the command.

Definition at line 219 of file IpsaDialog.cpp.

References commandMap, currentCommand, value1, value2, and value3.

Referenced by buildGui(), and modeSelected().

void IpsaDialog::evaluateAnswer ( const std::ostringstream &  answer,
unsigned int  numberOfReturnValues 
) [protected]

If the answer can be decoded set the values of the value fields accordingly.

Definition at line 134 of file IpsaDialog.cpp.

References convertAnswerToVector(), value1, value2, and value3.

Referenced by getSetValue().

void IpsaDialog::getSetValue (  )  [virtual, slot]

Fetches the instruction belonging to the current command, assembles its parameter vector and executes the command.

Definition at line 101 of file IpsaDialog.cpp.

References commandMap, currentCommand, currentNode, evaluateAnswer(), Instruction::findAndExecute(), Instruction::getCommandParameterCount(), value1, value2, and value3.

Referenced by buildGui().

void IpsaDialog::languageChange (  )  [protected, virtual, slot]

Sets the strings of the subwidgets using the current language.

Definition at line 311 of file IpsaDialog.cpp.

References action, commandList, value1label, value2lable, and value3label.

Referenced by buildGui().

void IpsaDialog::modeSelected ( const QString &  mode  )  [virtual, slot]

Creates the content of the node selection list and the command selection list depending on the value of IpsaDialog::modeSelector (i.e. body or joint).

Definition at line 166 of file IpsaDialog.cpp.

References bodySelectionName, commandList, commandMap, commandSelected(), ipsaSimulator, nodeList, and nodeSelected().

Referenced by buildGui(), and reloadData().

void IpsaDialog::nodeSelected ( const QString &  node  )  [virtual, slot]

Stores the name of the currently selected node.

Definition at line 209 of file IpsaDialog.cpp.

References currentNode.

Referenced by buildGui(), and modeSelected().

void IpsaDialog::reloadData (  )  [virtual, slot]

Reloads all available commands and nodes by calling IpsaDialog::modeSelected() with the current value of IpsaDialog::modeSelector.

Definition at line 239 of file IpsaDialog.cpp.

References modeSelected(), and modeSelector.

Referenced by IpsaViewerWidget::showDialog(), and IpsaViewer::showDialog().


Member Data Documentation

QPushButton* IpsaDialog::action

Definition at line 74 of file IpsaDialog.h.

Referenced by buildGui(), and languageChange().

const QString IpsaDialog::bodySelectionName [private]

Definition at line 100 of file IpsaDialog.h.

Referenced by modeSelected().

Definition at line 73 of file IpsaDialog.h.

Referenced by buildGui(), languageChange(), and modeSelected().

std::map<std::string, Instruction*> IpsaDialog::commandMap [private]

Definition at line 98 of file IpsaDialog.h.

Referenced by commandSelected(), getSetValue(), and modeSelected().

QString IpsaDialog::currentCommand [private]

Definition at line 95 of file IpsaDialog.h.

Referenced by commandSelected(), and getSetValue().

QString IpsaDialog::currentNode [private]

Definition at line 96 of file IpsaDialog.h.

Referenced by getSetValue(), and nodeSelected().

Definition at line 97 of file IpsaDialog.h.

Referenced by modeSelected().

const QString IpsaDialog::jointSelectionName [private]

Definition at line 101 of file IpsaDialog.h.

QVBoxLayout* IpsaDialog::Layout5 [protected]

Definition at line 86 of file IpsaDialog.h.

Referenced by buildGui().

Definition at line 71 of file IpsaDialog.h.

Referenced by buildGui(), and reloadData().

Definition at line 72 of file IpsaDialog.h.

Referenced by buildGui(), and modeSelected().

QSpacerItem* IpsaDialog::Spacer1 [protected]

Definition at line 87 of file IpsaDialog.h.

QLineEdit* IpsaDialog::value1

Definition at line 68 of file IpsaDialog.h.

Referenced by buildGui(), commandSelected(), evaluateAnswer(), and getSetValue().

Definition at line 65 of file IpsaDialog.h.

Referenced by buildGui(), and languageChange().

QLineEdit* IpsaDialog::value2

Definition at line 69 of file IpsaDialog.h.

Referenced by buildGui(), commandSelected(), evaluateAnswer(), and getSetValue().

Definition at line 66 of file IpsaDialog.h.

Referenced by buildGui(), and languageChange().

QLineEdit* IpsaDialog::value3

Definition at line 70 of file IpsaDialog.h.

Referenced by buildGui(), commandSelected(), evaluateAnswer(), and getSetValue().

Definition at line 67 of file IpsaDialog.h.

Referenced by buildGui(), and languageChange().


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

Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:19 2012 for IPSA by  doxygen 1.5.8