AnimationController* AnimationControllerFactory::createFromFile(const FileName &fileName) { AnimationController *model = 0; MAP::iterator i = loader.find(fileName.getExtension()); if(i == loader.end()) { return createDefault(); } shared_ptr<ModelLoader> modelLoader = i->second; ASSERT(modelLoader, "modelLoader was null"); model = modelLoader->load(fileName, textureFactory); if(!model) { return createDefault(); } return model; }
void toMain::addConnection ( toConnection *conn ) { int j = 0; for ( std::list<toConnection *>::iterator i = Connections.begin();i != Connections.end();i++, j++ ) { if ( ( *i ) ->description() == conn->description() ) { ConnectionSelection->setCurrentItem ( j ); createDefault(); return; } } Connections.insert ( Connections.end(), conn ); ConnectionSelection->insertItem ( conn->description() ); ConnectionSelection->setCurrentItem ( ConnectionSelection->count() - 1 ); if ( ConnectionSelection->count() == 1 ) { menuBar() ->setItemEnabled ( TO_FILE_COMMIT, true ); menuBar() ->setItemEnabled ( TO_FILE_ROLLBACK, true ); menuBar() ->setItemEnabled ( TO_FILE_CLEARCACHE, true ); menuBar() ->setItemEnabled ( TO_CLOSE_CONNECTION, true ); DisconnectButton->setEnabled ( true ); } checkCaching(); changeConnection(); emit addedConnection ( conn->description() ); createDefault(); }
SamplerStateD3D11::SamplerStateD3D11(Device::GxDeviceD3D11WeakPtr device) : SamplerState(ApiType::D3D11), mDevice(device) { if (device.lock()->getType() != ApiType::D3D11) { throw std::invalid_argument("Invalid device type, must be d3d11"); } createDefault(); }
ExprNode<expressionType, T_element>& getExpr() const { if (expr == NULL) { ExprNode<expressionType, T_element>* e = createDefault(); expr = e; registerWith(*e); } return *expr; }
static capena::server::ResponderPtr createSaveConnType( capena::server::RequestPtr request_ptr, bgq::utility::portConfig::UserType::Value conn_user_type, bgq::utility::portConfig::UserType::Value* conn_user_type_out ) { *conn_user_type_out = conn_user_type; return createDefault( request_ptr ); }
void SkinManager::initialise() { MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice"); MYGUI_LOG(Info, "* Initialise: " << getClassTypeName()); ResourceManager::getInstance().registerLoadXmlDelegate(XML_TYPE) = newDelegate(this, &SkinManager::_load); FactoryManager::getInstance().registerFactory<ResourceSkin>(XML_TYPE_RESOURCE); mDefaultName = "skin_Default"; createDefault(mDefaultName); MYGUI_LOG(Info, getClassTypeName() << " successfully initialized"); mIsInitialise = true; }
void SkinManager::initialise() { MYGUI_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice"); MYGUI_LOG(Info, "* Initialise: " << getClassTypeName()); ResourceManager::getInstance().registerLoadXmlDelegate(mXmlSkinTagName) = newDelegate(this, &SkinManager::_load); std::string resourceCategory = ResourceManager::getInstance().getCategoryName(); FactoryManager::getInstance().registerFactory<ResourceSkin>(resourceCategory); mDefaultName = "skin_Default"; createDefault(mDefaultName); MYGUI_LOG(Info, getClassTypeName() << " successfully initialized"); mIsInitialise = true; }
void cgInit(cgTypes type, ShVariable *src, ShVariableList *vl, EShLanguage l) { ShVariable **var = NULL; switch (type) { case CG_TYPE_RESULT: var = &g.result; break; case CG_TYPE_CONDITION: var = &g.condition; if (src) { dbgPrint(DBGLVL_WARNING, "CodeInsertion - user defined condition types not supported\n"); } break; case CG_TYPE_PARAMETER: var = &g.parameter; if (!src) { dbgPrint(DBGLVL_WARNING, "CodeInsertion - must provide user defined parameter types\n"); } break; default: return; } if (*var) cgDestruct(type); if (!src) { *var = createDefault(type, l); } else { *var = copyShVariable(src); } /* Assign non-used name */ getNewUnusedName(type, &((*var)->name), vl, l); ShDumpVariable(*var, 1); }
Texture * Texture::createDefault() { return createDefault(GL_TEXTURE_2D); }
WDatePicker::WDatePicker(WLineEdit *forEdit, WContainerWidget *parent) : WCompositeWidget(parent) { createDefault(forEdit); }
WDatePicker::WDatePicker(WContainerWidget *parent) : WCompositeWidget(parent) { createDefault(0); }
void Config::loadSettings() { try { m_lconfig->readFile(m_filePath.c_str()); } catch(lc::ParseException& ex) { std::cout << "An parser error occured: " << ex.getError() << std::endl; std::cout << "Message: " << ex.what() << std::endl; std::cout << "Line: " << ex.getLine() << std::endl; } catch(lc::FileIOException& ex) // no config file found { // add default values to settings createDefault(); } // lookup settings try { if(m_lconfig->exists("Astyle.bracketStyle")) { m_aconfig->setBracketStyle(m_lconfig->lookup("Astyle.bracketStyle")); } if(m_lconfig->exists("indentStyle")) { m_aconfig->setIndentStyle(m_lconfig->lookup("indentStyle")); } if(m_lconfig->exists("indentLength")) { m_aconfig->setIndentLength(m_lconfig->lookup("indentLength")); } if(m_lconfig->exists("indentClasses")) { m_aconfig->setIndentClasses(m_lconfig->lookup("indentClasses")); } if(m_lconfig->exists("indentSwitches")) { m_aconfig->setIndentSwitches(m_lconfig->lookup("indentSwitches")); } if(m_lconfig->exists("indentNamespaces")) { m_aconfig->setIndentNamespaces(m_lconfig->lookup("indentNamespaces")); } if(m_lconfig->exists("indentLabels")) { m_aconfig->setIndentLabels(m_lconfig->lookup("indentLabels")); } if(m_lconfig->exists("indentPreprocessor")) { m_aconfig->setIndentPreprocessor(m_lconfig->lookup("indentPreprocessor")); } if(m_lconfig->exists("indentCol1Comments")) { m_aconfig->setIndentCol1Comments(m_lconfig->lookup("indentCol1Comments")); } if(m_lconfig->exists("minConditionalIndent")) { m_aconfig->setMinConditionalIndent(m_lconfig->lookup("minConditionalIndent")); } if(m_lconfig->exists("maxInStatementIndent")) { m_aconfig->setMaxInStatementIndent(m_lconfig->lookup("maxInStatementIndent")); } if(m_lconfig->exists("breakBlocks")) { m_aconfig->setBreakBlocks(m_lconfig->lookup("breakBlocks")); } if(m_lconfig->exists("breakBlocksAll")) { m_aconfig->setBreakBlocksAll(m_lconfig->lookup("breakBlocksAll")); } if(m_lconfig->exists("padOper")) { m_aconfig->setPadOper(m_lconfig->lookup("padOper")); } if(m_lconfig->exists("padParen")) { m_aconfig->setPadParen(m_lconfig->lookup("padParen")); } if(m_lconfig->exists("padParenOut")) { m_aconfig->setPadParenOut(m_lconfig->lookup("padParenOut")); } if(m_lconfig->exists("padParenIn")) { m_aconfig->setPadParenIn(m_lconfig->lookup("padParenIn")); } if(m_lconfig->exists("padHeader")) { m_aconfig->setPadHeader(m_lconfig->lookup("padHeader")); } if(m_lconfig->exists("unpadParen")) { m_aconfig->setUnpadParen(m_lconfig->lookup("unpadParen")); } if(m_lconfig->exists("deleteEmptyLines")) { m_aconfig->setDeleteEmptyLines(m_lconfig->lookup("deleteEmptyLines")); } if(m_lconfig->exists("fillEmptyLines")) { m_aconfig->setFillEmptyLines(m_lconfig->lookup("fillEmptyLines")); } if(m_lconfig->exists("breakClosingBrackets")) { m_aconfig->setBreakClosingBrackets(m_lconfig->lookup("breakClosingBrackets")); } if(m_lconfig->exists("breakElseifs")) { m_aconfig->setBreakElseifs(m_lconfig->lookup("breakElseifs")); } if(m_lconfig->exists("addBrackets")) { m_aconfig->setAddBrackets(m_lconfig->lookup("addBrackets")); } if(m_lconfig->exists("addOneLineBrackets")) { m_aconfig->setAddOneLineBrackets(m_lconfig->lookup("addOneLineBrackets")); } if(m_lconfig->exists("keepOneLineBlocks")) { m_aconfig->setKeepOneLineBlocks(m_lconfig->lookup("keepOneLineBlocks")); } if(m_lconfig->exists("keepOneLineStatements")) { m_aconfig->setKeepOneLineStatements(m_lconfig->lookup("keepOneLineStatements")); } if(m_lconfig->exists("convertTabs")) { m_aconfig->setConvertTabs(m_lconfig->lookup("convertTabs")); } if(m_lconfig->exists("alignPointer")) { m_aconfig->setAlignPointer(m_lconfig->lookup("alignPointer")); } if(m_lconfig->exists("alignReference")) { m_aconfig->setAlignReference(m_lconfig->lookup("alignReference")); } if(m_lconfig->exists("fileMode")) { m_aconfig->setFileMode(m_lconfig->lookup("fileMode")); } } catch(lc::SettingNotFoundException& ex) { // this cannot happen } }