Пример #1
0
/** void lui::View::setParent(View *parent=NULL)
 * include/lui/View.h:83
 */
static int View_setParent(lua_State *L) {
  try {
    View *self = *((View **)dub::checksdata(L, 1, "lui.View"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      View *parent = *((View **)dub::checksdata(L, 2, "lui.View"));
      self->setParent(parent);
      return 0;
    } else {
      self->setParent();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setParent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setParent: Unknown exception");
  }
  return dub::error(L);
}
Пример #2
0
void ViewBody::clearChildren()
{
	// Mustn't use a for loop as the iterator will become invalid as the child removes
	// itself from it in the setParent call.
	while (m_children.size())
	{
		// The child must stay valid for the duration of the call...
		View c = *m_children.begin();
		c->setParent(nullptr);
	}
}
Пример #3
0
View lb::operator|(View const& _a, View const& _b)
{
	if (!!_a->children().size() == !!_b->children().size())
	{
		View ret = FrameBody::create();
		_a->setParent(ret);
		_b->setParent(ret);
		return ret;
	}
	else if (_a->children().size())
	{
		_b->setParent(_a);
		return _a;
	}
	else
	{
		_a->setParent(_b);
		return _b;
	}
}
Пример #4
0
void ViewGroup::AddView(const char* viewName, int x,int y, int w, int h, const char* imageName){
	
    SE_SpatialID spatialID = SE_ID::createSpatialID();
    View* geometry = new View(spatialID,this);
	addChild(geometry);
	geometry->setParent(this);

	mViewMap[std::string(viewName)] = geometry;

    ViewData* simObj = new ViewData(geometry);
    simObj->setName(viewName);
	simObj->Init(0,0,w,h,imageName);
	//mViewList.push_back(simObj);
    geometry->SetViewdata(simObj);
    geometry->setPosition(x,y);
	
    geometry->setMovable(false);
    geometry->setCollisionable(false);
    geometry->updateWorldTransform();
    geometry->setBVType(1);
    geometry->updateBoundingVolume();

    SE_DepthTestState* rds = new SE_DepthTestState();
	rds->setDepthTestProperty(SE_DepthTestState::DEPTHTEST_DISABLE);
	geometry->setRenderState(DEPTHTESTSTATE, rds);
	geometry->updateRenderState();

    SE_BlendState *rs = new SE_BlendState();
    rs->setBlendProperty(SE_BlendState::BLEND_ENABLE);
    geometry->setRenderState(BLENDSTATE,rs);
    //geometry->setLocalLayer(2);
    //geometry->updateRenderState();
    geometry->updateWorldLayer(); 
    geometry->updateRenderState();
 
    //geometry->updateWorldLayer();
    geometry->setAlpha(1);
    geometry->setVisible(true);
    
}
Пример #5
0
View* MindSondeApp::setActiveView(View* argView, bool ignorePrev) {

	if(argView == this->activeView) return NULL;

	View* prevView = mainWindow->replaceTopView(argView);
	AcquisitionCentral* acqCentral = AcquisitionCentral::Instance();
	
	connect(acqCentral, SIGNAL(newDataAvailable(ChannelData*)), argView, SLOT(handleNewData(ChannelData*)));
	acqCentral->subscribe();
	
	this->activeView = argView;

	if(!ignorePrev) {
		
		prevView->setParent(0);
		disconnect(acqCentral, SIGNAL(newDataAvailable(ChannelData*)), prevView, SLOT(handleNewData(ChannelData*)));
		acqCentral->unsubscribe();
	}
	
	return prevView;
	
}
Пример #6
0
void ViewAreaImpl::clearAllPanesSub(QSplitter* splitter)
{
    for(int i=0; i < splitter->count(); ++i){
        QSplitter* childSplitter = dynamic_cast<QSplitter*>(splitter->widget(i));
        if(childSplitter){
            clearAllPanesSub(childSplitter);
        } else {
            ViewPane* pane = dynamic_cast<ViewPane*>(splitter->widget(i));
            if(pane){
                while(pane->count() > 0){
                    int index = pane->count() - 1;
                    View* view = pane->view(index);
                    if(view){
                        pane->removeView(view);
                        view->hide();
                        view->setParent(0);
                        view->viewArea_ = 0;
                    }
                }
            }
        }
    }
}