• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Model函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: exceptionTest

/*
****Test to check and make sure that all of the execptions in the Ionomodel
****class are thrown where and as they are expected to

**** Please note:  As of June 29,2006 I have not found a way to get the blankAlmanac
**** exception to throw the way I wanted it to.  I have set it to assert fail so I can
**** come back at a later date to fix it.
*/
void xIonoModel :: exceptionTest (void)
{
	//Default constructer for Almanac will give a blank almanac
	gpstk::EngAlmanac blankAlmanac;
	//Set DayTime to the current system time
	gpstk::CommonTime commonTime;
	//Use the default Geodetic constructer
	gpstk::Position rxgeo;
	//Set el and az to 0 for ease of testing
	double svel = 0;
	double svaz = 0;
	//Easy alpha and beta for Ionospheric testing
	double a[4] = {1.,2.,3.,4.};
	double b[4] = {4.,3.,2.,1.};
	gpstk::IonoModel Model(blankAlmanac);
	gpstk::IonoModel goodModel(a,b);

	try
	{
	CPPUNIT_ASSERT_THROW(blankAlmanac.getIon(a,b),gpstk::InvalidRequest);
	//Questioning why this isnt failing auto fail for now
	CPPUNIT_ASSERT_ASSERTION_FAIL(CPPUNIT_ASSERT_THROW(gpstk::IonoModel Model(blankAlmanac),gpstk::Exception));
	CPPUNIT_ASSERT_THROW(Model.getCorrection(commonTime,rxgeo,svel,svaz,Model.L1),gpstk::IonoModel::InvalidIonoModel);
	CPPUNIT_ASSERT_NO_THROW(goodModel.getCorrection(commonTime,rxgeo,svel,svaz,Model.L1));
	CPPUNIT_ASSERT_NO_THROW(goodModel.getCorrection(commonTime,rxgeo,svel,svaz,Model.L2));
	CPPUNIT_ASSERT_NO_THROW(goodModel.getCorrection(commonTime,rxgeo,72.,45.,Model.L1));
	}
	catch(gpstk::Exception& e)
	{
	}
}
开发者ID:Milfhunter,项目名称:gpstk,代码行数:39,代码来源:xIonoModel.cpp


示例2: Model

Model ASTUtil::get_model(uint64_t fn, ModelGetter *model_getter)
{
    if(model_getter){
        JSONNode n = model_getter->operator()(fn);
        return Model(n);
    }
    return Model(JSONNode());
}
开发者ID:appwilldev,项目名称:HQL,代码行数:8,代码来源:ast_util.cpp


示例3: ASSERT

Model MRSFileLoader::createStaticModel( const char* filename ){
	ASSERT( mImpl && "Graphics::XFileLoader : This is empty Object" );
	mImpl->static_createModel( filename );
	Model::Impl* modelImpl = NEW Model::Impl( mImpl );
	modelImpl->release();
	return Model( modelImpl );
}
开发者ID:Marypaz,项目名称:Yoserusu,代码行数:7,代码来源:MRSFileLoader.cpp


示例4: main

int main(int argc, char *argv[])
{
	std::string InputFile;
	double maxsize;
	
	po::options_description desc("Allowed options");
	desc.add_options()
			("help", "Help message.")
			("input", po::value<std::string>(&InputFile), "Set input file")
			//("output", po::value<std::string>(&OutputFile), "Set output file")
			//("x", po::value<double>(&X)->default_value(0.0), "Center X")
			//("y", po::value<double>(&Y)->default_value(0.0), "Center Y")
			//("z", po::value<double>(&Z)->default_value(0.0), "Center Z")
			("maxsize", po::value<double>(&maxsize), "Max size between clusters.")
			;

	po::variables_map vm;
	po::store(po::parse_command_line(argc, argv, desc), vm);
	po::notify(vm);
	
	if(vm.count("help"))
	{
		std::cout << desc << std::endl;
		return 1;
	}
	CheckRequiredArgs(vm);

	//create the model
	ModelFile Model(InputFile);

	TestAgglomerativeClusterData(Model);

	return 0;
}
开发者ID:daviddoria,项目名称:AgglomerativeClustering,代码行数:34,代码来源:ClusterPoints.cpp


示例5: PUMA_Data_Array

Household_Model::Household_Model (int model) :
	PUMA_Data_Array ()
{
	Model (model);
	Location_Field (0);
	Total_Field (0);
}
开发者ID:kravitz,项目名称:transims4,代码行数:7,代码来源:Household_Model.cpp


示例6: Transform

