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


C++ POVMS_Message类代码示例

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


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

示例1: 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

示例2: newmsg

void RenderBackend::MakeFailedResult(int error, POVMS_Message& result)
{
    POVMS_Message newmsg(result, result.GetClass(), kPOVMsgIdent_Failed);
    result = newmsg;
    result.SetInt(kPOVAttrib_ErrorNumber, error);
    result.SetString(kPOVAttrib_EnglishText, pov_base::Exception::lookup_code(error).c_str());
}
开发者ID:arjangcore,项目名称:povray,代码行数:7,代码来源:renderbackend.cpp

示例3: 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

示例4: 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

示例5: ReadFile

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

    MakeFailedResult(kCannotHandleRequestErr, result);
}
开发者ID:arjangcore,项目名称:povray,代码行数:7,代码来源:renderbackend.cpp

示例6: POVMS_GetContextAddress

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

    try
    {
        POVMSAddress backendAddress = POVMSInvalidAddress;
        int err = POVMS_GetContextAddress(context, &backendAddress);

        if(err != kNoErr)
            throw POV_EXCEPTION_CODE (err);

        shared_ptr<Scene> scene(new Scene(backendAddress, msg.GetSourceAddress(), scenecounter + 1));

        scenecounter++;

        POVMS_Message newresult(result, result.GetClass(), kPOVMsgIdent_Done);
        result = newresult;
        result.SetInt(kPOVAttrib_SceneId, scenecounter);

        scenes[scenecounter] = scene;
        try
        {
            scene2views[scenecounter] = ViewIdSet();
        }
        catch(std::exception&)
        {
            scenes.erase(scenecounter);
            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,代码行数:45,代码来源:renderbackend.cpp

示例7: POVMS_SendMessage

void POVMS_SendMessage(POVMS_Message& msg)
{
    int err;

    err = POVMS_Send(nullptr, &msg.data, nullptr, kPOVMSSendMode_NoReply);

    if(err != pov_base::kNoErr)
        throw POV_EXCEPTION_CODE(err);

    msg.DetachData();
}
开发者ID:wfpokorny,项目名称:povray,代码行数:11,代码来源:povmscpp.cpp

示例8: i

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

示例9: POVMS_SendMessage

void POVMS_SendMessage(POVMSContext contextref, POVMS_Message& msg, POVMS_Message *result, int mode)
{
	int err;

	if(result != NULL)
		err = POVMS_Send(contextref, &msg.data, &result->data, mode);
	else
		err = POVMS_Send(contextref, &msg.data, NULL, mode);

	if(err != kNoErr)
		throw err;

	msg.DetachData();
}
开发者ID:ClementLeBihan,项目名称:CelluleFlexible,代码行数:14,代码来源:povmscpp.cpp

示例10: 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

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