#include <IpsaViewerWidget.h>
Public Slots | |
void | reload () |
void | reset () |
void | save () |
void | schedule () |
void | showDialog () |
Public Member Functions | |
bool | getVerbosity () |
IpsaViewerWidget (QWidget *parent, SbBool embed=TRUE) | |
bool | isScheduled () |
void | setSceneryFilename (const std::string &newFile) |
void | setVerbosity (bool verbosityOn=true) |
virtual | ~IpsaViewerWidget () |
Protected Attributes | |
IpsaDialog * | dialog |
SoQtExaminerViewer * | examinerViewer |
IpsaSimulator * | ipsaSimulator |
std::string | saveFile |
Create an instance of this class to use it for simulating IPSA scenes (Note that you have to call SO_PLATFORM::init() before instantiating an IpsaViewer): The code usually looks like the following example (also see the QtEmbedding executable):
#include "IpsaViewerWidget.h" #include <Inventor/Qt/SoQt.h> #include <QtGui/QApplication> int main (int argc, char ** argv) { QApplication qApplication(argc, argv); SO_WINDOW parentWidget = SO_PLATFORM::init(argc, argv, argv[0]); IpsaViewerWidget viewer(parentWidget); // create an instance of the IpsaViewerWidget viewer.show(); viewer.raise(); return qApplication.exec(); }
The simulation behaviour can be changed by creating a subclass of IpsaSimulator and using this instead of the default IpsaSimulator instance.
Definition at line 46 of file IpsaViewerWidget.h.
IpsaViewerWidget::IpsaViewerWidget | ( | QWidget * | parent, | |
SbBool | embed = TRUE | |||
) |
The constructor of the IpsaViewerWidget class.
It runs the gui setup and creates a new IpsaSimulator instance in IpsaViewerWidget::ipsaSimulator
parent | the parent widget of the viewer (default = NULL) | |
embed | tells if viewer should be embedded (default TRUE) |
Definition at line 128 of file IpsaViewerWidget.cpp.
References dialog, examinerViewer, IpsaViewerWidgetUi::examinerViewerWidget, ipsaSimulator, and IpsaViewerWidgetUi::setupUi().
IpsaViewerWidget::~IpsaViewerWidget | ( | ) | [virtual] |
The virtual destructor of the IpsaViewerWidget class. It deletes IpsaViewer::ipsaSimulator.
Definition at line 153 of file IpsaViewerWidget.cpp.
References ipsaSimulator.
bool IpsaViewerWidget::getVerbosity | ( | ) |
Definition at line 242 of file IpsaViewerWidget.cpp.
References IpsaSimulator::getVerbosity(), and ipsaSimulator.
bool IpsaViewerWidget::isScheduled | ( | ) |
Definition at line 222 of file IpsaViewerWidget.cpp.
References ipsaSimulator, and IpsaSimulator::isScheduled().
void IpsaViewerWidget::reload | ( | ) | [slot] |
This method creates a new scenegraph by calling IpsaSimulator::reload() on IpsaViewerWidget::ipsaSimulator and afterwards sets it on IpsaViewerWidget::examinerViewer.
Definition at line 176 of file IpsaViewerWidget.cpp.
References examinerViewer, IpsaSimulator::getSceneGraph(), ipsaSimulator, and IpsaSimulator::reload().
void IpsaViewerWidget::reset | ( | ) | [slot] |
Resets the simulation by calling IpsaSimulator::reset() in IpsaViewerWidget::ipsaSimulator.
Definition at line 186 of file IpsaViewerWidget.cpp.
References ipsaSimulator, and IpsaSimulator::reset().
void IpsaViewerWidget::save | ( | ) | [slot] |
Save current inventor scenegraph to file at location IpsaViewerWidget::saveFile. Do nothing if IpsaViewerWidget::saveFile is empty.
Definition at line 196 of file IpsaViewerWidget.cpp.
References ipsaSimulator, IpsaSimulator::save(), and saveFile.
void IpsaViewerWidget::schedule | ( | ) | [slot] |
Calls IpsaSimulator::schedule() on IpsaViewer::ipsaSimulator. IpsaViewer::scheduleButton is changed to reflect the current state.
Definition at line 209 of file IpsaViewerWidget.cpp.
References ipsaSimulator, IpsaSimulator::isScheduled(), IpsaSimulator::schedule(), and IpsaViewerWidgetUi::scheduleButton.
void IpsaViewerWidget::setSceneryFilename | ( | const std::string & | newFile | ) |
This method sets newFile
as the new filename on IpsaViewerWidget::ipsaSimulator. After calling IpsaViewer::reload() the new file is read.
Definition at line 252 of file IpsaViewerWidget.cpp.
References ipsaSimulator, and IpsaSimulator::setSceneryFilename().
void IpsaViewerWidget::setVerbosity | ( | bool | verbosityOn = true |
) |
Sets the verbosity flag on IpsaViewerWidget::ipsaSimulator.
verbosityOn | true for turning verbosity on, false for turning it of (default = true) |
Definition at line 233 of file IpsaViewerWidget.cpp.
References ipsaSimulator, and IpsaSimulator::setVerbosity().
void IpsaViewerWidget::showDialog | ( | ) | [slot] |
Shows the IpsaViewerWidget::dialog if it isn't on screen or raises it otherwise.
Definition at line 162 of file IpsaViewerWidget.cpp.
References dialog, and IpsaDialog::reloadData().
IpsaViewerWidget::dialog [protected] |
An instance of IpsaDialog.
Definition at line 74 of file IpsaViewerWidget.h.
Referenced by IpsaViewerWidget(), and showDialog().
IpsaViewerWidget::examinerViewer [protected] |
This is a reference to the SoQtExaminerViewer instance which is displayed in the widget.
Definition at line 73 of file IpsaViewerWidget.h.
Referenced by IpsaViewerWidget(), and reload().
IpsaViewerWidget::ipsaSimulator [protected] |
An instance of IpsaSimulator which takes care of the simulation.
Definition at line 72 of file IpsaViewerWidget.h.
Referenced by getVerbosity(), IpsaViewerWidget(), isScheduled(), reload(), reset(), save(), schedule(), setSceneryFilename(), setVerbosity(), and ~IpsaViewerWidget().
IpsaViewerWidget::saveFile [protected] |
This filename is used to write the current inventor scenegraph to disk.
Definition at line 70 of file IpsaViewerWidget.h.
Referenced by save().
Generated on Sat Mar 10 20:00:19 2012 for IPSA by 1.5.8 |