Back to index

salome-paravis  6.5.0
Classes | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes | Private Types
pqMedReaderPanel Class Reference

#include <pqMedReaderPanel.h>

Collaboration diagram for pqMedReaderPanel:
Collaboration graph
[legend]

List of all members.

Classes

class  pqUI

Public Member Functions

 pqMedReaderPanel (pqProxy *proxy, QWidget *p=NULL)
 constructor
 ~pqMedReaderPanel ()
 destructor

Protected Types

enum  PixmapType {
  PM_NONE = -1, PM_POINT, PM_CELL, PM_QUADRATURE,
  PM_ELNO
}

Protected Slots

void animationModeChanged (int mode)
void updateSIL ()

Protected Member Functions

virtual void linkServerManagerProperties ()
 populate widgets with properties from the server manager
void addSelectionsToTreeWidget (const QString &prop, QTreeWidget *tree, PixmapType pix)
void addSelectionToTreeWidget (const QString &name, const QString &realName, QTreeWidget *tree, PixmapType pix, const QString &prop, int propIdx)
void setupAnimationModeWidget ()
void updateAvailableTimes ()

Protected Attributes

pqUIUI

Private Types

typedef pqNamedObjectPanel Superclass

Detailed Description

Definition at line 30 of file pqMedReaderPanel.h.


Member Typedef Documentation

typedef pqNamedObjectPanel pqMedReaderPanel::Superclass [private]

Definition at line 33 of file pqMedReaderPanel.h.


Member Enumeration Documentation

enum pqMedReaderPanel::PixmapType [protected]
Enumerator:
PM_NONE 
PM_POINT 
PM_CELL 
PM_QUADRATURE 
PM_ELNO 

Definition at line 51 of file pqMedReaderPanel.h.


Constructor & Destructor Documentation

pqMedReaderPanel::pqMedReaderPanel ( pqProxy *  proxy,
QWidget *  p = NULL 
)

constructor

Definition at line 76 of file pqMedReaderPanel.cxx.

                                                                    :
  Superclass(object_proxy, p)
{
  this->UI = new pqUI(this);
  this->UI->setupUi(this);

  pqProxySILModel* proxyModel;

  // connect groups to groupsRoot
  proxyModel = new pqProxySILModel("GroupTree", &this->UI->SILModel);
  proxyModel->setSourceModel(&this->UI->SILModel);
  this->UI->Groups->setModel(proxyModel);
  this->UI->Groups->setHeaderHidden(true);

  this->UI->groupModel = new pqProxySILModel("Groups", &this->UI->SILModel);
  this->UI->groupModel->setSourceModel(&this->UI->SILModel);

  // connect cell types to "EntityRoot"
  proxyModel = new pqProxySILModel("EntityTree", &this->UI->SILModel);
  proxyModel->setSourceModel(&this->UI->SILModel);
  this->UI->Entity->setModel(proxyModel);
  this->UI->Entity->setHeaderHidden(true);

  this->UI->entityModel = new pqProxySILModel("Entity", &this->UI->SILModel);
  this->UI->entityModel->setSourceModel(&this->UI->SILModel);

  this->updateSIL();

  this->UI->Groups->header()->setStretchLastSection(true);
  this->UI->Entity->header()->setStretchLastSection(true);

  this->linkServerManagerProperties();

  QList<pqTreeWidget*> treeWidgets = this->findChildren<pqTreeWidget*> ();
  foreach (pqTreeWidget* tree, treeWidgets)
      {
      new pqTreeWidgetSelectionHelper(tree);
      }

  QList<pqTreeView*> treeViews = this->findChildren<pqTreeView*> ();
  foreach (pqTreeView* tree, treeViews)
      {
      new pqTreeViewSelectionHelper(tree);
      }

  this->connect(this->UI->groupModel, SIGNAL(valuesChanged()),
                this, SLOT(setModified()));
  this->connect(this->UI->entityModel, SIGNAL(valuesChanged()),
                this, SLOT(setModified()));
  this->connect(this->UI->TimeCombo, SIGNAL(currentIndexChanged(int)),
                this, SLOT(setModified()));
  this->connect(this->UI->GenerateVectors, SIGNAL(stateChanged(int)),
                this, SLOT(setModified()));

  this->UI->tabWidget->setCurrentIndex(0);

  this->UI->VTKConnect->Connect(this->proxy(),
      vtkCommand::UpdateInformationEvent, this, SLOT(updateSIL()));
}

