本文整理汇总了C++中DataLoader类的典型用法代码示例。如果您正苦于以下问题:C++ DataLoader类的具体用法?C++ DataLoader怎么用?C++ DataLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DataLoader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
Button::Initialize()
{
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Sounds/");
LoadInterfaceSound(loader, "button.wav", button_sound);
LoadInterfaceSound(loader, "click.wav", click_sound);
LoadInterfaceSound(loader, "swish.wav", swish_sound);
LoadInterfaceSound(loader, "chirp.wav", chirp_sound);
LoadInterfaceSound(loader, "accept.wav", accept_sound);
LoadInterfaceSound(loader, "reject.wav", reject_sound);
LoadInterfaceSound(loader, "confirm.wav", confirm_sound);
LoadInterfaceSound(loader, "list_select.wav", list_select_sound);
LoadInterfaceSound(loader, "list_scroll.wav", list_scroll_sound);
LoadInterfaceSound(loader, "list_drop.wav", list_drop_sound);
LoadInterfaceSound(loader, "combo_open.wav", combo_open_sound);
LoadInterfaceSound(loader, "combo_close.wav", combo_close_sound);
LoadInterfaceSound(loader, "combo_hilite.wav", combo_hilite_sound);
LoadInterfaceSound(loader, "combo_select.wav", combo_select_sound);
LoadInterfaceSound(loader, "menu_open.wav", menu_open_sound);
LoadInterfaceSound(loader, "menu_close.wav", menu_close_sound);
LoadInterfaceSound(loader, "menu_select.wav", menu_select_sound);
LoadInterfaceSound(loader, "menu_hilite.wav", menu_hilite_sound);
loader->SetDataPath(0);
}
示例2:
void
ModConfig::FindMods()
{
disabled.destroy();
DataLoader* loader = DataLoader::GetLoader();
if (loader) {
loader->UseFileSystem(true);
loader->ListFiles("*.dat", disabled, true);
loader->UseFileSystem(Starshatter::UseFileSystem());
ListIter<Text> iter = disabled;
while (++iter) {
Text* name = iter.value();
name->setSensitive(false);
if (*name == "shatter.dat" ||
*name == "beta.dat" ||
*name == "start.dat" ||
*name == "irunin.dat" ||
*name == "vox.dat" ||
name->contains("uninstall") ||
enabled.contains(name))
delete iter.removeItem();
}
}
}
示例3:
void
CmpCompleteDlg::Show()
{
FormWindow::Show();
Campaign* c = Campaign::GetCampaign();
if (img_title && c) {
DataLoader* loader = DataLoader::GetLoader();
Starshatter* stars = Starshatter::GetInstance();
CombatEvent* event = c->GetLastEvent();
char img_name[256];
if (event) {
strcpy_s(img_name, event->ImageFile());
if (!strstr(img_name, ".pcx")) {
strcat_s(img_name, ".pcx");
}
if (loader) {
loader->SetDataPath(c->Path());
loader->LoadBitmap(img_name, banner);
loader->SetDataPath(0);
Rect tgt_rect;
tgt_rect.w = img_title->Width();
tgt_rect.h = img_title->Height();
img_title->SetTargetRect(tgt_rect);
img_title->SetPicture(banner);
}
}
}
}
示例4: new
void
QuitView::Initialize()
{
if (!menu_bmp) {
menu_bmp = new(__FILE__,__LINE__) Bitmap;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Screens/");
loader->LoadBitmap("QuitWin.pcx", *menu_bmp, Bitmap::BMP_TRANSPARENT);
loader->SetDataPath(0);
}
}
示例5: _resetState
void Layer::_resetState( const Carta::State::StateInterface& restoreState ){
m_state.setValue<bool>(Util::VISIBLE, restoreState.getValue<bool>(Util::VISIBLE) );
m_state.setValue<bool>(Util::SELECTED, restoreState.getValue<bool>( Util::SELECTED) );
QString layerName = restoreState.getValue<QString>(Util::NAME);
QString shortName = layerName;
if ( !layerName.startsWith( GROUP )){
DataLoader* dLoader = Util::findSingletonObject<DataLoader>();
shortName = dLoader->getShortName( layerName );
}
m_state.setValue<QString>(Util::ID, restoreState.getValue<QString>(Util::ID));
m_state.setValue<QString>(Util::NAME, shortName);
}
示例6: width
Hoop::Hoop()
: width(360), height(180), mtl(0)
{
foreground = 1;
radius = (float) width;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("HUD/");
loader->LoadTexture("ILS.pcx", hoop_texture, Bitmap::BMP_TRANSLUCENT);
loader->SetDataPath(0);
CreatePolys();
}
示例7: LoadData
// ------------------------------------------------------------------------
void DataContainer::LoadData(const std::string & folder)
{
DataLoader loader;
loader.SetDataFolder(folder);
loader.AddFilenameFilter("*.nrrd");
loader.LoadData(data);
currentIndex = 0;
currentTimeStep = 0;
currentSlice = 0;
QFileInfo info(QString::fromStdString(folder));
this->folderName = folder;
}
示例8: CreateEditBox
void
FormWindow::CreateDefEdit(CtrlDef& def)
{
EditBox* ctrl = CreateEditBox(def.GetText(),
def.GetX(),
def.GetY(),
def.GetW(),
def.GetH(),
def.GetID(),
def.GetParentID());
ctrl->SetAltText(def.GetAltText());
ctrl->SetEnabled(def.IsEnabled());
ctrl->SetBackColor(def.GetBackColor());
ctrl->SetForeColor(def.GetForeColor());
ctrl->SetStyle(def.GetStyle());
ctrl->SetSingleLine(def.GetSingleLine());
ctrl->SetTextAlign(def.GetTextAlign());
ctrl->SetTransparent(def.GetTransparent());
ctrl->SetHidePartial(def.GetHidePartial());
ctrl->SetPasswordChar(def.GetPasswordChar());
ctrl->SetMargins(def.GetMargins());
ctrl->SetTextInsets(def.GetTextInsets());
ctrl->SetCellInsets(def.GetCellInsets());
ctrl->SetCells(def.GetCells());
ctrl->SetFixedWidth(def.GetFixedWidth());
ctrl->SetFixedHeight(def.GetFixedHeight());
ctrl->SetLineHeight(def.GetLineHeight());
ctrl->SetScrollBarVisible(def.GetScrollBarVisible());
ctrl->SetSmoothScroll(def.GetSmoothScroll());
if (def.GetTexture().length() > 0) {
Bitmap* ctrl_tex = 0;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Screens/");
loader->LoadTexture(def.GetTexture(), ctrl_tex);
loader->SetDataPath("");
ctrl->SetTexture(ctrl_tex);
}
Font* f = FontMgr::Find(def.GetFont());
if (f) ctrl->SetFont(f);
}
示例9: CreateRichTextBox
void
FormWindow::CreateDefRichText(CtrlDef& def)
{
RichTextBox* ctrl = CreateRichTextBox(def.GetText(),
def.GetX(),
def.GetY(),
def.GetW(),
def.GetH(),
def.GetID(),
def.GetParentID(),
def.GetStyle());
ctrl->SetAltText(def.GetAltText());
ctrl->SetBackColor(def.GetBackColor());
ctrl->SetForeColor(def.GetForeColor());
ctrl->SetLineHeight(def.GetLineHeight());
ctrl->SetLeading(def.GetLeading());
ctrl->SetScrollBarVisible(def.GetScrollBarVisible());
ctrl->SetSmoothScroll(def.GetSmoothScroll());
ctrl->SetTextAlign(def.GetTextAlign());
ctrl->SetTransparent(def.GetTransparent());
ctrl->SetHidePartial(def.GetHidePartial());
ctrl->SetMargins(def.GetMargins());
ctrl->SetTextInsets(def.GetTextInsets());
ctrl->SetCellInsets(def.GetCellInsets());
ctrl->SetCells(def.GetCells());
ctrl->SetFixedWidth(def.GetFixedWidth());
ctrl->SetFixedHeight(def.GetFixedHeight());
if (def.GetTexture().length() > 0) {
Bitmap* ctrl_tex = 0;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Screens/");
loader->LoadTexture(def.GetTexture(), ctrl_tex);
loader->SetDataPath("");
ctrl->SetTexture(ctrl_tex);
}
Font* f = FontMgr::Find(def.GetFont());
if (f) ctrl->SetFont(f);
for (int i = 0; i < def.NumTabs(); i++)
ctrl->SetTabStop(i, def.GetTab(i));
}
示例10: CreateLabel
void
FormWindow::CreateDefLabel(CtrlDef& def)
{
ActiveWindow* ctrl = CreateLabel(def.GetText(),
def.GetX(),
def.GetY(),
def.GetW(),
def.GetH(),
def.GetID(),
def.GetParentID(),
def.GetStyle());
ctrl->SetAltText(def.GetAltText());
ctrl->SetBackColor(def.GetBackColor());
ctrl->SetForeColor(def.GetForeColor());
ctrl->SetTextAlign(def.GetTextAlign());
ctrl->SetSingleLine(def.GetSingleLine());
ctrl->SetTransparent(def.GetTransparent());
ctrl->SetHidePartial(def.GetHidePartial());
ctrl->SetMargins(def.GetMargins());
ctrl->SetTextInsets(def.GetTextInsets());
ctrl->SetCellInsets(def.GetCellInsets());
ctrl->SetCells(def.GetCells());
ctrl->SetFixedWidth(def.GetFixedWidth());
ctrl->SetFixedHeight(def.GetFixedHeight());
ctrl->UseLayout(def.GetLayout().x_mins,
def.GetLayout().y_mins,
def.GetLayout().x_weights,
def.GetLayout().y_weights);
if (def.GetTexture().length() > 0) {
Bitmap* ctrl_tex = 0;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Screens/");
loader->LoadTexture(def.GetTexture(), ctrl_tex);
loader->SetDataPath("");
ctrl->SetTexture(ctrl_tex);
}
Font* f = FontMgr::Find(def.GetFont());
if (f) ctrl->SetFont(f);
}
示例11: rowVals
LogisticRegressionProblem::LogisticRegressionProblem(const char* trainFileName) {
DataLoader * loader = new DataLoader;
unsigned int featureLen, trainDataCount, trainNumFloats;
float * pTrainData;
float * pTrainLabel;
loader->LoadData(std::string(trainFileName), pTrainData, pTrainLabel);
loader->ReturnStats(featureLen, trainDataCount, trainNumFloats);
numFeats = featureLen;
vector<vector<float> > rowVals(trainDataCount);
unsigned int count = 0;
for (unsigned int i=0; i<trainDataCount; i++) {
for (unsigned int j=0; j<featureLen; j++) {
rowVals[i].push_back(pTrainData[count]);
count ++;
}
}
bool bLabel;
for (unsigned int i=0; i<trainDataCount; i++) {
switch (static_cast<int>(pTrainLabel[i])) {
case 1:
bLabel = true;
break;
case 0:
bLabel = false;
break;
default:
cerr << "illegal label: must be 1 or 0" << endl;
exit(1);
}
AddInstance(rowVals[i], bLabel);
}
}
示例12: CreateImageBox
void
FormWindow::CreateDefImage(CtrlDef& def)
{
ImageBox* ctrl = CreateImageBox(def.GetText(),
def.GetX(),
def.GetY(),
def.GetW(),
def.GetH(),
def.GetID(),
def.GetParentID());
ctrl->SetAltText(def.GetAltText());
ctrl->SetBackColor(def.GetBackColor());
ctrl->SetForeColor(def.GetForeColor());
ctrl->SetStyle(def.GetStyle());
ctrl->SetTextAlign(def.GetTextAlign());
ctrl->SetSingleLine(def.GetSingleLine());
ctrl->SetTransparent(def.GetTransparent());
ctrl->SetHidePartial(def.GetHidePartial());
ctrl->SetMargins(def.GetMargins());
ctrl->SetTextInsets(def.GetTextInsets());
ctrl->SetCellInsets(def.GetCellInsets());
ctrl->SetCells(def.GetCells());
ctrl->SetFixedWidth(def.GetFixedWidth());
ctrl->SetFixedHeight(def.GetFixedHeight());
if (def.GetPicture().length() > 0) {
Bitmap picture;
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Screens/");
loader->LoadBitmap(def.GetPicture(), picture);
loader->SetDataPath("");
ctrl->SetPicture(picture);
}
Font* f = FontMgr::Find(def.GetFont());
if (f) ctrl->SetFont(f);
}
示例13: WinMain
int WINAPI WinMain( HINSTANCE hinst, HINSTANCE pinst, LPSTR cmdl, int cmds )
{
//DataLoader dl("compound.tg4");
//dl.funkt(); Marius Style
screen_interface.open_window( hinst, 1280, 1024 );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 30, GLdouble( x_res ) / y_res, 0.1f, 10000.0f );
glMatrixMode( GL_MODELVIEW );
glPolygonMode( GL_FRONT_AND_BACK, GL_POLYGON);
glEnable( GL_DEPTH_TEST );
//Für Texturen laden
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
GLuint texture_id; //zur Identifikation der Textur
glGenTextures( 1, &texture_id ); //IdentifikationsID generieren und in texture_id speichern
glBindTexture( GL_TEXTURE_2D, texture_id ); //Festlegen der aktuellen Textur
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); //MAGNIFICATION -> vergrößerungsartefakte; unschärfefilter
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); //MINIFICATION -> verkleinerungsartefakte; schärfefilter
glEnable( GL_TEXTURE_2D ); //Texturprojektion aktivieren (rechenintensiv)
//Für Texturen laden - Ende
DataLoader* dl = new DataLoader("compound.tg4");
while(handle_input() == 0)
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
for(int i = 0; i < dl->get_CountOfPolygons() ; i++ )
{
(dl->get_Polygon3D()+i)->DrawPolygon();
}
screen_interface.swap_buffers();
}
return input.msg.wParam;
}
示例14: MoveTo
void
ExitDlg::Show()
{
if (!IsShown()) {
Rect r = def_rect;
if (r.w > screen->Width()) {
int extra = r.w - screen->Width();
r.w -= extra;
}
if (r.h > screen->Height()) {
int extra = r.h - screen->Height();
r.h -= extra;
}
r.x = (screen->Width() - r.w) / 2;
r.y = (screen->Height() - r.h) / 2;
MoveTo(r);
exit_latch = true;
Button::PlaySound(Button::SND_CONFIRM);
MusicDirector::SetMode(MusicDirector::CREDITS);
DataLoader* loader = DataLoader::GetLoader();
BYTE* block = 0;
loader->SetDataPath(0);
loader->LoadBuffer("credits.txt", block, true);
if (block && credits) {
credits->SetText((const char*) block);
}
loader->ReleaseBuffer(block);
}
FormWindow::Show();
}
示例15: AddItem
KBOOL Kylin::Kitbag::AddItem( KUINT uGID )
{
KSTR sValue;
if (!DataManager::GetSingletonPtr()->GetGlobalValue("ITEM_DB",sValue))
return false;
DataLoader* pLoader = DataManager::GetSingletonPtr()->GetLoaderPtr(sValue);
// 查询对应的角色信息
DataItem dbItem;
if (!pLoader->GetDBPtr()->Query(uGID,dbItem))
return false;
ItemCell* pItem = KNEW ItemCell(this);
//------------------------------------------------------------------
DataItem::DataField dbField;
dbItem.QueryField("MESH",dbField);
pItem->m_sMesh = boost::any_cast<KSTR>(dbField.m_aValue);
dbItem.QueryField("TYPE",dbField);
KSTR sType = boost::any_cast<KSTR>(dbField.m_aValue);
pItem->m_eType = (ITEM_TYPE)(KUINT)OgreRoot::GetSingletonPtr()->GetScriptVM()->GetGlobalNumber(sType.data());
dbItem.QueryField("BELONG",dbField);
pItem->m_uBelong = boost::any_cast<KINT>(dbField.m_aValue);
dbItem.QueryField("ICON",dbField);
pItem->m_sIcon = boost::any_cast<KSTR>(dbField.m_aValue);
dbItem.QueryField("EXPLAIN",dbField);
pItem->m_sExplain = boost::any_cast<KSTR>(dbField.m_aValue);
dbItem.QueryField("EFFECT",dbField);
pItem->m_uEffectID = boost::any_cast<KINT>(dbField.m_aValue);
//------------------------------------------------------------------
return AddItem(pItem);
}