ClassifiableEntry*
TaxonomyCreator :: prepareTS ( ClassifiableEntry* cur )
{
	// we just found that TS forms a cycle -- return stop-marker
	if ( waitStack.contains(cur) )
		return cur;

	// starting from the topmost entry
	addTop(cur);
	// true iff CUR is a reason of the cycle
	bool cycleFound = false;
	// for all the told subsumers...
	for ( ss_iterator p = told_begin(), p_end = told_end(); p < p_end; ++p )
		if ( !(*p)->isClassified() )	// need to classify it first
		{
			if ( unlikely((*p)->isNonClassifiable()) )
				continue;
			// prepare TS for *p
			ClassifiableEntry* v = prepareTS(*p);
			// if NULL is returned -- just continue
			if ( v == NULL )
				continue;
			if ( v == cur )	// current cycle is finished, all saved in Syns
			{
				// after classification of CUR we need to mark all the Syns as synonyms
				cycleFound = true;
				// continue to prepare its classification
				continue;
			}
			else
			{
				// arbitrary vertex in a cycle: save in synonyms of a root cause
				Syns.push_back(cur);
				// don't need to classify it
				removeTop();
				// return the cycle cause
				return v;
			}
		}
	// all TS are ready here -- let's classify!
	classifyTop();
	// now if CUR is the reason of cycle mark all SYNs as synonyms
	if ( cycleFound )
	{
		TaxonomyVertex* syn = cur->getTaxVertex();
		for ( std::vector<ClassifiableEntry*>::iterator q = Syns.begin(), q_end = Syns.end(); q != q_end; ++q )
			syn->addSynonym(*q);
		Syns.clear();
	}
	// here the cycle is gone
	return NULL;
}
Exemple #2
0
TabView::TabView(TraceItemView* parentView,
                 QWidget* parent, const char* name)
  : QWidget(parent, name), TraceItemView(parentView)
{
    setFocusPolicy(QWidget::StrongFocus);

  _isCollapsed = true;

  QVBoxLayout* vbox = new QVBoxLayout( this, 6, 6);

  _nameLabel = new KSqueezedTextLabel( this, "nameLabel" );
  _nameLabel->setText(i18n("(No profile data file loaded)"));
  vbox->addWidget( _nameLabel );

  _mainSplitter   = new QSplitter(Qt::Horizontal, this);
  _leftSplitter   = new Splitter(Qt::Vertical, _mainSplitter, "Left");
  vbox->addWidget( _mainSplitter );

  _rightTW = new TabWidget(this, _mainSplitter, "Right");
  connect(_rightTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_rightTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _topTW = new TabWidget(this, _leftSplitter, "Top");
  connect(_topTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_topTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _bottomSplitter = new Splitter(Qt::Horizontal,
                                  _leftSplitter, "Bottom");

  _leftTW = new TabWidget(this, _bottomSplitter, "Left");
  _leftTW->setTabPosition(QTabWidget::Bottom);
  connect(_leftTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_leftTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _bottomTW = new TabWidget(this, _bottomSplitter, "Bottom");
  _bottomTW->setTabPosition(QTabWidget::Bottom);
  connect(_bottomTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_bottomTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));


  // default positions...

  addTop( addTab( i18n("Types"),
		  new CostTypeView(this, _topTW,
				   "CostTypeView")));
  addTop( addTab( i18n("Callers"),
		  new CallView(true, this, _topTW,
			       "CallerView")));
  addTop( addTab( i18n("All Callers"),
		  new CoverageView(true, this, _topTW,
				   "AllCallerView")));
  addTop( addTab( i18n("Caller Map"),
		  new CallMapView(true, this, _bottomTW,
				  "CallerMapView")));
  addTop( addTab( i18n("Source"),
		  new SourceView(this, _topTW,
				 "SourceView")));

  addBottom( addTab( i18n("Parts"),
		     new PartView(this, _bottomTW,
				  "PartView")));
  addBottom( addTab( i18n("Call Graph"),
		     new CallGraphView(this, _bottomTW,
				       "CallGraphView")));
  addBottom( addTab( i18n("Callees"),
		     new CallView(false, this, _bottomTW,
				  "CalleeView")));
  addBottom( addTab( i18n("All Callees"),
		     new CoverageView(false, this, _bottomTW,
				      "AllCalleeView")));

  addBottom( addTab( i18n("Callee Map"),
		     new CallMapView(false, this, _topTW,
				     "CalleeMapView")));
  addBottom( addTab( i18n("Assembler"),
		     new InstrView(this, _bottomTW,
				   "InstrView")));

  // after all child widgets are created...
  _lastFocus = 0;
  _active = false;
  installFocusFilters();

  updateVisibility();

  QWhatsThis::add( this, whatsThis() );
}
Exemple #3
0
TabView::TabView(TraceItemView* parentView,
                 QWidget* parent, const char* name)
  : QWidget(parent), TraceItemView(parentView)
{
  setFocusPolicy(Qt::StrongFocus);
  setObjectName(name);

  _isCollapsed = true;

  QVBoxLayout* vbox = new QVBoxLayout( this );
  vbox->setSpacing( 6 );
  vbox->setMargin( 6 );

  _nameLabel = new QLabel(this); //KSqueezedTextLabel( this);
  _nameLabel->setSizePolicy(QSizePolicy( QSizePolicy::Ignored,
					 QSizePolicy::Fixed ));
  _nameLabel->setObjectName( "nameLabel" );
  _nameLabel->setText(tr("(No profile data file loaded)"));
  vbox->addWidget( _nameLabel );
  updateNameLabel(tr("(No profile data file loaded)"));

  _mainSplitter   = new QSplitter(Qt::Horizontal, this);
  _leftSplitter   = new Splitter(Qt::Vertical, _mainSplitter, "Left");
  vbox->addWidget( _mainSplitter );

  _rightTW = new TabWidget(this, _mainSplitter, "Right");
  connect(_rightTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_rightTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _topTW = new TabWidget(this, _leftSplitter, "Top");
  connect(_topTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_topTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _bottomSplitter = new Splitter(Qt::Horizontal,
                                  _leftSplitter, "Bottom");

  _leftTW = new TabWidget(this, _bottomSplitter, "Left");
  _leftTW->setTabPosition(QTabWidget::Bottom);
  connect(_leftTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_leftTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  _bottomTW = new TabWidget(this, _bottomSplitter, "Bottom");
  _bottomTW->setTabPosition(QTabWidget::Bottom);
  connect(_bottomTW, SIGNAL(currentChanged(QWidget*)),
          this, SLOT(tabChanged(QWidget*)));
  connect(_bottomTW, SIGNAL(visibleRectChanged(TabWidget*)),
          this, SLOT(visibleRectChangedSlot(TabWidget*)));

  CallView* callerView = new CallView(true, this);
  CallView* calleeView = new CallView(false, this);
  CoverageView * allCallerView = new CoverageView(true, this);
  CoverageView * allCalleeView = new CoverageView(false, this);

  // Options of visualization views are stored by their view name
  callerView->setObjectName("CallerView");
  calleeView->setObjectName("CalleeView");
  allCallerView->setObjectName("AllCallerView");
  allCalleeView->setObjectName("AllCalleeView");

  // default positions...
  // Keep following order in sync with DEFAULT_xxxTABS defines!

  addTop( addTab( tr("Types"),
		  new EventTypeView(this, 0,
				   "EventTypeView")));
  addTop( addTab( tr("Callers"), callerView) );
  addTop( addTab( tr("All Callers"), allCallerView) );
  addTop( addTab( tr("Callee Map"),
		  new CallMapView(false, this, 0,
				  "CalleeMapView")));
  addTop( addTab( tr("Source Code"),
		  new SourceView(this, 0,
				 "SourceView")));

  addBottom( addTab( tr("Parts"),
		     new PartView(this, 0,
				  "PartView")));
  addBottom( addTab( tr("Callees"), calleeView) );
  addBottom( addTab( tr("Call Graph"),
		     new CallGraphView(this, 0,
				       "CallGraphView")));
  addBottom( addTab( tr("All Callees"), allCalleeView) );
  addBottom( addTab( tr("Caller Map"),
		     new CallMapView(true, this, 0,
				     "CallerMapView")));
  addBottom( addTab( tr("Machine Code"),
		     new InstrView(this, 0,
				   "InstrView")));

  // after all child widgets are created...
  _lastFocus = 0;
  _active = false;
  installFocusFilters();

  updateVisibility();

  this->setWhatsThis( whatsThis() );
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
	//////////////////////////////
	// 1. super init first
	if ( !CCLayer::init() )
	{
		return false;
	}
	mbirdstr.push_back("birdblue");
	mbirdstr.push_back("birdred");
	mbirdstr.push_back("birdyellow");
	mbirdclolor=rand()%100%3;
//	EFFECT_PLAY(true,MUSIC_SWOOSHING);
	//播放背景音乐
	// CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic(MUSIC_JUMP, true);
	////////////////////////////////////////////////////
	// 下面添加创建自己的Sprite的代码
	////////////////////////////////////////////////////

	mScreenSize = CCDirector::sharedDirector()->getWinSize();
	mFPS=CCDirector::sharedDirector()->getAnimationInterval();


	mfac=CCDirector::sharedDirector()->getContentScaleFactor();
	mfax = 320.f/mScreenSize.width;
	//gBardis = 5.f*gUpVelocity/mfac;
	gBardis = mScreenSize.height*2.f/9.0f-5;
	//m_addbartime=mScreenSize.width*mFPS*mfax*1.f/2.f/MOVESPEED-10;
	//m_addbartime=3;
	initWorld();	
	for (int i = 0; i<GBACKGROUNDNUM; i++)
	{
		addBackGround(i);
	}
	int imaxgroundnum=1;
	for (int i = 0; i<imaxgroundnum; i++)
	{
		imaxgroundnum=addGround(i);
	}
	m_ilastground=imaxgroundnum-1;
	CCLOG("m_pLastGround->boundingBox() first x:%f,:%f  ", (m_pGroundVec[m_ilastground])->boundingBox().getMaxX(),
		(m_pGroundVec[m_ilastground])->boundingBox().size.width);
	addStart();
	addTop();
	//addRate();
	//addFlappyBird();

	addBird();
	addScore();
	addGameOver();

	m_pScore->setVisible(false);
	m_pGameOver->setVisible(false);
	this->goReady();
	addBarContainer();

	setTouchEnabled(true);
	myflag=0;
	m_istatus=GETREADY;
	m_bhitbar=false;
	//scheduleOnce(schedule_selector(HelloWorld::startGame), 1);
	this->scheduleUpdate();
	//创建动画
	initAction();
	myangle=0.f;
	return true;
}