void GameObject::Clear()
{
	mTransform = Transform();
	mModel = Model();
	mBoundingBox = BoundingBox();
	mRenderSettings = GameObjectRenderSettings();
}
开发者ID:vilbeyli,项目名称:DX11Renderer,代码行数:7,代码来源:GameObject.cpp


示例7: getPlane

Model getPlane(const std::vector<Texture>& textures, glm::vec3 ubasis, glm::vec3 vbasis, glm::vec2 dimensions, glm::vec2 textureOffset, glm::vec2 textureScale)
{
	float ltc = textureOffset.x;
	float rtc = textureOffset.x + textureScale.x;
	float btc = textureOffset.y;
	float ttc = textureOffset.y + textureScale.y;

	std::vector<Vertex> vertices(4);
	vertices[0].position = (-ubasis * dimensions.x - vbasis * dimensions.y) * 0.5f;
	vertices[0].texCoords = glm::vec2(ltc, ttc);
	vertices[1].position = (ubasis * dimensions.x - vbasis * dimensions.y) * 0.5f;
	vertices[1].texCoords = glm::vec2(rtc, ttc);
	vertices[2].position = (-ubasis * dimensions.x + vbasis * dimensions.y) * 0.5f;
	vertices[2].texCoords = glm::vec2(ltc, btc);
	vertices[3].position = (ubasis * dimensions.x + vbasis * dimensions.y) * 0.5f;
	vertices[3].texCoords = glm::vec2(rtc, btc);
	vertices[0].normal = vertices[1].normal = vertices[2].normal = vertices[3].normal = glm::cross(ubasis, vbasis);

	std::vector<unsigned> indices;
	indices.push_back(0);
	indices.push_back(1);
	indices.push_back(2);
	indices.push_back(1);
	indices.push_back(3);
	indices.push_back(2);

	Mesh mesh(vertices, indices);
	Material material;
	material.setTextures(textures);
	return Model(mesh, material);
}
开发者ID:Chaosed0,项目名称:OpenGLTest,代码行数:31,代码来源:Box.cpp


示例8: init

void init(Renderer &gfx, Context &ctx)
{	
	vao.create();
	vao.bind();

	cube_buffer.create(Mesh::genUnitCube(false, true, true));
	cube = Model(cube_buffer);

	skybox_buffer.create(Mesh::genUnitCube(false, false, true));
	skybox = Model(skybox_buffer);

	mat_view = mat4(1.0f);
	mat_projection = glm::perspective(PI / 5.0f, ctx.getWidth() / (float)ctx.getHeight(), 0.05f, 15.0f);

	camera.reset(0.0f, 0.0f, vec3(0.0f, 0.2f, 1.0f));
}
开发者ID:lightbits,项目名称:glterrain,代码行数:16,代码来源:app.cpp


示例9: text

  void ModelExplorer::loadFile(const QString &fileName)
  {
    mDlg->show();

    openstudio::model::OptionalModel optionalModel;

    // see what type of file we are opening based on extension
    openstudio::path path = openstudio::toPath(fileName.toStdString().c_str());
    if (openstudio::istringEqual("." + openstudio::modelFileExtension(), openstudio::toString(path.extension()))){
      QString text("Loading ");
      text += openstudio::modelFileExtension().c_str();
      text += " file";
      mProgressBarLbl->setText(text);
      OptionalIdfFile oIdfFile = IdfFile::load(path,mProgressBar);
      if(oIdfFile){
        optionalModel = Model(*oIdfFile);
      }
    }else if(openstudio::istringEqual(".idf", openstudio::toString(path.extension()))){
      mProgressBarLbl->setText("Loading IDF file");
      openstudio::OptionalIdfFile idfFile = openstudio::IdfFile::load(path,openstudio::IddFileType::EnergyPlus,mProgressBar);
      if(idfFile){
        /*
        mProgressBarLbl->setText("Creating workspace");
        openstudio::Workspace workspace(*idfFile,StrictnessLevel::None);
        // START DEBUG CODE
        openstudio::WorkspaceObjectVector wsObjects = workspace.objects();
        openstudio::WorkspaceObjectOrder order = workspace.order();
        BOOST_FOREACH(const openstudio::WorkspaceObject wso,wsObjects){
          OS_ASSERT(order.inOrder(wso.handle()));
        }
        // END DEBUG CODE
        openstudio::energyplus::ReverseTranslator2 reverseTranslator(workspace);
        mProgressBarLbl->setText("Creating workspace");
        optionalModel = reverseTranslator.convert();
        // BEGIN DEBUG CODE
        if(optionalModel){
          order = optionalModel->order();
          wsObjects = optionalModel->objects();
          BOOST_FOREACH(const openstudio::WorkspaceObject wso,wsObjects){
            OS_ASSERT(order.inOrder(wso.handle()));
          }
        }
        // END DEBUG CODE
        */
      }
    }

    mDlg->hide();

    if(!optionalModel){
      QMessageBox::critical(this, "Unable to obtain an OpenStudio Model", "Verify that your input file is the correct version.");
      return;
    }

    setModel(optionalModel.get());
    loadModel();
    expandAllNodes();
  }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:58,代码来源:ModelExplorer.cpp


