COPASI API  4.16.103
Public Slots | Public Member Functions | Protected Attributes | List of all members
CQAnimationSettingsEditor Class Reference

#include <CQAnimationSettingsEditor.h>

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

Public Slots

void slotEffectAdded ()
 
void slotEffectRemoved ()
 
void slotScaleModeChanged ()
 
void slotSelectionChanged ()
 

Public Member Functions

 CQAnimationSettingsEditor (QWidget *parent=0, Qt::WindowFlags f=0)
 
void initFrom (CQCopasiAnimation *other)
 
void saveChanges ()
 
void saveTo (CQCopasiAnimation *target)
 
virtual ~CQAnimationSettingsEditor ()
 

Protected Attributes

std::vector
< CQEffectDescription * > 
mEntries
 
QList< QListWidgetItem * > mLastSelection
 

Detailed Description

Definition at line 16 of file CQAnimationSettingsEditor.h.

Constructor & Destructor Documentation

CQAnimationSettingsEditor::CQAnimationSettingsEditor ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

Definition at line 10 of file CQAnimationSettingsEditor.cpp.

11  : QDialog(parent, f)
12 {
13  setupUi(this);
14 }
CQAnimationSettingsEditor::~CQAnimationSettingsEditor ( )
virtual

Definition at line 16 of file CQAnimationSettingsEditor.cpp.

17 {
18 }

Member Function Documentation

void CQAnimationSettingsEditor::initFrom ( CQCopasiAnimation other)

Definition at line 60 of file CQAnimationSettingsEditor.cpp.

References CQEffectDescription::getCN(), CQCopasiAnimation::getEntries(), CQCopasiAnimation::getScaleMode(), CQCopasiAnimation::Global, and mEntries.

Referenced by CQAnimationWindow::slotEditSettings().

61 {
63  radGlobal->setChecked(true);
64  else
65  radIndividual->setChecked(true);
66 
67  std::vector<CQEffectDescription*> entries = other->getEntries();
68  std::vector<CQEffectDescription*>::iterator it = entries.begin();
69  mEntries.clear();
70 
71  while (it != entries.end())
72  {
73  CQEffectDescription* current = *it;
74 
75  QListWidgetItem* item = new QListWidgetItem(current->getCN().c_str());
76  item->setData(Qt::UserRole, (int)mEntries.size());
77  listWidget->addItem(item);
78  mEntries.push_back(current);
79 
80  ++it;
81  }
82 }
ScaleMode getScaleMode() const
const std::string & getCN() const
std::vector< CQEffectDescription * > & getEntries()
std::vector< CQEffectDescription * > mEntries
void CQAnimationSettingsEditor::saveChanges ( )

Definition at line 32 of file CQAnimationSettingsEditor.cpp.

References mEntries, and mLastSelection.

Referenced by saveTo(), and slotSelectionChanged().

33 {
34  // go through last selection to save changes
35  for (int i = 0; i < mLastSelection.size(); ++i)
36  {
37  QListWidgetItem* current = mLastSelection[i];
38  int index = current->data(Qt::UserRole).toInt();
39  widget->saveTo(mEntries[index], mLastSelection.size() > 1);
40  }
41 }
QList< QListWidgetItem * > mLastSelection
std::vector< CQEffectDescription * > mEntries
void CQAnimationSettingsEditor::saveTo ( CQCopasiAnimation target)
void CQAnimationSettingsEditor::slotEffectAdded ( )
slot

Definition at line 24 of file CQAnimationSettingsEditor.cpp.

25 {
26 }
void CQAnimationSettingsEditor::slotEffectRemoved ( )
slot

Definition at line 28 of file CQAnimationSettingsEditor.cpp.

29 {
30 }
void CQAnimationSettingsEditor::slotScaleModeChanged ( )
slot

Definition at line 20 of file CQAnimationSettingsEditor.cpp.

21 {
22 }
void CQAnimationSettingsEditor::slotSelectionChanged ( )
slot

Definition at line 43 of file CQAnimationSettingsEditor.cpp.

References mEntries, mLastSelection, and saveChanges().

44 {
45  saveChanges();
46 
47  // fill with new entries
48  QList<QListWidgetItem*> selected = listWidget->selectedItems();
49 
50  for (int i = 0; i < selected.size(); ++i)
51  {
52  QListWidgetItem* current = selected[i];
53  int index = current->data(Qt::UserRole).toInt();
54  widget->initFrom(mEntries[index], selected.size() > 1);
55  }
56 
57  mLastSelection = selected;
58 }
QList< QListWidgetItem * > mLastSelection
std::vector< CQEffectDescription * > mEntries

Member Data Documentation

std::vector<CQEffectDescription*> CQAnimationSettingsEditor::mEntries
protected

Definition at line 31 of file CQAnimationSettingsEditor.h.

Referenced by initFrom(), saveChanges(), and slotSelectionChanged().

QList<QListWidgetItem*> CQAnimationSettingsEditor::mLastSelection
protected

Definition at line 32 of file CQAnimationSettingsEditor.h.

Referenced by saveChanges(), and slotSelectionChanged().


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