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


C++ POVMS_Message::GetInt方法代码示例

本文整理汇总了C++中POVMS_Message::GetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ POVMS_Message::GetInt方法的具体用法?C++ POVMS_Message::GetInt怎么用?C++ POVMS_Message::GetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在POVMS_Message的用法示例。


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

示例1: ResumeRender

void RenderBackend::ResumeRender(POVMS_Message& msg, POVMS_Message& result, int)
{
    if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
        return;

    try
    {
        ViewId vid = msg.GetInt(kPOVAttrib_ViewId);

        ViewMap::iterator i(views.find(vid));

        if(i == views.end())
            throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);

        if((i->second->IsRendering() == false) && (i->second->IsPaused() == false))
            throw POV_EXCEPTION_CODE(kNotNowErr);

        i->second->ResumeRender();

        MakeDoneResult(result);
    }
    catch(pov_base::Exception& e)
    {
        MakeFailedResult(e, result);
    }
    catch(std::runtime_error& e)
    {
        MakeFailedResult(e.what(), result);
    }
    catch(std::bad_alloc&)
    {
        MakeFailedResult(kOutOfMemoryErr, result);
    }
}
开发者ID:arjangcore,项目名称:povray,代码行数:34,代码来源:renderbackend.cpp

示例2: CloseView

void RenderBackend::CloseView(POVMS_Message& msg, POVMS_Message& result, int)
{
    if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
        return;

    try
    {
        ViewId vid = msg.GetInt(kPOVAttrib_ViewId);

        ViewMap::iterator i(views.find(vid));

        if(i == views.end())
            throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);

        try { views.erase(vid); } catch(pov_base::Exception&) { }
        try { scene2views[view2scene[vid]].erase(vid); } catch(pov_base::Exception&) { }
        try { view2scene.erase(vid); } catch(pov_base::Exception&) { }

        MakeDoneResult(result);
    }
    catch(pov_base::Exception& e)
    {
        MakeFailedResult(e, result);
    }
    catch(std::runtime_error& e)
    {
        MakeFailedResult(e.what(), result);
    }
    catch(std::bad_alloc&)
    {
        MakeFailedResult(kOutOfMemoryErr, result);
    }
}
开发者ID:arjangcore,项目名称:povray,代码行数:33,代码来源:renderbackend.cpp

示例3: CloseScene

void RenderBackend::CloseScene(POVMS_Message& msg, POVMS_Message& result, int)
{
    if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
        return;

    try
    {
        SceneId sid = msg.GetInt(kPOVAttrib_SceneId);

        SceneMap::iterator i(scenes.find(sid));

        if(i == scenes.end())
            throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);

        if(scene2views[sid].size() > 0)
            throw POV_EXCEPTION_CODE(kNotNowErr);

        try { scenes.erase(sid); } catch(pov_base::Exception&) { }
        try { scene2views.erase(sid); } catch(pov_base::Exception&) { }

        MakeDoneResult(result);
    }
    catch(pov_base::Exception& e)
    {
        MakeFailedResult(e, result);
    }
    catch(std::runtime_error& e)
    {
        MakeFailedResult(e.what(), result);
    }
    catch(std::bad_alloc&)
    {
        MakeFailedResult(kOutOfMemoryErr, result);
    }
}
开发者ID:arjangcore,项目名称:povray,代码行数:35,代码来源:renderbackend.cpp

示例4: StartRender

void RenderBackend::StartRender(POVMS_Message& msg, POVMS_Message&, int)
{
    try
    {
        ViewId vid = msg.GetInt(kPOVAttrib_ViewId);

        try
        {
            if(validateFrontendAddress(msg.GetSourceAddress()) == false)
                throw POV_EXCEPTION_CODE(kAuthorisationErr);

            ViewMap::iterator i(views.find(vid));

            if(i == views.end())
                throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);

            if(i->second->IsRendering() == true)
                throw POV_EXCEPTION_CODE(kNotNowErr);

            i->second->StartRender(msg);
        }
        catch(pov_base::Exception& e)
        {
            SendViewFailedResult(vid, e, msg.GetSourceAddress());
        }
    }
    catch(pov_base::Exception& e)
    {
        SendFailedResult(e, msg.GetSourceAddress());
    }
    catch(std::runtime_error& e)
    {
        SendFailedResult(e.what(), msg.GetSourceAddress());
    }
    catch(std::bad_alloc&)
    {
        SendFailedResult(kOutOfMemoryErr, msg.GetSourceAddress());
    }
}
开发者ID:arjangcore,项目名称:povray,代码行数:39,代码来源:renderbackend.cpp

示例5: CreateView

void RenderBackend::CreateView(POVMS_Message& msg, POVMS_Message& result, int)
{
    if(ValidateFrontendAddress(msg.GetSourceAddress(), result) == false)
        return;

    try
    {
        SceneId sid = msg.GetInt(kPOVAttrib_SceneId);

        SceneMap::iterator i(scenes.find(sid));

        if(i == scenes.end())
            throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);

        shared_ptr<View> view(i->second->NewView(msg.TryGetInt(kPOVAttrib_Width, 160), msg.TryGetInt(kPOVAttrib_Height, 120), viewcounter + 1));

        viewcounter++;

        POVMS_Message newresult(result, result.GetClass(), kPOVMsgIdent_Done);
        result = newresult;
        result.SetInt(kPOVAttrib_ViewId, viewcounter);

        views[viewcounter] = view;
        try { view2scene[viewcounter] = sid; } catch(std::exception&) { views.erase(viewcounter); throw; }
        try { scene2views[sid].insert(viewcounter); } catch(std::exception&) { views.erase(viewcounter); view2scene.erase(viewcounter); throw; }
    }
    catch(pov_base::Exception& e)
    {
        MakeFailedResult(e, result);
    }
    catch(std::runtime_error& e)
    {
        MakeFailedResult(e.what(), result);
    }
    catch(std::bad_alloc&)
    {
        MakeFailedResult(kOutOfMemoryErr, result);
    }
}
开发者ID:arjangcore,项目名称:povray,代码行数:39,代码来源:renderbackend.cpp

示例6: StartParser

void RenderBackend::StartParser(POVMS_Message& msg, POVMS_Message&, int)
{
    try
    {
        SceneId sid = msg.GetInt(kPOVAttrib_SceneId);

        try
        {
            if(validateFrontendAddress(msg.GetSourceAddress()) == false)
                throw POV_EXCEPTION_CODE(kAuthorisationErr);

            SceneMap::iterator i(scenes.find(sid));

            if(i == scenes.end())
                throw POV_EXCEPTION_CODE(kInvalidIdentifierErr);

            i->second->StartParser(msg);
        }
        catch(pov_base::Exception& e)
        {
            SendSceneFailedResult(sid, e, msg.GetSourceAddress());
        }
    }
    catch(pov_base::Exception& e)
    {
        SendFailedResult(e, msg.GetSourceAddress());
    }
    catch(std::runtime_error& e)
    {
        SendFailedResult(e.what(), msg.GetSourceAddress());
    }
    catch(std::bad_alloc&)
    {
        SendFailedResult(kOutOfMemoryErr, msg.GetSourceAddress());
    }
}
开发者ID:arjangcore,项目名称:povray,代码行数:36,代码来源:renderbackend.cpp


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