示例10: Model

Model Model::create(string path){

    ostringstream s4, s5;
    s4 << "INSERT INTO Model(directory) VALUES('" + path + ".txt');";
    QSqlQuery query4(QString(s4.str().c_str()));
    int idModel = query4.lastInsertId().toInt();

    cout << s4.str() << endl;

    string command = "bash createCSV.sh " + path + " > FaceRecognition/modelos.csv";
    cout << command << endl;
    system(command.c_str());

    vector<Mat> images;
    vector<int> labels;

    try{
        read_csv("FaceRecognition/modelos.csv", images, labels);
    }catch (cv::Exception& e) {
        cerr << "ERROR OPENING CSV FILE" << endl;
        exit(1);
    }

    s5 << "INSERT INTO ModelStudent("
          "id_model,"
          "id_student) VALUES";

    set<int> ids(labels.begin(), labels.end());
    map<int, int> pairs;

    for(auto it = ids.begin(); it != ids.end(); ++it){
        Alumno* a = Alumno::create("", string(path + "/" + to_string(*it)));
        pairs[(*it)] = a->getId();
        s5 << "(" << idModel << ", " << a->getId() << ")";
        if(next(it) == ids.end()) s5 << ";";
        else s5 << ", \n";
    }
    cout << s5.str() << endl;
    vector<int> newLabels;
    for(int i = 0; i < labels.size(); i++){
        newLabels.push_back(pairs[labels[i]]);
    }

    for(int i = 0; i < images.size(); i++){
        equalizeHist(images[i], images[i]);
        cv::resize(images[i], images[i], Size(48,48));
    }


    QSqlQuery query5(QString(s5.str().c_str()));

    Model model = Model(createEigenFaceRecognizer(0, 3000));
    model->train(images, newLabels);
    model->save(string(path + ".txt"));
    cout << "END" << endl;

    return model;
}
开发者ID:AlejandroRosa,项目名称:AnalizadorAtencion,代码行数:58,代码来源:model.cpp


示例11: Model

void Cube::Initialize()
{

	mSquare = Model();
	mSquare.VertexData.push_back(glm::vec3(-1.0f, -1.0f, 0.0f));
	mSquare.VertexData.push_back(glm::vec3(1.0f, -1.0f, 0.0f));
	mSquare.VertexData.push_back(glm::vec3(1.0f, 1.0f, 0.0f));
	mSquare.VertexData.push_back(glm::vec3(-1.0f, 1.0f, 0.0f));
	//we want a gray cube cube.
	mSquare.ColorData.push_back(glm::vec3(1.0f, 0.0f, 0.0f));
	mSquare.ColorData.push_back(glm::vec3(1.0f, 0.0f, 0.0f));
	mSquare.ColorData.push_back(glm::vec3(1.0f, 0.0f, 0.0f));
	mSquare.ColorData.push_back(glm::vec3(1.0f, 0.0f, 0.0f));
	//first.riangle.
	mSquare.IndicesData.push_back(0);
	mSquare.IndicesData.push_back(1);
	mSquare.IndicesData.push_back(3);
	//secon.triangle.
	mSquare.IndicesData.push_back(1);
	mSquare.IndicesData.push_back(2);
	mSquare.IndicesData.push_back(3);

	mSquare.UVData.push_back((glm::vec2(0.0f, 0.0f)));
	mSquare.UVData.push_back((glm::vec2(1.0f, 0.0f)));
	mSquare.UVData.push_back((glm::vec2(0.0f, 1.0f)));
	mSquare.UVData.push_back((glm::vec2(1.0f, 1.0f)));
	mSquare.Initialize();



	int numberOfFaces = 6;
	mFacesModelMatrices.resize(numberOfFaces);

	//bottom
	mFacesModelMatrices[0] = glm::translate(0.0f, -1.0f, 0.0f)*glm::rotate(90.0f, glm::vec3(1.0f, 0.0f, 0.0f));
	//top
	mFacesModelMatrices[1] = glm::translate(0.0f, 1.0f, 0.0f)*glm::rotate(90.0f, glm::vec3(1.0f, 0.0f, 0.0f));
	//front
	mFacesModelMatrices[2] = glm::translate(0.0f, 0.0f, 1.0f);
	//back
	mFacesModelMatrices[3] = glm::translate(0.0f, 0.0f, -1.0f);
	//left
	mFacesModelMatrices[4] = glm::translate(-1.0f, 0.0f, 0.0f)*glm::rotate(90.0f, glm::vec3(0.0f, 1.0f, 0.0f));
	//right
	mFacesModelMatrices[5] = glm::translate(1.0f, 0.0f, 0.0f)*glm::rotate(90.0f, glm::vec3(0.0f, 1.0f, 0.0f));

	//this transformation is applied on the whole cube!!!
	CubeModelMatrix = glm::scale(50.0f, 50.0f, 50.0f);


	skyboxTextures[0] = std::unique_ptr<Texture>(new Texture("down.jpg", 1));
	skyboxTextures[1] = std::unique_ptr<Texture>(new Texture("up.jpg", 1));
	skyboxTextures[2] = std::unique_ptr<Texture>(new Texture("front.jpg", 1));
	skyboxTextures[3] = std::unique_ptr<Texture>(new Texture("back.jpg", 1));
	skyboxTextures[4] = std::unique_ptr<Texture>(new Texture("left.jpg", 1));
	skyboxTextures[5] = std::unique_ptr<Texture>(new Texture("right.jpg", 1));
}
开发者ID:Overload71,项目名称:Sonic-game-OpenGl-3.3-,代码行数:57,代码来源:Cube.cpp