Here is the call graph for this function:

destructor

Definition at line 136 of file pqMedReaderPanel.cxx.

{
}

Member Function Documentation

void pqMedReaderPanel::addSelectionsToTreeWidget ( const QString &  prop,
QTreeWidget *  tree,
PixmapType  pix 
) [protected]

Definition at line 140 of file pqMedReaderPanel.cxx.

{
  vtkSMProperty* SMProperty = this->proxy()->GetProperty(prop.toAscii().data());
  QList<QVariant> SMPropertyDomain;
  SMPropertyDomain = pqSMAdaptor::getSelectionPropertyDomain(SMProperty);
  int j;
  for(j = 0; j < SMPropertyDomain.size(); j++)
    {
    QString varName = SMPropertyDomain[j].toString();
    this->addSelectionToTreeWidget(varName, varName, tree, pix, prop, j);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pqMedReaderPanel::addSelectionToTreeWidget ( const QString &  name,
const QString &  realName,
QTreeWidget *  tree,
PixmapType  pix,
const QString &  prop,
int  propIdx 
) [protected]

Definition at line 154 of file pqMedReaderPanel.cxx.

{
  static QPixmap pixmaps[] = {
    QPixmap(":/ParaViewResources/Icons/pqPointData16.png"),
    QPixmap(":/ParaViewResources/Icons/pqCellData16.png"),
    QPixmap(":/ParaViewResources/Icons/pqQuadratureData16.png"),
    QPixmap(":/ParaViewResources/Icons/pqElnoData16.png") };

  vtkSMProperty* SMProperty = this->proxy()->GetProperty(prop.toAscii().data());

  if(!SMProperty || !tree)
    {
    return;
    }

  QList<QString> strs;
  strs.append(name);
  pqTreeWidgetItemObject* item;
  item = new pqTreeWidgetItemObject(tree, strs);
  item->setData(0, Qt::ToolTipRole, name);
  if(pix >= 0)
    {
    item->setData(0, Qt::DecorationRole, pixmaps[pix]);
    }
  item->setData(0, Qt::UserRole, QString("%1 %2").arg((int) pix).arg(realName));
  this->propertyManager()->registerLink(item, "checked",
      SIGNAL(checkedStateChanged(bool)), this->proxy(), SMProperty, propIdx);

  this->UI->TreeItemToPropMap[item] = prop;
}

Here is the caller graph for this function:

void pqMedReaderPanel::animationModeChanged ( int  mode) [protected, slot]

Definition at line 250 of file pqMedReaderPanel.cxx.

{
  if(mode == vtkMedReader::Default || mode == vtkMedReader::PhysicalTime)
    {
    this->UI->TimeCombo->hide();
    this->UI->TimeLabel->hide();
    this->UI->Modes->hide();
    }
  else if(mode == vtkMedReader::Iteration)
    {
    this->UI->TimeCombo->show();
    this->UI->TimeLabel->show();
    this->UI->Modes->hide();
    }
  else // vtkMedReader::Modes
    {
    this->UI->TimeCombo->hide();
    this->UI->TimeLabel->hide();
    this->UI->Modes->show();
    }
  vtkSMPropertyHelper(this->proxy(), "AnimationMode").Set(mode);
  this->proxy()->UpdateVTKObjects();
  this->setModified();
}

Here is the caller graph for this function:

void pqMedReaderPanel::linkServerManagerProperties ( ) [protected, virtual]

populate widgets with properties from the server manager

Definition at line 187 of file pqMedReaderPanel.cxx.

{
  this->UI->Links.addPropertyLink(this->UI->groupModel, "values",
      SIGNAL(valuesChanged()), this->proxy(), this->proxy()->GetProperty(
          "Groups"));

  this->UI->Links.addPropertyLink(this->UI->entityModel, "values",
      SIGNAL(valuesChanged()), this->proxy(), this->proxy()->GetProperty(
          "Entity"));

  this->UI->Links.addPropertyLink(this->UI->GenerateVectors, "checked",
      SIGNAL(toggled(bool)), this->proxy(), this->proxy()->GetProperty(
          "GenerateVectors"));

  this->Superclass::linkServerManagerProperties();

  // do the point variables
  this->addSelectionsToTreeWidget("PointFieldsArrayStatus",
      this->UI->Variables, PM_POINT);
  // do the cell variables
  this->addSelectionsToTreeWidget("CellFieldsArrayStatus", this->UI->Variables,
      PM_CELL);
  // do the quadrature variables
  this->addSelectionsToTreeWidget("QuadratureFieldsArrayStatus",
      this->UI->Variables, PM_QUADRATURE);

  // do the Elno variables
  this->addSelectionsToTreeWidget("ElnoFieldsArrayStatus",
      this->UI->Variables, PM_ELNO);
  this->setupAnimationModeWidget();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 219 of file pqMedReaderPanel.cxx.

{
  this->UI->AnimationModeCombo->clear();
  QList<QVariant> modes = pqSMAdaptor::getEnumerationPropertyDomain(
      this->proxy()->GetProperty("AnimationMode"));
  for(int mode = 0; mode < modes.size(); mode++)
    {
    QString modeName = modes[mode].toString();
    this->UI->AnimationModeCombo->addItem(modeName);
    }

  this->UI->Links.addPropertyLink(this->UI->AnimationModeCombo, "currentIndex",
      SIGNAL(currentIndexChanged(int)), this->proxy(),
      this->proxy()->GetProperty("AnimationMode"));

  this->connect(this->UI->AnimationModeCombo,
      SIGNAL(currentIndexChanged(int)), this, SLOT(animationModeChanged(int)));

  this->UI->Links.addPropertyLink(this->UI->TimeCombo, "currentIndex",
      SIGNAL(currentIndexChanged(int)), this->proxy(),
      this->proxy()->GetProperty("TimeIndexForIterations"));

  this->addSelectionsToTreeWidget("FrequencyArrayStatus",
      this->UI->Modes, PM_NONE);

  vtkSMPropertyHelper helper(this->proxy(), "AnimationMode");
  int mode = helper.GetAsInt(0);
  this->animationModeChanged(mode);
  this->updateAvailableTimes();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 275 of file pqMedReaderPanel.cxx.

{
  vtkSMDoubleVectorProperty* prop = vtkSMDoubleVectorProperty::SafeDownCast(
      this->proxy()->GetProperty("AvailableTimes"));

  this->proxy()->UpdatePropertyInformation(prop);

  //prop->GetInformationHelper()->UpdateProperty(
  //    vtkProcessModuleConnectionManager::GetRootServerConnectionID(),
  //    vtkProcessModule::DATA_SERVER,
  //    this->proxy()->GetID(),
  //    prop);

  this->UI->TimeCombo->clear();
  double *aux = prop->GetElements();

  for(int tid = 0; tid < prop->GetNumberOfElements(); tid++)
    {
    this->UI->TimeCombo->addItem( QString::number(aux[tid]) );
    }

}

Here is the call graph for this function:

Here is the caller graph for this function:

void pqMedReaderPanel::updateSIL ( ) [protected, slot]

Definition at line 298 of file pqMedReaderPanel.cxx.

{
  vtkSMProxy* reader = this->referenceProxy()->getProxy();
  reader->UpdatePropertyInformation(reader->GetProperty("SILUpdateStamp"));

  int stamp = vtkSMPropertyHelper(reader, "SILUpdateStamp").GetAsInt();
  if (stamp != this->UI->SILUpdateStamp)
    {
    this->UI->SILUpdateStamp = stamp;
    vtkPVSILInformation* info = vtkPVSILInformation::New();
    reader->GatherInformation(info);
    this->UI->SILModel.update(info->GetSIL());

    this->UI->Groups->expandAll();
    this->UI->Entity->expandAll();

    info->Delete();
    }

  /*
  this->proxy()->UpdatePropertyInformation(
      this->proxy()->GetProperty("SILUpdateStamp"));

  int stamp = vtkSMPropertyHelper(this->proxy(), "SILUpdateStamp").GetAsInt();
  if(stamp != this->UI->SILUpdateStamp)
    {
    this->UI->SILUpdateStamp = stamp;

    vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
    vtkPVSILInformation* info = vtkPVSILInformation::New();
    pm->GatherInformation(this->proxy()->GetConnectionID(),
        vtkProcessModule::DATA_SERVER, info, this->proxy()->GetID());

    this->UI->SILModel.update(info->GetSIL());

    this->UI->Groups->expandAll();
    this->UI->Entity->expandAll();

    info->Delete();
    }*/
}

Here is the caller graph for this function:


Member Data Documentation

pqUI* pqMedReaderPanel::UI [protected]

Definition at line 70 of file pqMedReaderPanel.h.


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