Exemplo n.º 1
0
int PMObjectSelect::selectObject( PMObject* link,
                                  const QStringList& t,
                                  PMObject* & obj, QWidget* parent )
{
   PMObject* last = link;
   PMObject* scene;
   bool stop = false;
   bool found = false;
   
   do
   {
      scene = last->parent( );
      if( scene )
      {
         if( scene->type( ) == "Scene" )
         {
            last = last->prevSibling( );
            stop = true;
            found = true;
         }
         else
            last = last->parent( );
      }
      else
         stop = true;
   }
   while( !stop );
   
   if( found )
   {
      PMObjectSelect s( parent );

      PMObject* o = scene->firstChild( );
      bool l = false;
      
      while( o && !l && last )
      {
         if( t.findIndex( o->type( ) ) >= 0 )
            s.m_pListBox->insertItem( new PMListBoxObject( o ) );
         
         if( o == last )
            l = true;
         else
            o = o->nextSibling( );
      }
   
      int result = s.exec( );
      if( result == Accepted )
         obj = s.selectedObject( );
      
      return result;
   }
   else
      kdError( PMArea ) << "PMObjectSelect: Link does not seem to be correctly inserted in the scene.\n";
   return Rejected;
}
Exemplo n.º 2
0
double PMTextureMapBase::mapValue( const PMObject* obj ) const
{
   PMObject* o = firstChild( );
   QValueList<double>::ConstIterator it = m_mapValues.begin( );

   while( o && ( o != obj ) )
   {
      if( o->type( ) == mapType( ) )
         ++it;
      o = o->nextSibling( );
   }
   return *it;
}
Exemplo n.º 3
0
QValueList<double>::Iterator PMTextureMapBase::valueForChild( PMObject* obj )
{
   PMObject* o = firstChild( );
   QValueList<double>::Iterator it = m_mapValues.begin( );

   while( o && ( o != obj ) )
   {
      if( o->type( ) == mapType( ) )
         ++it;
      o = o->nextSibling( );
   }
   return it;
}
Exemplo n.º 4
0
PMObject* PMTextureMapBase::nextMapEntry( PMObject* o )
{
   bool stop = false;
   PMObject* result = o;

   do
   {
      if( result == 0 )
         result = firstChild( );
      else
         result = result->nextSibling( );

      if( !result )
         stop = true;
      else if( result->type( ) == mapType( ) )
         stop = true;
   }
   while( !stop );

   return result;
}