示例12: graph

IterativeExtensions<span, Node, Edge, GraphDataVariant>::IterativeExtensions (
    const GraphTemplate<Node,Edge,GraphDataVariant>&        graph,
    TerminatorTemplate<Node,Edge,GraphDataVariant>&         terminator,
    TraversalKind       traversalKind,
    ExtendStopMode_e    whenToStop,
    SearchMode_e        searchMode,
    bool                dontOutputFirstNucl,
    int                 max_depth,
    int                 max_nodes
)
    : graph(graph), terminator(terminator),
      traversalKind(traversalKind),  when_to_stop_extending(whenToStop),
      searchMode(searchMode), dont_output_first_nucleotide(dontOutputFirstNucl),
      max_depth(max_depth), max_nodes(max_nodes)
{
    model         = Model (graph.getKmerSize()  );
    modelMinusOne = Model (graph.getKmerSize()-1);
}
开发者ID:pombredanne,项目名称:gatb-core,代码行数:18,代码来源:IterativeExtensions.cpp


示例13: fit

			Model fit(const vector<ofVec2f> & data, int order) {
				vector<float> x(data.size()), y(data.size());
				for (int i = 0; i < data.size(); i++) {
					x[i] = data[i].x;
					y[i] = data[i].y;
				}

				return Model({mathalgo::polyfit<float>(x, y, order)});
			}
开发者ID:arturoc,项目名称:ofxRulr,代码行数:9,代码来源:PolyFit.cpp


示例14: getDebugBoxMesh

