当前位置: 首页>>代码示例>>C++>>正文


C++ InitData函数代码示例

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


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

示例1: InitData

/*!
	@param _radarVolumeData 地面に投影する予定の雲のボリュームテクスチャ を渡す。floatでRGBAで既に虹色に変換されたデータにすること
	@param _size ボリュームデータのサイズ
*/
void CLand::Init(color<float>* _radarVolumeData,int _size){
	m_List[0]=glGenLists(2);
	//glGenBuffers(2, m_IdBufferId);
	//glGenBuffers(2, m_BufferId);
	InitData("../data/map/iruma.jmesh",0);
	InitData("../data/map/komaki.jmesh",1);
	
	
	glActiveTexture(GL_TEXTURE1);

	glGenTextures ( 1, &m_ProjectedSamp[0] );
	glBindTexture (GL_TEXTURE_2D, m_ProjectedSamp[0]);
	glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGBA, _size, _size, 0, GL_RGBA, GL_FLOAT, _radarVolumeData);
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
	glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
	
   glActiveTexture(GL_TEXTURE1);
   glGenTextures ( 1, &m_ProjectedSamp[1] );
   glBindTexture (GL_TEXTURE_2D, m_ProjectedSamp[1]);
   glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGBA, _size, _size, 0, GL_RGBA, GL_FLOAT, _radarVolumeData);
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
   glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
   glActiveTexture(GL_TEXTURE0);
 
   cout<<"地図バッファ情報"<<endl;
   mProgram=new CGLSLClipProjected("land.vert","land.frag");
   mProgram->UpdateTextureUniform();
}
开发者ID:miffysora,项目名称:CloudRender-PointSplatting,代码行数:38,代码来源:Land.cpp

示例2: InitData

int Application::Execute()
{
    if (!LoadData(trainingImgs, Utils::TRAINING_IMAGES_PER_SUBJECT, true))
        return Utils::EXIT_F;
    if (!LoadData(validationImgs, Utils::VALIDATION_IMAGES_PER_SUBJECT, false))
        return Utils::EXIT_F;

    InitData(&trainingInputs, &trainingLabels, Utils::TRAINING_TOTAL_INPUT, trainingImgs);
    InitData(&validationInputs, &validationLabels, Utils::VALIDATION_TOTAL_INPUT, validationImgs);

    int hiddenLayerNeurons[] = { 5 };
    NeuralNetwork ann(Utils::PIXEL_COUNT, Utils::HIDDEN_LAYER_COUNT, hiddenLayerNeurons, Utils::SUBJECT_COUNT);

    printf(Utils::BEGIN_TRAINING);
    ann.Train(trainingInputs, trainingLabels, Utils::TRAINING_TOTAL_INPUT);
    printf(Utils::END_TRAINING);

    ann.Save("ocr.ann");

    for (int x = 0; x < Utils::VALIDATION_TOTAL_INPUT; x++)
    {
        for (int y = 0; y < Utils::SUBJECT_COUNT; y++)
            validationLabels[x][y] = ann.GetGuess(validationInputs[x], y);
    }

    for (int x = 0; x < Utils::VALIDATION_TOTAL_INPUT; x++)
    {
        for (int y = 0; y < Utils::SUBJECT_COUNT; y++)
            std::printf("%5.5f\n", validationLabels[x][y]);
        std::printf("\n");
    }

    Clean();
    return Utils::EXIT_S;
}
开发者ID:jbowren,项目名称:SimpleMLP,代码行数:35,代码来源:Application.cpp

示例3: defined

void Data::LoadData()
{
#if defined(_WIN32) || defined(_WIN64)
	_finddata_t fd;
	long handle;
	int result = 1;

	handle = _findfirst("용사.txt", &fd);
	if (handle == -1)
	{
		InitData();
		return;
	}
#elif defined(__linux__)
	dirent **namelist;
	int n;

	n = scandir(".", &namelist, 0, alphasort);

	if (n < 0)
	{
		InitData();
		return;
	}

	int i;
	for (i = 0; i < n; i++)
	{
		if (strcmp(namelist[i]->d_name, "용사.txt") == 0)
		{
			free(namelist[n]);
			break;
		}
		free(namelist[n]);
	}
	free(namelist);

	if (i == n)
	{
		InitData();
		return;
	}
#endif

	char buffer[65536];
	FILE *file = fopen("용사.txt", "r");

	rapidjson::FileReadStream is(file, buffer, sizeof(buffer));
	document.ParseStream(is);
	fclose(file);
}
开发者ID:Nickchooshin,项目名称:Project_HK,代码行数:51,代码来源:Data.cpp

