Ejemplo n.º 1
0
void
QvisSubsetPanelWidget::ViewCollection(int id)
{
    avtSILRestriction_p restriction = viewerProxy->GetPlotSILRestriction();
    avtSILCollection_p collection = restriction->GetSILCollection(id);
    numCheckable = 0;
    numChecked = 0;
    tree->clear();

    if(*collection != NULL)
    {
        tree->setEnabled(true);
        blockSignals(true);
          
        SetTitle(collection->GetCategory().c_str());
        const avtSILNamespace *ns = collection->GetSubsets();
        int numElems = ns->GetNumberOfElements();

        avtSILRestrictionTraverser trav(restriction);
        for(int i = 0; i < numElems; ++i)
        {
            int setIdx = ns->GetElement(i);
            avtSILSet_p set = restriction->GetSILSet(setIdx);

            // Create an item for the set and set its checked value.
            CheckedState s = S2S(trav.UsesSetData(setIdx));
            QString cname(set->GetName().c_str());
            QvisSubsetPanelItem *item = new QvisSubsetPanelItem(tree,
                                                                cname,
                                                                s,
                                                                setIdx);
            numCheckable++;

            if(s == CompletelyChecked)
                numChecked++;
            
            // Add all of the collections that come out of the set. Note that
            // they are added as uncheckable items.
            QvisSubsetPanelItem *cItem = NULL;
            const std::vector<int> &mapsOut = set->GetMapsOut();
            for(size_t j = 0; j < mapsOut.size(); ++j)
            {
                int cIndex = mapsOut[j];

                avtSILCollection_p c = restriction->GetSILCollection(cIndex);
                QString collectionName(c->GetCategory().c_str());
                cItem = new QvisSubsetPanelItem(item,
                                                collectionName,
                                                cIndex);
            }
        }
        blockSignals(false);
    }
    EnableButtons(true);
    
    
}
Ejemplo n.º 2
0
int main() {
	printf("i2i: %d\n", i2i(1));
	printf("I2I: %d\n", I2I(1));
	printf("s2s: %d\n", s2s(1));
	printf("S2S: %d\n", S2S(1));
	printf("l2l: %d\n", l2l(1));
	printf("L2L: %d\n", L2L(1));
	printf("q2q: %lld\n", q2q(1));
	printf("Q2Q: %lld\n", Q2Q(1));
	printf("f2f: %f\n", f2f(1.1));
	printf("d2d: %f\n", d2d(1.1));

	return 0;
}
Ejemplo n.º 3
0
void
QvisSubsetPanelWidget::UpdateView()
{
    avtSILRestriction_p restriction = viewerProxy->GetPlotSILRestriction();
    avtSILRestrictionTraverser trav(restriction);
    tree->blockSignals(true);
    QTreeWidgetItemIterator itr(tree);
    while(*itr)
    {
        QvisSubsetPanelItem *item = (QvisSubsetPanelItem *)*itr;
        if(item->parent() == NULL)
            item->setState(S2S(trav.UsesSetData(item->id())));
        ++itr;
    }
    tree->blockSignals(false);
    
}
Ejemplo n.º 4
0
void
QvisSubsetPanelWidget::ViewSet(int id)
{
    avtSILRestriction_p restriction = viewerProxy->GetPlotSILRestriction();
    numCheckable = 0;
    numChecked = 0;
    tree->clear();
    tree->setEnabled(true);
    avtSILSet_p current = restriction->GetSILSet(id);
    const std::vector<int> &mapsOut = current->GetMapsOut();

    // Create a listview item with the name of the whole set.
    QString wholeName(current->GetName().c_str());
    avtSILRestrictionTraverser trav(restriction);
    
    CheckedState s = S2S(trav.UsesSetData(id));
    
    QvisSubsetPanelItem *item = new QvisSubsetPanelItem(tree, wholeName, s, id);

    numCheckable++;    
    if(s == CompletelyChecked)
        numChecked++;

    QvisSubsetPanelItem *checkItem=NULL;
    // Add all of the collections that come out of the whole.
    for(size_t j = 0; j < mapsOut.size(); ++j)
    {
        // cIndex is the j'th collection coming from out of the whole.
        int cIndex = mapsOut[j];

        // Create a new item under the whole and set its checked value.
        avtSILCollection_p collection = restriction->GetSILCollection(cIndex);
        QString collectionName(collection->GetCategory().c_str());
    
        checkItem = new QvisSubsetPanelItem(item,
                                            collectionName,
                                            cIndex);
    }

    item->setExpanded(true);
    EnableButtons(true);
}