您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddLayer函数代码示例

51自学网 2021-06-01 19:41:06
  C++
这篇教程C++ AddLayer函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AddLayer函数的典型用法代码示例。如果您正苦于以下问题:C++ AddLayer函数的具体用法?C++ AddLayer怎么用?C++ AddLayer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AddLayer函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: createLayer

void LDSceneMainTest::init(void){   //create layers   LDLayer* bgLayer = createLayer(LAYER_BACKGROUND);   AddLayer(bgLayer);   CoSize bgSize = static_cast<LDLayerBackGround*>(bgLayer)->GetBGSize();   SetSceneBorder(0, 0, bgSize.width, bgSize.height);      LDLayer* masterLayer = createLayer(LAYER_MASTER);   AddLayer(masterLayer);   LDSubtitleSys* subtitleSys = LDSubtitleSys::Singleton();   assert(subtitleSys);   AddLayer( subtitleSys->GetHostLayer() );      if(masterLayer) {      //create role me      _me = LDRoleMe::GetOrCreateMe();      _me->BindScene(this);      CoSize winSize = CoDirer->getWinSize();      const float ground = winSize.height/4;      const float leftside = winSize.width/10;      CoPoint startPos = CoPoint(leftside, ground);      _me->GetCoSprite()->setPosition(startPos);      masterLayer->AddSprite(_me);            TestCase::TestSubtitleNLiteral();      LDLevelImporter levelImporter;      levelImporter.Import("lv1.lua", masterLayer, bgLayer);   }}
开发者ID:jay7n,项目名称:LDWild,代码行数:32,


示例2: OGRILI1Layer

int ILI1Reader::ReadModel(ImdReader *poImdReader, const char *pszModelFilename, OGRILI1DataSource *poDS) {  poImdReader->ReadModel(pszModelFilename);  for (FeatureDefnInfos::const_iterator it = poImdReader->featureDefnInfos.begin(); it != poImdReader->featureDefnInfos.end(); ++it)  {    //CPLDebug( "OGR_ILI", "Adding OGRILI1Layer with table '%s'", it->poTableDefn->GetName() );    OGRILI1Layer* layer = new OGRILI1Layer(it->poTableDefn, it->poGeomFieldInfos, poDS);    AddLayer(layer);    //Create additional layers for surface and area geometries    for (GeomFieldInfos::const_iterator it2 = it->poGeomFieldInfos.begin(); it2 != it->poGeomFieldInfos.end(); ++it2)    {      if (it2->second.geomTable)      {        OGRFeatureDefn* poGeomTableDefn = it2->second.geomTable;        OGRGeomFieldDefn* poOGRGeomFieldDefn = poGeomTableDefn->GetGeomFieldDefn(0);        GeomFieldInfos oGeomFieldInfos;        // We add iliGeomType to recognize Ili1 geom tables        oGeomFieldInfos[poOGRGeomFieldDefn->GetNameRef()].iliGeomType = it2->second.iliGeomType;        //CPLDebug( "OGR_ILI", "Adding OGRILI1Layer with geometry table '%s'", it2->second.geomTable->GetName() );        OGRILI1Layer* geomlayer = new OGRILI1Layer(poGeomTableDefn, oGeomFieldInfos, poDS);        AddLayer(geomlayer);      }    }  }  codeBlank = poImdReader->codeBlank;  CPLDebug( "OGR_ILI", "Ili1Format blankCode '%c'", poImdReader->codeBlank );  codeUndefined = poImdReader->codeUndefined;  CPLDebug( "OGR_ILI", "Ili1Format undefinedCode '%c'", poImdReader->codeUndefined );  codeContinue = poImdReader->codeContinue;  CPLDebug( "OGR_ILI", "Ili1Format continueCode '%c'", poImdReader->codeContinue );  return 0;}
开发者ID:drownedout,项目名称:datamap,代码行数:33,


示例3: AddLayer

KVDetector *KVGeoImport::BuildDetector(TString det_name, TGeoVolume* det_vol){    // Create a KVDetector with given name for the given volume    //    // Detector definition in geometry    // ===============================    // 1.) All detector volumes & nodes must have names which begin with "DET_"    //    // 2.) They must be made of materials which are known by the range table fRangeTable.    //    // 3.) For multi-layer detectors, the "active" layer volume/node must have a name beginning with "ACTIVE_"    //    // 4.) The "thickness" of the detector or any layer inside a multilayer detector    //     will be taken as the size of the volume's shape along its Z-axis    //     (so make sure that you define your detector volumes in this way).    //    // 5.) It is assumed that the natural length units of the geometry are centimetres.    //    // 6.) The name of the KVDetector object created and added to the array will be taken    //     from the unique full path of the node corresponding to the geometrical positioning    //     of the detector, see KVGeoNavigator::ExtractDetectorNameFromPath    //    // 7.) The 'type' of the detector will be set to the name of the material    //     in the detector's active layer i.e. if active layer material name is "Si",    //     detector type will be 'Si'    //     // 8.) Default class for all detectors is KVDetector    //     if you want to use an other class    //     you need to defined it using SetDetectorPlugin method and put the    //	  associated line in your .kvrootrc configuration file. This plugin    //	  has to be loaded by your KVMultiDetArray object   KVDetector* d = 0;   TPluginHandler *ph=NULL;   if ( fDetectorPlugin=="" || !(ph = LoadPlugin("KVDetector",fDetectorPlugin)) ){   	d = new KVDetector;   }   else{   	d = (KVDetector* )ph->ExecPlugin(0);   }   	d->SetName(det_name);    Int_t nlayer = det_vol->GetNdaughters();    if(nlayer){        for(int i=0;i<nlayer;i++){            AddLayer(d, det_vol->GetNode(i)->GetVolume());        }    }    else        AddLayer(d, det_vol);    TString type = d->GetActiveLayer()->GetName();    //type.ToUpper();    d->SetType( type );    return d;}
开发者ID:pwigg,项目名称:kaliveda,代码行数:57,


示例4: AddLayer

/*==================DemoScene::LoadResources==================*/void DemoScene::LoadResources(){	layerIdx = 0;	hud = new HUDLayer;	AddLayer(hud);	hud->SetZOrder(-2);	color = Pim::Color(1.f, 1.f, 1.f, 1.f);	layer = new WelcomeLayer;	AddLayer(layer);	ListenCommand("demoscene");}
开发者ID:DerMinze,项目名称:Pim,代码行数:20,


示例5: Close

void CEMSocket::InitProxySupport(){//	Destroy all proxy layers (done inside Close())	Close();//	Proxy initialization	const ProxySettings	&settings = g_App.m_pPrefs->GetProxySettings();	m_bProxyConnectFailed = false;	if (settings.m_bUseProxy && settings.m_nType != PROXYTYPE_NOPROXY)	{		m_pProxyLayer = new CAsyncProxySocketLayer;		switch (settings.m_nType)		{			case PROXYTYPE_SOCKS4:			case PROXYTYPE_SOCKS4A:				m_pProxyLayer->SetProxy(settings.m_nType, settings.m_strName, settings.m_uPort);				break;			case PROXYTYPE_SOCKS5:			case PROXYTYPE_HTTP11:				if (settings.m_bEnablePassword)					m_pProxyLayer->SetProxy(settings.m_nType, settings.m_strName, settings.m_uPort, settings.m_strUser, settings.m_strPassword);				else					m_pProxyLayer->SetProxy(settings.m_nType, settings.m_strName, settings.m_uPort);				break;			default:				ASSERT(0);		}		AddLayer(m_pProxyLayer);	}//	Connection Initialization	Create(0, SOCK_STREAM, FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE, g_App.m_pPrefs->GetBindAddrA());	AsyncSelect(FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE);}
开发者ID:rusingineer,项目名称:EmulePlus,代码行数:35,


示例6: switch

BOOL CIrcSocket::Create(UINT nSocketPort, int nSocketType, long lEvent, LPCTSTR lpszSocketAddress){	const ProxySettings& proxy = thePrefs.GetProxy();	if (proxy.UseProxy && proxy.type != PROXYTYPE_NOPROXY)	{		m_pProxyLayer = new CAsyncProxySocketLayer;		switch (proxy.type)		{			case PROXYTYPE_SOCKS4:				m_pProxyLayer->SetProxy(PROXYTYPE_SOCKS4, proxy.name, proxy.port);				break;			case PROXYTYPE_SOCKS4A:				m_pProxyLayer->SetProxy(PROXYTYPE_SOCKS4A, proxy.name, proxy.port);				break;			case PROXYTYPE_SOCKS5:				if (proxy.EnablePassword)					m_pProxyLayer->SetProxy(PROXYTYPE_SOCKS5, proxy.name, proxy.port, proxy.user, proxy.password);				else					m_pProxyLayer->SetProxy(PROXYTYPE_SOCKS5, proxy.name, proxy.port);				break;			case PROXYTYPE_HTTP11:				if (proxy.EnablePassword)					m_pProxyLayer->SetProxy(PROXYTYPE_HTTP11, proxy.name, proxy.port, proxy.user, proxy.password);				else					m_pProxyLayer->SetProxy(PROXYTYPE_HTTP11, proxy.name, proxy.port);				break;			default:				ASSERT(0);		}		AddLayer(m_pProxyLayer);	}	return CAsyncSocketEx::Create(nSocketPort, nSocketType, lEvent, lpszSocketAddress);}
开发者ID:machado2,项目名称:emule,代码行数:34,


示例7: AddLayer

void GuiManager::SetDefaults(){	m_LayerManager.RemoveAllLayers();	std::string path = UserPromptUtil::GetExecutablePath();	path.append(DEFAULT_FILENAME);	if(FileExists(path.c_str()))	{		//try to get XML - if success, get outa here		if(LoadFromXmlWithErrors(path) == XML_SUCCESS)			return;	}	//we failed.	m_LayerManager.RemoveAllLayers();	Generator* newlayer = RenderableFactory::CreateGenerator(4);	SubGenerator* noise1 = RenderableFactory::CreateLayer2d(0);	SubGenerator* noise2 = RenderableFactory::CreateLayer2d(0);	noise1->Scale(0.01f, 0.01f);	noise2->Scale(-5, -5);	newlayer->AssignLayerToVariable(0, noise1);	newlayer->AssignLayerToVariable(1, noise2);	m_World.SetWindowSize(14);	m_World.ResetCameras();	m_World.SetVisualMode(VISUAL_TOPDOWN);	AddLayer(newlayer);}
开发者ID:elib,项目名称:megastrata,代码行数:31,


示例8: CloseHandle

void CTransferSocket::OnConnect(int nErrorCode){    if (nErrorCode)    {        if (m_hFile!=INVALID_HANDLE_VALUE)        {            CloseHandle(m_hFile);            m_hFile = INVALID_HANDLE_VALUE;        }        Close();        if (!m_bSentClose)        {            m_bSentClose = TRUE;            m_status = 2;            m_pOwner->m_pOwner->PostThreadMessage(WM_FILEZILLA_THREADMSG, FTM_TRANSFERMSG, m_pOwner->m_userid);        }        return;    }#ifndef NOLAYERS    if (m_pGssLayer)        VERIFY(AddLayer(m_pGssLayer));#endif    if (!m_bStarted)        InitTransfer(FALSE);    CAsyncSocketEx::OnConnect(nErrorCode);}
开发者ID:sd-eblana,项目名称:bawx,代码行数:29,


示例9: Close

void CEMSocket::InitProxySupport(){    m_bProxyConnectFailed = false;    // ProxyInitialisation    const ProxySettings& settings = thePrefs.GetProxySettings();    if (settings.UseProxy && settings.type != PROXYTYPE_NOPROXY)    {        Close();        m_pProxyLayer = new CAsyncProxySocketLayer;        switch (settings.type)        {        case PROXYTYPE_SOCKS4:        case PROXYTYPE_SOCKS4A:            m_pProxyLayer->SetProxy(settings.type, settings.name, settings.port);            break;        case PROXYTYPE_SOCKS5:        case PROXYTYPE_HTTP10:        case PROXYTYPE_HTTP11:            if (settings.EnablePassword)                m_pProxyLayer->SetProxy(settings.type, settings.name, settings.port, settings.user, settings.password);            else                m_pProxyLayer->SetProxy(settings.type, settings.name, settings.port);            break;        default:            ASSERT(0);        }        AddLayer(m_pProxyLayer);        // Connection Initialisation        Create(0, SOCK_STREAM, FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE, thePrefs.GetBindAddrA());        AsyncSelect(FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE);    }}
开发者ID:techpub,项目名称:archive-code,代码行数:35,


示例10: GetTrace

void SIM_PLOT_PANEL::EnableCursor( const wxString& aName, bool aEnable ){    TRACE* t = GetTrace( aName );    if( t == nullptr || t->HasCursor() == aEnable )        return;    if( aEnable )    {        CURSOR* c = new CURSOR( t );        int plotCenter = GetMarginLeft() + ( GetXScreen() - GetMarginLeft() - GetMarginRight() ) / 2;        c->SetX( plotCenter );        t->SetCursor( c );        AddLayer( c );    }    else    {        CURSOR* c = t->GetCursor();        t->SetCursor( NULL );        DelLayer( c, true );    }    // Notify the parent window about the changes    wxQueueEvent( GetParent(), new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );}
开发者ID:miloh,项目名称:kicad-source-mirror,代码行数:25,


示例11: TwDeleteBar

void MaterialDialog::setMaterial(int pIndex){	if (m_dialog)		TwDeleteBar(m_dialog);	// Create a tweak bar	m_dialog = TwNewBar("Material");	int barSize[2] = {200, 1060};	TwDefine(" Material position='1710 10'  ");	TwSetParam(m_dialog, NULL, "size", TW_PARAM_INT32, 2, barSize);	m_material = Scene::GetInstance()->GetMaterial(pIndex);	TwAddVarCB(m_dialog, "MaterialName", TW_TYPE_CDSTRING, SetName, GetName, (void*)this, " label='Name: '");	TwAddVarRW(m_dialog, "Ambient", TW_TYPE_COLOR3F, (void*)&m_material->ambient, " help='Light color.' group='Properties'");	TwAddVarRW(m_dialog, "Diffuse", TW_TYPE_COLOR3F, (void*)&m_material->diffuse, " help='Light color.' group='Properties'");	TwAddVarRW(m_dialog, "Specular", TW_TYPE_COLOR3F, (void*)&m_material->specular, " help='Light color.' group='Properties'");	TwAddVarRW(m_dialog, "Emissive", TW_TYPE_COLOR3F, (void*)&m_material->emissive, " help='Light color.' group='Properties'");	TwAddVarRW(m_dialog, "Opacity", TW_TYPE_FLOAT, (void*)&m_material->opacity, " help='Light color.' group='Properties' min=0.0 max=1.0 step=0.01");	TwAddVarRW(m_dialog, "Reflectivity", TW_TYPE_FLOAT, (void*)&m_material->reflectivity, " help='Light color.' group='Properties' min=0.0 max=1.0 step=0.01");	TwAddVarRW(m_dialog, "Shininess", TW_TYPE_FLOAT, (void*)&m_material->shininess, " help='Light color.' group='Properties' min=0.0 max=100.0 step=1.0");	TwAddVarRW(m_dialog, "Texture Scale", TW_TYPE_FLOAT, (void*)&m_material->textureScale, " help='Light color.' group='Properties' min=0.0 max=10.0 step=0.01");	TwAddButton(m_dialog, "Load Diffuse Texture", LoadDiffuse, this, " label='Diffuse Texture' key=c help='Load an Agile file into the editor.' group='Load'");	TwAddButton(m_dialog, "Load Specular Texture", LoadSpecular, this, " label='Specular Texture' key=c help='Load an Agile file into the editor.' group='Load'");	TwAddButton(m_dialog, "Load Glow Texture", LoadGlow, this, " label='Glow Texture' key=c help='Load an Agile file into the editor.' group='Load'");	TwAddButton(m_dialog, "Load Normal Texture", LoadNormal, this, " label='Normal Texture' key=c help='Load an Agile file into the editor.' group='Load'");	TwAddButton(m_dialog, "Load Displacement Texture", LoadDisplacement, this, " label='Displacement Texture' key=c help='Load an Agile file into the editor.' group='Load'");	TwAddButton(m_dialog, "Load Gradient Texture", LoadGradient, this, " label='Gradient Texture' key=c help='Load an Agile file into the editor.' group='Load'");	TwStructMember tessMembers[] = { 		{ "Edge1", TW_TYPE_FLOAT, offsetof(AglVector4, x), " Step=0.1 min=1.0 max=64.0" },		{ "Edge2", TW_TYPE_FLOAT, offsetof(AglVector4, y), " Step=0.1 min=1.0 max=64.0" },		{ "Edge3", TW_TYPE_FLOAT, offsetof(AglVector4, z), " Step=0.1 min=1.0 max=64.0" },		{ "Internal", TW_TYPE_FLOAT, offsetof(AglVector4, w), " Step=0.1 min=1.0 max=64.0" }};	TwType tessType = TwDefineStruct("TESSELATIONFACTORS", tessMembers, 4, sizeof(AglVector4), NULL, NULL);	TwAddVarRW(m_dialog, "Tess", tessType, &m_material->tesselationFactor, " group='Properties' ");	TwAddVarRW(m_dialog, "Displacement", TW_TYPE_FLOAT, (void*)&m_material->displacement, " group='Properties' min=0.0 max=10.0 step=0.01");	TwAddButton(m_dialog, "Add Layer", AddLayer, this, " label='Add Layer' key=c help='Load an Agile file into the editor.' group='Gradient Mapping'");	TwAddButton(m_dialog, "Delete", Delete, this, "");	if (m_material->gradientDataIndex >= 0)	{		AglGradient* g = Scene::GetInstance()->GetGradient(m_material->gradientDataIndex);		vector<AglGradientMaterial*> layers = g->getLayers();		for (unsigned int i = 0; i < layers.size(); i++)		{			AddLayer(g, layers[i], i);		}	}	show();}
开发者ID:MattiasLiljeson,项目名称:Amalgamation,代码行数:58,


示例12: ParticleLayer3D

void ParticleEmitter3D::LoadParticleLayerFromYaml(const YamlNode* yamlNode, bool isLong){	ParticleLayer3D* layer = new ParticleLayer3D(this);	layer->SetLong(isLong);	AddLayer(layer);	layer->LoadFromYaml(configPath, yamlNode);	SafeRelease(layer);}
开发者ID:droidenko,项目名称:dava.framework,代码行数:9,


示例13: OverlayStack

GalaxyMap::GalaxyMap(Context *context):	OverlayStack(context),	m_baseImage(nullptr),	m_labelOverlay(nullptr),	m_zoom(1.0f),	m_displayScale(0.0f),	m_centreSector(0.0f, 0.0f){	m_baseImage = context->Image(		std::string(GALAXY_IMAGE_FILE),		UI::Widget::EXPAND_WIDTH | UI::Widget::EXPAND_HEIGHT);	m_baseImage->SetPreserveAspect(true);	AddLayer(m_baseImage);	m_labelOverlay = new GameUI::LabelOverlay(context);	AddLayer(m_labelOverlay);	GetContext()->RequestLayout();}
开发者ID:Philbywhizz,项目名称:pioneer,代码行数:19,


示例14: Dispose_Layer2D

void Dispose_Layer2D(){	// Altseedを初期化する。	asd::Engine::Initialize(asd::ToAString("SceneAndLayer_Basic").c_str(), 640, 480, asd::EngineOption());	// 画像を
C++ AddList函数代码示例
C++ AddLabel函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。