示例4: InitData

BOOL TransientSet::IsDefine()
{
	InitData();
	if(ms_TotalSteps.GetnValue()<=0)
		return FALSE;
	return TRUE;
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:7,代码来源:TransientSet.cpp

示例5: m_size

SmallImage::SmallImage(unsigned int width, unsigned int height, unsigned int iComponentCount) :
 m_size(width, height),
 m_iComponentCount(iComponentCount),
 m_pData(0)
{
  InitData();
}
开发者ID:RockLobster,项目名称:ImageVis3D,代码行数:7,代码来源:SmallImage.cpp

示例6: BArchivable

BShape::BShape(BMessage* archive)
	:	BArchivable(archive)
{
	InitData();

	shape_data* data = (shape_data*)fPrivateData;

	ssize_t size = 0;
	int32 count = 0;
	type_code type = 0;
	archive->GetInfo("ops", &type, &count);
	if (!AllocateOps(count))
		return;

	int32 i = 0;
	const uint32* opPtr;
	while (archive->FindData("ops", B_INT32_TYPE, i++, (const void**)&opPtr, &size) == B_OK)
		data->opList[data->opCount++] = *opPtr;

	archive->GetInfo("pts", &type, &count);
	if (!AllocatePts(count)) {
		Clear();
		return;
	}

	i = 0;
	const BPoint* ptPtr;
	while (archive->FindData("pts", B_POINT_TYPE, i++, (const void**)&ptPtr, &size) == B_OK)
		data->ptList[data->ptCount++] = *ptPtr;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:30,代码来源:Shape.cpp

示例7: message

/*!	\brief Creates and initializes a new BMessageRunner.

	This constructor version additionally allows to specify the target for
	replies to the delivered message(s).

	The success of the initialization can (and should) be asked for via
	InitCheck().

	\note As soon as the last message has been sent, the message runner
		  becomes unusable. InitCheck() will still return \c B_OK, but
		  SetInterval(), SetCount() and GetInfo() will fail.

	\param target Target of the message(s).
	\param message The message to be sent to the target.
	\param interval Period of time before the first message is sent and
		   between messages (if more than one shall be sent) in microseconds.
	\param count Specifies how many times the message shall be sent.
		   A value less than \c 0 for an unlimited number of repetitions.
	\param replyTo Target replies to the delivered message(s) shall be sent to.
*/
BMessageRunner::BMessageRunner(BMessenger target, const BMessage *message,
							   bigtime_t interval, int32 count,
							   BMessenger replyTo)
	: fToken(-1)
{
	InitData(target, message, interval, count, replyTo);
}
开发者ID:BackupTheBerlios,项目名称:nemo,代码行数:27,代码来源:MessageRunner.cpp

示例8: PhysicsBody2D

//=================================================================================================================
//=================================================================================================================
TopdownTile::TopdownTile()
:	PhysicsBody2D()
,	m_D3DSystem(0)
,	m_engineOptions(0)
{
	InitData();
}
开发者ID:henriyl,项目名称:ZShadeSandbox,代码行数:9,代码来源:TopdownTile.cpp

示例9: InitData

MP3File::MP3File(video::iStreamPort* pport)
{
  InitData();
  m_pPort = pport;
  m_bStreaming = true;
  m_pMP3FilePtr = OSCL_FileOpen(m_pPort);
  if(m_pPort)
  {
    int64 noffset = 0;
    uint64 size = MAX_FILE_SIZE;
    video::iStreamPort::DataSourceType eSourceType =
      video::iStreamPort::DS_FILE_SOURCE;
    if(video::iStreamPort::DS_SUCCESS == m_pPort->GetContentLength(&noffset))
    {
      size = (uint64)noffset;
    }
    m_pPort->GetSourceType(&eSourceType);
    if (video::iStreamPort::DS_STREAMING_SOURCE != eSourceType)
    {
      m_bStreaming = false;
    }
    m_nFileSize = size;
  }
  if(ParseMP3Header()== PARSER_ErrorNone )
  {
    _fileErrorCode = PARSER_ErrorNone;
    _success = true;
  }
}
开发者ID:xingrz,项目名称:android_tools_leeco_msm8996,代码行数:29,代码来源:mp3file.cpp

示例10: emulator

void emulator() {
	/* omit business about ModuleSP, as the compiler handles such
		things for us */

	InitData();
	RecognizeCart();
	SetupBanks();
	Reset();
	Init_Service();
	Controls();

	/* ExitEmulator gets set by Controls() if the user presses
		Escape */
	while( !ExitEmulator ) {
		VSync();
		srv_CopyScreen();
		ScanFrame();
		Controls();

		while(GamePaused) {
			Controls();
		}
	}

}
开发者ID:cinnamoncoin,项目名称:z26,代码行数:25,代码来源:c_core.c

示例11: main

int main (int argc, char * argv[]) {
    world = new World("Dclock", argc, argv);
    DoArgs(argc, argv);
    InitData();
    switch (CreateMode) {
	case SWEPT:
	    TheClock = new DFace(
		ShowDate, ShowBorder, ShowTime, TimeMode
	    );
	    world->InsertApplication(TheClock);
	    break;
	case PLACED:
	    TheClock = new DFace(
		ShowDate, ShowBorder, ShowTime, TimeMode, Width, Height
	    );
	    world->InsertApplication(TheClock);
	    break;
	case DEFINED:
	    TheClock = new DFace(
		ShowDate, ShowBorder, ShowTime, TimeMode, Width, Height
	    );
	    world->InsertApplication(TheClock, XPos, YPos);
	    break;
    }
    TheClock->Run();
    return 0;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:27,代码来源:dclock.c

示例12: BControl

BTextControl::BTextControl(BMessage *data)
	:	BControl(data)
{
	InitData(Label(), NULL, data);

	int32 _a_label = B_ALIGN_LEFT;
	int32 _a_text = B_ALIGN_LEFT;

	if (data->HasInt32("_a_label"))
		data->FindInt32("_a_label", &_a_label);

	if (data->HasInt32("_a_text"))
		data->FindInt32("_a_text", &_a_text);
	
	SetAlignment((alignment)_a_label, (alignment)_a_text);

	if (data->HasFloat("_divide"))
		data->FindFloat("_a_text", &fDivider);

	if (data->HasMessage("_mod_msg")) {
		BMessage *_mod_msg = new BMessage;
		data->FindMessage("_mod_msg", _mod_msg);
		SetModificationMessage(_mod_msg);
	}
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:25,代码来源:TextControl.cpp

示例13: ASSERT

void CTRL::ChangeStyle(BODY_TYPE newStyle)
//改变控件类型
{
	ASSERT(newStyle != style);
	free(data);			//释放原来类型对应的数据空间
	InitData(newStyle);	//初始化控件数据部分
}
开发者ID:wm3418925,项目名称:Steady-circuit,代码行数:7,代码来源:Ctrl.cpp

示例14: InitData

void MainWindow::Resetbro(long num){
    //QStringList bro_text;
    QString tmp_data = "";
    pstustr bro_ptemp;
    bro_ptemp = head;
    ui->textBrowser->clear();
    if(!head)
    {

        QMessageBox::warning(this,tr("警告"),tr("哈哈,没人了"),QMessageBox::Yes);
        InitData();
        Resetbro();
    }
    else
    {
        while(NULL!=bro_ptemp)
        {
            if(bro_ptemp->stunum==num)
            {
                tmp_data = "  "+QString::number(bro_ptemp->id,10) + "    姓名:" + QString(bro_ptemp->name) + "   学号:"
                        + QString::number(bro_ptemp->stunum,10) + "   专业:" + QString(bro_ptemp->major)
                        + "   学科:" + QString(bro_ptemp->psubinfo.subname) + "   分数:"
                        + QString::number(bro_ptemp->psubinfo.marks,10);

                ui->textBrowser->append(tmp_data);
            }
            bro_ptemp = bro_ptemp->pnext;

        }
    }
    // ui->textBrowser->append(tmp_data);
}
开发者ID:kangqf,项目名称:Mysql_stuinfo,代码行数:32,代码来源:mainwindow.cpp

示例15: InitView

BOOL CPanelDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	InitView();
	InitData();
	return TRUE;
}
开发者ID:c4bbage,项目名称:trochilus,代码行数:7,代码来源:PanelDlg.cpp


注:本文中的InitData函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。