PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet )
{
    ItemVector newItems;

    BOOST_FOREACH( PNS_ITEM * item, m_items )

    if( item->GetNet() == aNet )
        newItems.push_back( item );

    m_items = newItems;
    return *this;
}
PNS_ITEMSET& PNS_ITEMSET::FilterKinds( int aKindMask )
{
    ItemVector newItems;

    BOOST_FOREACH( PNS_ITEM * item, m_items )

    if( item->GetKind() & aKindMask )
        newItems.push_back( item );

    m_items = newItems;
    return *this;
}
TransferFunctionFactory::ItemVector TransferFunctionFactory::createItemVector(unsigned int _size, const float *_rgba, float *_sda)
{
  ItemVector data;
  for (unsigned int i = 0; i < _size; ++i)
  {
    Item item;
    item.r  = _rgba[4 * i];
    item.g  = _rgba[4 * i + 1];
    item.b  = _rgba[4 * i + 2];
    item.a  = _rgba[4 * i + 3];
    item.s  = _sda[3 * i];
    item.d  = _sda[3 * i + 1];
    item.am = _sda[3 * i + 2];
    data.push_back(item);
  }
  return data;
}
PNS_ITEMSET& PNS_ITEMSET::FilterLayers( int aStart, int aEnd )
{
    ItemVector newItems;
    PNS_LAYERSET l;

    if( aEnd < 0 )
        l = PNS_LAYERSET( aStart );
    else
        l = PNS_LAYERSET( aStart, aEnd );

    BOOST_FOREACH( PNS_ITEM * item, m_items )

    if( item->GetLayers().Overlaps( l ) )
        newItems.push_back( item );

    m_items = newItems;
    return *this;
}
ItemVectorWithPredecessor::ItemVectorWithPredecessor(const ItemVector& add, ItemVectorWithPredecessor *predecessor)
    : m_predecessor(predecessor),
      m_numberOfItemSizes(predecessor->m_numberOfItemSizes)
{
    m_itemCount = new int[m_numberOfItemSizes];
    for(int i = 0; i < m_numberOfItemSizes; ++i) {
        m_itemCount[i] = predecessor->m_itemCount[i] + add.itemCount(i);
    }
}
TransferFunctionPair * TransferFunctionFactory::createTransferFunction(tf::Format _format)
{
  Item item;
  item.r = 1.0f;
  item.g = 1.0f;
  item.b = 1.0f;
  item.s = 0.3f;
  item.d = 0.5f;
  item.am = 0.8f;
  ItemVector data;
  for (int i = 0; i < 256; ++i)
  {
    item.a = static_cast<float>(i) / 256.0f;
    data.push_back(item);
  }

  return createTransferFunction(_format, data);
}
void TransferFunctionFactory::createRgbaSdaData(const ItemVector &_data, float *_rgba, float *_sda)
{
  for (unsigned int i = 0; i < _data.size(); ++i)
  {
    _rgba[4 * i] = _data[i].r;
    _rgba[4 * i + 1] = _data[i].g;
    _rgba[4 * i + 2] = _data[i].b;
    _rgba[4 * i + 3] = _data[i].a;
    _sda[3 * i] = _data[i].s;
    _sda[3 * i + 1] = _data[i].d;
    _sda[3 * i + 2] = _data[i].am;
  }
}
示例#8
0
 /**
  * Return the number of tasks in the TaskStore
  * @return The number of tasks in the TaskStore
  */
 gcc_pure
 size_t Size() const {
   return store.size();
 }