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); } }
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; }
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; }
/* ================== 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"); }
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); }
/* * FillResources() */ bool OGRNGWDataset::FillResources( char **papszOptions, int nOpenFlagsIn ) { CPLJSONDocument oResourceDetailsReq; bool bResult = oResourceDetailsReq.LoadUrl( NGWAPI::GetChildren( osUrl, osResourceId ), papszOptions ); if( bResult ) { CPLJSONArray oChildren(oResourceDetailsReq.GetRoot()); for( int i = 0; i < oChildren.Size(); ++i ) { CPLJSONObject oChild = oChildren[i]; std::string osResourceType = oChild.GetString("resource/cls"); if( (osResourceType == "vector_layer" || osResourceType == "postgis_layer") ) { // Add vector layer. If failed, try next layer. AddLayer( oChild, papszOptions, nOpenFlagsIn ); } else if( (osResourceType == "raster_layer" || osResourceType == "wmsclient_layer") && nOpenFlagsIn & GDAL_OF_RASTER ) { AddRaster( oChild, papszOptions ); } // TODO: Add support for baselayers, webmap, wfsserver_service, wmsserver_service. } } return bResult; }
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); }
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); }
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); }
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); } }
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 ) ); }
void ParticleEmitter::AddLayer(ParticleLayer * layer, ParticleLayer * layerToMoveAbove) { AddLayer(layer); if (layerToMoveAbove) { MoveLayer(layer, layerToMoveAbove); } }
void ParticleEmitter::LoadParticleLayerFromYaml(YamlNode* yamlNode, bool isLong) { ParticleLayer* layer = new ParticleLayer(); AddLayer(layer); layer->LoadFromYaml(configPath, yamlNode); SafeRelease(layer); }
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(); }
void ParticleEmitter3D::LoadParticleLayerFromYaml(const YamlNode* yamlNode, bool isLong) { ParticleLayer3D* layer = new ParticleLayer3D(this); layer->SetLong(isLong); AddLayer(layer); layer->LoadFromYaml(configPath, yamlNode); SafeRelease(layer); }
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(); }
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(); }
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; }
void wxGxMapView::OnSelectionChanged(IGxSelection* Selection, long nInitiator) { if(nInitiator == GetId()) return; GxObjectArray* pGxObjectArray = m_pSelection->GetSelectedObjects(); if(pGxObjectArray == NULL || pGxObjectArray->size() == 0) return; IGxObject* pGxObj = pGxObjectArray->at(pGxObjectArray->size() - 1); if(m_pParentGxObject == pGxObj) return; IGxDataset* pGxDataset = dynamic_cast<IGxDataset*>(pGxObj); if(pGxDataset == NULL) return; wxGISDataset* pwxGISDataset = pGxDataset->GetDataset(); if(pwxGISDataset == NULL) return; wxGISEnumDatasetType type = pwxGISDataset->GetType(); wxGISLayer* pwxGISLayer = NULL; switch(type) { case enumGISFeatureDataset: pwxGISLayer = new wxGISFeatureLayer(pwxGISDataset); break; case enumGISRasterDataset: pwxGISLayer = new wxGISRasterLayer(pwxGISDataset); break; default: break; } if(pwxGISLayer) pwxGISLayer->SetName(pGxObj->GetName()); //the pOGRLayer will live while IGxObject live. IGxObject( from IGxSelection ) store IwxGISDataset, and destroy it then catalog destroyed wsDELETE(pwxGISDataset); //OGRLayer* pOGRLayer = pwxGISDataset->GetDataset(); //if(pOGRLayer == NULL) //{ // return; //} ClearLayers(); if(pwxGISLayer && pwxGISLayer->IsValid()) AddLayer(pwxGISLayer);//m_GISMap. m_pParentGxObject = pGxObj; wxGISMapView::Refresh(); }
SimpleScene::SimpleScene() { _camera = new SimpleCamera2D(); //Create a default layer at z = 0 auto layer = new SimpleLayer(); layer->SetZ(0); AddLayer(layer); //Initialize spatial query auxiliaries _queryResults.reserve(_maxQueryResults); }
void FLayerManager::Startup() { if (!bInitialized) { FHMDLayerManager::Startup(); auto EyeLayer = AddLayer(FHMDLayerDesc::Eye, INT_MIN, Layer_UnknownOrigin, EyeLayerId); check(EyeLayer.IsValid()); bInitialized = true; bTextureSetsAreInvalid = true; } }
void MapControl::addPolylineLayer(Layer *layer) { PaintSchemePolyline *schemeCustom = new PaintSchemePolyline(QPen(qRgb(255,128,0)),QBrush(Qt::yellow),5); layer->AddScheme(schemeCustom); LabelScheme *labelScheme = new LabelScheme("name",QFont("Tahoma",9),QPen(Qt::magenta)); layer->AddLabelScheme(labelScheme); AddLayer(layer); view->GetTranslator()->updateSize(); DrawItemLine(itemLine); for(QList<MapGraphicsLineItem*>::iterator it = itemLine->begin(); it != itemLine->end(); it++){ scene->addItem((*it)); } }
void ParticleEmitter3D::LoadParticleLayerFromYaml(YamlNode* yamlNode, bool isLong) { ParticleLayer* layer = NULL; if (isLong) { layer = new ParticleLayerLong(); } else { layer = new ParticleLayer3D(); } AddLayer(layer); layer->LoadFromYaml(configPath, yamlNode); SafeRelease(layer); }
void TW_CALL MaterialDialog::LoadGradient(void *clientData) { MaterialDialog* dialog = (MaterialDialog*)clientData; AglMaterial* mat = dialog->m_material; string file = openfilename(); if (file != "") { mat->gradientTextureNameIndex = Scene::GetInstance()->AddName(file); TextureManager::GetInstance()->LoadTexture(file); } if (mat->gradientDataIndex < 0) { AddLayer(dialog); } }
void FGXImage::Flatten(FGXImage &undo) { CWaitCursor wait; Swap(undo); width = undo.width; height = undo.height; res = undo.res; unit = undo.unit; FGXLayer *layer = new FGXLayer(CRect(0, 0, width, height)); undo.Render(*layer, layer->GetPosition(), true); layer->SetName(TEXT("Flattened Image")); layer->Compact(); AddLayer(layer); }
// loadfile version to support formatManager gstStatus gstTEXFormat::OpenFile() { texture_ = theTextureManager->NewTextureFromPath(name(), &is_mercator_imagery_); if (!texture_) { return GST_OPEN_FAIL; } else { theTextureManager->AddOverlayTexture(texture_); } // build bounding box geometry extents_ = texture_->bbox(); AddLayer(gstPolyLine, 1, gstHeaderImpl::Create()); return GST_OKAY; }
void MapControl::addPolygonLayer(Layer *layer) { PaintSchemePolygon *schemeCustom = new PaintSchemePolygon(); layer->AddScheme(schemeCustom); LabelScheme * labelScheme = new LabelScheme("name",QFont("Tahoma",9),QPen(Qt::darkGreen)); layer->AddLabelScheme(labelScheme); AddLayer(layer); view->GetTranslator()->updateSize(); DrawItemRegion(itemRegion); //view->DrawLabel(&itemLabel); for(QList<MapGraphicsPolygonItem*>::iterator it = itemRegion->begin(); it != itemRegion->end(); it++){ scene->addItem((*it)); } option = new MapOption(view, view->getVariableView()); }
bool SimpleScene::Deserialize(const json &node, std::string dir) { //No camera deserialization for now if (node.find("layers") == node.end()) { SIMPLE_LOG("Couldn't deserialize layers"); return false; } for (auto l : node["layers"]) { SimpleLayer* layer = new SimpleLayer(); if (!layer->Deserialize(l)) return false; AddLayer(layer); } return true; }
void OnUpdating() { if (GetTime() % 9 == 0) { auto texture = asd::Engine::GetGraphics()->CreateTexture2D(asd::ToAString("Data/Texture/Sample1.png").c_str()); auto obj = std::make_shared<asd::TextureObject2D>(); obj->SetTexture(texture); auto scene = std::make_shared<asd::Scene>(); auto layer = std::make_shared<asd::Layer2D>(); layer->AddObject(obj); scene->AddLayer(layer); auto transition = std::make_shared<asd::TransitionFade>(3.0f/60.0f, 3.0f/60.0f); asd::Engine::ChangeSceneWithTransition(scene, transition); } }
/* ================== DemoScene::ButtonReleased ================== */ void DemoScene::ButtonReleased(Pim::Button *button) { if (button == hud->buttonNext) { layerIdx++; if (layerIdx > IDX_MAX) { layerIdx = IDX_MIN; } } else if (button == hud->buttonPrev) { layerIdx--; if (layerIdx < IDX_MIN) { layerIdx = IDX_MAX; } } RemoveLayer(layer); switch (layerIdx) { case 0: layer = new WelcomeLayer; break; case 1: layer = new SoundLayer; break; case 2: layer = new LightLayer; break; case 3: layer = new ActionLayer; break; case 4: layer = new ParticleLayer; break; } AddLayer(layer); }