本文整理匯總了C++中AddLayer函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddLayer函數的具體用法?C++ AddLayer怎麽用?C++ AddLayer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddLayer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
}
示例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;
}
示例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;
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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 ) );
}
示例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();
}
示例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);
}
示例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();
}
示例14: Dispose_Layer2D
void Dispose_Layer2D()
{
// Altseedを初期化する。
asd::Engine::Initialize(asd::ToAString("SceneAndLayer_Basic").c_str(), 640, 480, asd::EngineOption());
// 畫像を読み込む。
auto texture = asd::Engine::GetGraphics()->CreateTexture2D(asd::ToAString("Data/Texture/Picture1.png").c_str());
// シーンクラスのインスタンスを生成する。
auto scene = std::make_shared<asd::Scene>();
// カスタマイズしたレイヤーのインスタンスを生成する。
auto layer = std::make_shared<Dispose_Layer2D_Dispose_MessageLayer>();
// カスタマイズしたオブジェクトのインスタンスを生成する。
auto obj = std::make_shared<Dispose_Layer2D_Dispose_MessageObject>();
// オブジェクトの位置とテクスチャを設定する。
obj->SetPosition(asd::Vector2DF(50, 50));
obj->SetTexture(texture);
// 描畫するシーンを指定する。
asd::Engine::ChangeScene(scene);
// 描畫するレイヤーをシーンに追加する。
scene->AddLayer(layer);
// 描畫するオブジェクトをレイヤーに追加する。
layer->AddObject(obj);
// フレーム數を數えるための変數。
int count = 0;
// Altseedのウインドウが閉じられていないか確認する。
while (asd::Engine::DoEvents())
{
// Altseedを更新する。
asd::Engine::Update();
// フレームを數える。
++count;
// 10フレーム目になったら
if (count == 10)
{
printf("レイヤーを破棄します\n");
// レイヤーを破棄する。
layer->Dispose();
}
}
// Altseedを終了する。
asd::Engine::Terminate();
}
示例15: CreateStatusLayer
StatusLayerData* CreateStatusLayer(Layer *relativeLayer, LayerRelation relation) {
StatusLayerData *data = malloc(sizeof(StatusLayerData));
if (data != NULL) {
memset(data, 0, sizeof(StatusLayerData));
data->textLayerBattery = text_layer_create(GRect(107, 0, 36, 34));
text_layer_set_font(data->textLayerBattery, fonts_get_system_font(FONT_KEY_GOTHIC_14));
text_layer_set_text_alignment(data->textLayerBattery, GTextAlignmentRight);
text_layer_set_background_color(data->textLayerBattery, GColorClear);
AddLayer(relativeLayer, (Layer*) data->textLayerBattery, relation);
data->textLayerBluetooth = text_layer_create(GRect(10, 0, 96, 34));
text_layer_set_font(data->textLayerBluetooth, fonts_get_system_font(FONT_KEY_GOTHIC_14));
text_layer_set_text_alignment(data->textLayerBluetooth, GTextAlignmentLeft);
text_layer_set_background_color(data->textLayerBluetooth, GColorClear);
AddLayer(relativeLayer, (Layer*) data->textLayerBluetooth, relation);
}
return data;
}