Model getDebugBoxMesh(const glm::vec3& halfExtents)
{
	static unsigned topRightFronti = 0;
	static unsigned topLeftFronti = 1;
	static unsigned topRightBacki = 2;
	static unsigned topLeftBacki = 3;
	static unsigned botRightFronti = 4;
	static unsigned botLeftFronti = 5;
	static unsigned botRightBacki = 6;
	static unsigned botLeftBacki = 7;

	// We're not expecting this to be lit nor textured, so ignore normal and texCoord
	std::vector<Vertex> vertices(8);
	vertices[topRightFronti].position = glm::vec3(halfExtents.x, halfExtents.y, halfExtents.z);
	vertices[topLeftFronti].position = glm::vec3(-halfExtents.x, halfExtents.y, halfExtents.z);
	vertices[topRightBacki].position = glm::vec3(halfExtents.x, halfExtents.y, -halfExtents.z);
	vertices[topLeftBacki].position = glm::vec3(-halfExtents.x, halfExtents.y, -halfExtents.z);
	vertices[botRightFronti].position = glm::vec3(halfExtents.x, -halfExtents.y, halfExtents.z);
	vertices[botLeftFronti].position = glm::vec3(-halfExtents.x, -halfExtents.y, halfExtents.z);
	vertices[botRightBacki].position = glm::vec3(halfExtents.x, -halfExtents.y, -halfExtents.z);
	vertices[botLeftBacki].position = glm::vec3(-halfExtents.x, -halfExtents.y, -halfExtents.z);

	std::vector<unsigned> indices;
	// Top face
	indices.push_back(topLeftFronti);
	indices.push_back(topRightFronti);
	indices.push_back(topRightFronti);
	indices.push_back(topRightBacki);
	indices.push_back(topRightBacki);
	indices.push_back(topLeftBacki);
	indices.push_back(topLeftBacki);
	indices.push_back(topLeftFronti);
	// Bottom face
	indices.push_back(botLeftFronti);
	indices.push_back(botRightFronti);
	indices.push_back(botRightFronti);
	indices.push_back(botRightBacki);
	indices.push_back(botRightBacki);
	indices.push_back(botLeftBacki);
	indices.push_back(botLeftBacki);
	indices.push_back(botLeftFronti);
	// Connecting bars
	indices.push_back(topLeftFronti);
	indices.push_back(botLeftFronti);
	indices.push_back(topRightFronti);
	indices.push_back(botRightFronti);
	indices.push_back(topLeftBacki);
	indices.push_back(botLeftBacki);
	indices.push_back(topRightBacki);
	indices.push_back(botRightBacki);

	Mesh mesh(vertices, indices);
	Material material;
	material.drawType = MaterialDrawType_Lines;
	return Model(mesh, material);
}
开发者ID:Chaosed0,项目名称:OpenGLTest,代码行数:56,代码来源:Box.cpp


示例15: new

// ---------------------------------------------------------------------------
// CAppMngr2ListContainer::LoadIconsL()
// ---------------------------------------------------------------------------
//
void CAppMngr2ListContainer::LoadIconsL()
    {
    CAknIconArray* iconArray = new ( ELeave ) CAknIconArray( KGranularity );
    CleanupStack::PushL( iconArray );
    Model().LoadIconsL( *iconArray );
    delete iListBox->ItemDrawer()->ColumnData()->IconArray();
    iListBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
    CleanupStack::Pop( iconArray );
    iItemSpecificIcons = 0;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:14,代码来源:appmngr2listcontainer.cpp


示例16: Model

void TabPanel::onCreate(const TabPanel * Id)
{
	Inherited::onCreate(Id);

    if(Id != NULL)
    {
        DefaultSingleSelectionModelUnrecPtr Model(DefaultSingleSelectionModel::create());
        setSelectionModel(Model);
    }
}
开发者ID:ahuballah,项目名称:OpenSGToolbox,代码行数:10,代码来源:OSGTabPanel.cpp


示例17: addModel

Model* addModel(const std::string& name)
{
    models.push_back(Model());

    auto mdl = &(models.back());
    mdl->name = name;

    std::cout << "Press " << models.size() << " to show the " << name << std::endl;

    return mdl;
}
开发者ID:LukasBanana,项目名称:GeometronLib,代码行数:11,代码来源:Test3_MeshGen.cpp


示例18: CurrentItem

// ---------------------------------------------------------------------------
// CAppMngr2ListContainer::HandleGenericCommandL()
// ---------------------------------------------------------------------------
//
void CAppMngr2ListContainer::HandleGenericCommandL( TInt aCommand )
    {
    if( !IsListEmpty() )
        {
        CAppMngr2InfoBase& currentItem = CurrentItem();
        if( currentItem.SupportsGenericCommand( aCommand ) )
            {
            Model().HandleCommandL( currentItem, aCommand );
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:15,代码来源:appmngr2listcontainer.cpp


示例19: CALLSTACKITEM_N

void CContextMediaBox::CreateItemDrawerL(void)
{
	CALLSTACKITEM_N(_CL("CContextMediaBox"), _CL("CreateItemDrawerL"));

	itemd=CFormattedCellListBoxData::NewL();
	CleanupStack::PushL(itemd);

	iItemDrawer=new (ELeave) CContextMediaBoxDrawer(Model(), LatinPlain12(), itemd, iPostArray,
													iStandAlone);
	
	CleanupStack::Pop();	
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:12,代码来源:medialistbox.cpp


示例20: loadModelSTL_string

    Model &Backend::getModel(std::string name)
    {
        if (!models.count(name)) {
            if (modules.count(name)) {
                Model model = loadModelSTL_string(getModule(name)->openscad("stl"));
                models[name] = model;
            } else {
                models[name] = Model();
            }
        }

        return models[name];
    }
开发者ID:RhobanProject,项目名称:MetabotStudio,代码行数:13,代码来源:Backend.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ModelException函数代码示例发布时间:2022-05-30
下一篇:
C++ Mode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap