Open CASCADE学习|显示文本

目录

1、修改代码

Viewer.h:

Viewer.cpp:

2、显示文本

OpenCasCade 你好啊

霜吹花落


1、修改代码

在文章《Open CASCADE学习|显示模型》基础上,增加部分代码,实现对文本显示的支持,具体如下:

Viewer.h:

//-----------------------------------------------------------------------------// Created on: 24 August 2017//-----------------------------------------------------------------------------// Copyright (c) 2017, Sergey Slyadnev (sergey.slyadnev@gmail.com)// All rights reserved.//// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions are met:////    * Redistributions of source code must retain the above copyright//      notice, this list of conditions and the following disclaimer.//    * Redistributions in binary form must reproduce the above copyright//      notice, this list of conditions and the following disclaimer in the//      documentation and/or other materials provided with the distribution.//    * Neither the name of the copyright holder(s) nor the//      names of all contributors may be used to endorse or promote products//      derived from this software without specific prior written permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.//-----------------------------------------------------------------------------#pragma once#ifdef _WIN32#include <Windows.h>#endif// Local includes#include "ViewerInteractor.h"// OpenCascade includes#include <TopoDS_Shape.hxx>#include <AIS_TextLabel.hxx>#include <WNT_Window.hxx>// Standard includes#include <vector>class V3d_Viewer;class V3d_View;class AIS_InteractiveContext;class AIS_ViewController;//-----------------------------------------------------------------------------//! Simple 3D viewer.class Viewer{public:    Viewer(const int left,        const int top,        const int width,        const int height);public:    Viewer& operator<<(const TopoDS_Shape& shape)    {        this->AddShape(shape);        return *this;    }    Viewer& operator<<(const Handle(AIS_TextLabel)& label)    {        this->AddLabel(label);        return *this;    }    void AddShape(const TopoDS_Shape& shape);    void AddLabel(const Handle(AIS_TextLabel)& label);    void StartMessageLoop();    void StartMessageLoop2();private:    static LRESULT WINAPI        wndProcProxy(HWND hwnd,            UINT message,            WPARAM wparam,            LPARAM lparam);    LRESULT CALLBACK        wndProc(HWND hwnd,            UINT message,            WPARAM wparam,            LPARAM lparam);    void init(const HANDLE& windowHandle);    /* API-related things */private:    std::vector<TopoDS_Shape> m_shapes; //!< Shapes to visualize.    std::vector<Handle(AIS_TextLabel)> m_labels; //!< Shapes to visualize.    /* OpenCascade's things */private:    Handle(V3d_Viewer)             m_viewer;    Handle(V3d_View)               m_view;    Handle(AIS_InteractiveContext) m_context;    Handle(WNT_Window)             m_wntWindow;    Handle(ViewerInteractor)       m_evtMgr;    /* Lower-level things */private:    HINSTANCE m_hInstance; //!< Handle to the instance of the module.    HWND      m_hWnd;      //!< Handle to the instance of the window.    bool      m_bQuit;     //!< Indicates whether user want to quit from window.};

Viewer.cpp:

//-----------------------------------------------------------------------------
// Created on: 24 August 2017
//-----------------------------------------------------------------------------
// Copyright (c) 2017, Sergey Slyadnev (sergey.slyadnev@gmail.com)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//    * Redistributions of source code must retain the above copyright
//      notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright
//      notice, this list of conditions and the following disclaimer in the
//      documentation and/or other materials provided with the distribution.
//    * Neither the name of the copyright holder(s) nor the
//      names of all contributors may be used to endorse or promote products
//      derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------

// Own include
#include "Viewer.h"

// OpenCascade includes
#include <AIS_InteractiveContext.hxx>
#include <AIS_Shape.hxx>
#include <Aspect_DisplayConnection.hxx>
#include <Aspect_Handle.hxx>
#include <OpenGl_GraphicDriver.hxx>
#include <V3d_AmbientLight.hxx>
#include <V3d_DirectionalLight.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>

namespace {
    //! Adjust the style of local selection.
    //! \param[in] context the AIS context.
    void AdjustSelectionStyle(const Handle(AIS_InteractiveContext)& context)
    {
        // Initialize style for sub-shape selection.
        Handle(Prs3d_Drawer) selDrawer = new Prs3d_Drawer;
        //
        selDrawer->SetLink(context->DefaultDrawer());
        selDrawer->SetFaceBoundaryDraw(true);
        selDrawer->SetDisplayMode(1); // Shaded
        selDrawer->SetTransparency(0.5f);
        selDrawer->SetZLayer(Graphic3d_ZLayerId_Topmost);
        selDrawer->SetColor(Quantity_NOC_GOLD);
        selDrawer->SetBasicFillAreaAspect(new Graphic3d_AspectFillArea3d());

        // Adjust fill area aspect.
        const Handle(Graphic3d_AspectFillArea3d)&
            fillArea = selDrawer->BasicFillAreaAspect();
        //
        fillArea->SetInteriorColor(Quantity_NOC_GOLD);
        fillArea->SetBackInteriorColor(Quantity_NOC_GOLD);
        //
        fillArea->ChangeFrontMaterial().SetMaterialName(Graphic3d_NOM_NEON_GNC);
        fillArea->ChangeFrontMaterial().SetTransparency(0.4f);
        fillArea->ChangeBackMaterial().SetMaterialName(Graphic3d_NOM_NEON_GNC);
        fillArea->ChangeBackMaterial().SetTransparency(0.4f);

        selDrawer->UnFreeBoundaryAspect()->SetWidth(1.0);

        // Update AIS context.
        context->SetHighlightStyle(Prs3d_TypeOfHighlight_LocalSelected, selDrawer);
    }
}

//-----------------------------------------------------------------------------

Viewer::Viewer(const int left,
    const int top,
    const int width,
    const int height)
    : m_hWnd(NULL),
    m_bQuit(false)
{
    // Register the window class once
    static HINSTANCE APP_INSTANCE = NULL;
    if (APP_INSTANCE == NULL)
    {
        APP_INSTANCE = GetModuleHandleW(NULL);
        m_hInstance = APP_INSTANCE;

        WNDCLASSW WC;
        WC.cbClsExtra = 0;
        WC.cbWndExtra = 0;
        WC.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
        WC.hCursor = LoadCursor(NULL, IDC_ARROW);
        WC.hIcon = LoadIcon(NULL, IDI_APPLICATION);
        WC.hInstance = APP_INSTANCE;
        WC.lpfnWndProc = (WNDPROC)wndProcProxy;
        WC.lpszClassName = L"OpenGLClass";
        WC.lpszMenuName = 0;
        WC.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;

        if (!RegisterClassW(&WC))
        {
            return;
        }
    }

    // Set coordinates for window's area rectangle.
    RECT Rect;
    SetRect(&Rect,
        left, top,
        left + width, top + height);

    // Adjust window rectangle.
    AdjustWindowRect(&Rect, WS_OVERLAPPEDWINDOW, false);

    // Create window.
    m_hWnd = CreateWindow(L"OpenGLClass",
        L"Quaoar >>> 3D",
        WS_OVERLAPPEDWINDOW,
        Rect.left, Rect.top, // Adjusted x, y positions
        Rect.right - Rect.left, Rect.bottom - Rect.top, // Adjusted width and height
        NULL, NULL,
        m_hInstance,
        this);

    // Check if window has been created successfully.
    if (m_hWnd == NULL)
    {
        return;
    }

    // Show window finally.
    ShowWindow(m_hWnd, TRUE);

    HANDLE windowHandle = (HANDLE)m_hWnd;

    this->init(windowHandle);
}

//-----------------------------------------------------------------------------

void Viewer::AddShape(const TopoDS_Shape& shape)
{
    m_shapes.push_back(shape);
}


void Viewer::AddLabel(const Handle(AIS_TextLabel)& label)
{
    m_labels.push_back(label);
}
//-----------------------------------------------------------------------------

//! Starts message loop.
void Viewer::StartMessageLoop()
{
    for (auto sh : m_shapes)
    {
        Handle(AIS_Shape) shape = new AIS_Shape(sh);
        m_context->Display(shape, true);
        m_context->SetDisplayMode(shape, AIS_Shaded, true);

        // Adjust selection style.
        ::AdjustSelectionStyle(m_context);

        // Activate selection modes.
        m_context->Activate(4, true); // faces
        m_context->Activate(2, true); // edges
    }

    MSG Msg;
    while (!m_bQuit)
    {
        switch (::MsgWaitForMultipleObjectsEx(0, NULL, 12, QS_ALLINPUT, 0))
        {
        case WAIT_OBJECT_0:
        {
            while (::PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
            {
                if (Msg.message == WM_QUIT)
                    m_bQuit = true;// return;

                ::TranslateMessage(&Msg);
                ::DispatchMessage(&Msg);
            }
        }
        }
    }
}

//! Starts message loop.
void Viewer::StartMessageLoop2()
{
    for (auto sh : m_labels)
    {
        //Handle(AIS_Shape) shape = new AIS_Shape(sh);
        m_context->Display(sh,0);
        //m_context->SetDisplayMode(shape, AIS_Shaded, true);

        // Adjust selection style.
        ::AdjustSelectionStyle(m_context);

        // Activate selection modes.
        m_context->Activate(4, true); // faces
        m_context->Activate(2, true); // edges
    }

    MSG Msg;
    while (!m_bQuit)
    {
        switch (::MsgWaitForMultipleObjectsEx(0, NULL, 12, QS_ALLINPUT, 0))
        {
        case WAIT_OBJECT_0:
        {
            while (::PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
            {
                if (Msg.message == WM_QUIT)
                    m_bQuit = true;// return;

                ::TranslateMessage(&Msg);
                ::DispatchMessage(&Msg);
            }
        }
        }
    }
}

//-----------------------------------------------------------------------------

void Viewer::init(const HANDLE& windowHandle)
{
    static Handle(Aspect_DisplayConnection) displayConnection;
    //
    if (displayConnection.IsNull())
        displayConnection = new Aspect_DisplayConnection();

    HWND winHandle = (HWND)windowHandle;
    //
    if (winHandle == NULL)
        return;

    // Create OCCT viewer.
    Handle(OpenGl_GraphicDriver)
        graphicDriver = new OpenGl_GraphicDriver(displayConnection, false);

    m_viewer = new V3d_Viewer(graphicDriver);

    // Lightning.
    Handle(V3d_DirectionalLight) LightDir = new V3d_DirectionalLight(V3d_Zneg, Quantity_Color(Quantity_NOC_GRAY97), 1);
    Handle(V3d_AmbientLight)     LightAmb = new V3d_AmbientLight();
    //
    LightDir->SetDirection(1.0, -2.0, -10.0);
    //
    m_viewer->AddLight(LightDir);
    m_viewer->AddLight(LightAmb);
    m_viewer->SetLightOn(LightDir);
    m_viewer->SetLightOn(LightAmb);

    // AIS context.
    m_context = new AIS_InteractiveContext(m_viewer);

    // Configure some global props.
    const Handle(Prs3d_Drawer)& contextDrawer = m_context->DefaultDrawer();
    //
    if (!contextDrawer.IsNull())
    {
        const Handle(Prs3d_ShadingAspect)& SA = contextDrawer->ShadingAspect();
        const Handle(Graphic3d_AspectFillArea3d)& FA = SA->Aspect();
        contextDrawer->SetFaceBoundaryDraw(true); // Draw edges.
        FA->SetEdgeOff();

        // Fix for inifinite lines has been reduced to 1000 from its default value 500000.
        contextDrawer->SetMaximalParameterValue(1000);
    }

    // Main view creation.
    m_view = m_viewer->CreateView();
    m_view->SetImmediateUpdate(false);

    // Event manager is constructed when both contex and view become available.
    m_evtMgr = new ViewerInteractor(m_view, m_context);

    // Aspect window creation
    m_wntWindow = new WNT_Window(winHandle);
    m_view->SetWindow(m_wntWindow, nullptr);
    //
    if (!m_wntWindow->IsMapped())
    {
        m_wntWindow->Map();
    }
    m_view->MustBeResized();

    // View settings.
    m_view->SetShadingModel(V3d_PHONG);

    // Configure rendering parameters
    Graphic3d_RenderingParams& RenderParams = m_view->ChangeRenderingParams();
    RenderParams.IsAntialiasingEnabled = true;
    RenderParams.NbMsaaSamples = 8; // Anti-aliasing by multi-sampling
    RenderParams.IsShadowEnabled = false;
    RenderParams.CollectedStats = Graphic3d_RenderingParams::PerfCounters_NONE;
}

//-----------------------------------------------------------------------------

LRESULT WINAPI Viewer::wndProcProxy(HWND   hwnd,
    UINT   message,
    WPARAM wparam,
    LPARAM lparam)
{
    if (message == WM_CREATE)
    {
        // Save pointer to our class instance (sent on window create) to window storage.
        CREATESTRUCTW* pCreateStruct = (CREATESTRUCTW*)lparam;
        SetWindowLongPtr(hwnd, int(GWLP_USERDATA), (LONG_PTR)pCreateStruct->lpCreateParams);
    }

    // Get pointer to our class instance.
    Viewer* pThis = (Viewer*)GetWindowLongPtr(hwnd, int(GWLP_USERDATA));
    return (pThis != NULL) ? pThis->wndProc(hwnd, message, wparam, lparam)
        : DefWindowProcW(hwnd, message, wparam, lparam);
}

//-----------------------------------------------------------------------------

//! Window procedure.
LRESULT Viewer::wndProc(HWND   hwnd,
    UINT   message,
    WPARAM wparam,
    LPARAM lparam)
{
    if (m_view.IsNull())
        return DefWindowProc(hwnd, message, wparam, lparam);

    switch (message)
    {
    case WM_PAINT:
    {
        PAINTSTRUCT aPaint;
        BeginPaint(m_hWnd, &aPaint);
        EndPaint(m_hWnd, &aPaint);
        m_evtMgr->ProcessExpose();
        break;
    }
    case WM_SIZE:
    {
        m_evtMgr->ProcessConfigure();
        break;
    }
    case WM_MOVE:
    case WM_MOVING:
    case WM_SIZING:
    {
        switch (m_view->RenderingParams().StereoMode)
        {
        case Graphic3d_StereoMode_RowInterlaced:
        case Graphic3d_StereoMode_ColumnInterlaced:
        case Graphic3d_StereoMode_ChessBoard:
        {
            // track window moves to reverse stereo pair
            m_view->MustBeResized();
            m_view->Update();
            break;
        }
        default:
            break;
        }
        break;
    }
    case WM_KEYUP:
    case WM_KEYDOWN:
    {
        const Aspect_VKey vkey = WNT_Window::VirtualKeyFromNative((int)wparam);
        //
        if (vkey != Aspect_VKey_UNKNOWN)
        {
            const double timeStamp = m_evtMgr->EventTime();
            if (message == WM_KEYDOWN)
            {
                m_evtMgr->KeyDown(vkey, timeStamp);
            }
            else
            {
                m_evtMgr->KeyUp(vkey, timeStamp);
            }
        }
        break;
    }
    case WM_LBUTTONUP:
    case WM_MBUTTONUP:
    case WM_RBUTTONUP:
    case WM_LBUTTONDOWN:
    case WM_MBUTTONDOWN:
    case WM_RBUTTONDOWN:
    {
        const Graphic3d_Vec2i pos(LOWORD(lparam), HIWORD(lparam));
        const Aspect_VKeyFlags flags = WNT_Window::MouseKeyFlagsFromEvent(wparam);
        Aspect_VKeyMouse button = Aspect_VKeyMouse_NONE;
        //
        switch (message)
        {
        case WM_LBUTTONUP:
        case WM_LBUTTONDOWN:
            button = Aspect_VKeyMouse_LeftButton;
            break;
        case WM_MBUTTONUP:
        case WM_MBUTTONDOWN:
            button = Aspect_VKeyMouse_MiddleButton;
            break;
        case WM_RBUTTONUP:
        case WM_RBUTTONDOWN:
            button = Aspect_VKeyMouse_RightButton;
            break;
        }
        if (message == WM_LBUTTONDOWN
            || message == WM_MBUTTONDOWN
            || message == WM_RBUTTONDOWN)
        {
            SetFocus(hwnd);
            SetCapture(hwnd);

            if (!m_evtMgr.IsNull())
                m_evtMgr->PressMouseButton(pos, button, flags, false);
        }
        else
        {
            ReleaseCapture();

            if (!m_evtMgr.IsNull())
                m_evtMgr->ReleaseMouseButton(pos, button, flags, false);
        }

        m_evtMgr->FlushViewEvents(m_context, m_view, true);
        break;
    }
    case WM_MOUSEWHEEL:
    {
        const int    delta = GET_WHEEL_DELTA_WPARAM(wparam);
        const double deltaF = double(delta) / double(WHEEL_DELTA);
        //
        const Aspect_VKeyFlags flags = WNT_Window::MouseKeyFlagsFromEvent(wparam);
        //
        Graphic3d_Vec2i pos(int(short(LOWORD(lparam))), int(short(HIWORD(lparam))));
        POINT cursorPnt = { pos.x(), pos.y() };
        if (ScreenToClient(hwnd, &cursorPnt))
        {
            pos.SetValues(cursorPnt.x, cursorPnt.y);
        }

        if (!m_evtMgr.IsNull())
        {
            m_evtMgr->UpdateMouseScroll(Aspect_ScrollDelta(pos, deltaF, flags));
            m_evtMgr->FlushViewEvents(m_context, m_view, true);
        }
        break;
    }
    case WM_MOUSEMOVE:
    {
        Graphic3d_Vec2i pos(LOWORD(lparam), HIWORD(lparam));
        Aspect_VKeyMouse buttons = WNT_Window::MouseButtonsFromEvent(wparam);
        Aspect_VKeyFlags flags = WNT_Window::MouseKeyFlagsFromEvent(wparam);

        // don't make a slide-show from input events - fetch the actual mouse cursor position
        CURSORINFO cursor;
        cursor.cbSize = sizeof(cursor);
        if (::GetCursorInfo(&cursor) != FALSE)
        {
            POINT cursorPnt = { cursor.ptScreenPos.x, cursor.ptScreenPos.y };
            if (ScreenToClient(hwnd, &cursorPnt))
            {
                // as we override mouse position, we need overriding also mouse state
                pos.SetValues(cursorPnt.x, cursorPnt.y);
                buttons = WNT_Window::MouseButtonsAsync();
                flags = WNT_Window::MouseKeyFlagsAsync();
            }
        }

        if (m_wntWindow.IsNull() || (HWND)m_wntWindow->HWindow() != hwnd)
        {
            // mouse move events come also for inactive windows
            break;
        }

        if (!m_evtMgr.IsNull())
        {
            m_evtMgr->UpdateMousePosition(pos, buttons, flags, false);
            m_evtMgr->FlushViewEvents(m_context, m_view, true);
        }
        break;
    }
    default:
    {
        break;
    }

    case WM_DESTROY:
        m_bQuit = true;
    }
    return DefWindowProc(hwnd, message, wparam, lparam);
}

2、显示文本

OpenCasCade 你好啊

#include "TCollection_ExtendedString.hxx"#include "Resource_Unicode.hxx"#include "AIS_TextLabel.hxx"#include "AIS_InteractiveContext.hxx"#include"Viewer.h"int main() {    TCollection_ExtendedString tostr;    Standard_CString str = "OpenCasCade 你好啊";    Resource_Unicode::ConvertGBToUnicode(str, tostr);    Handle(AIS_TextLabel) aLabel = new AIS_TextLabel();    aLabel->SetText(tostr);    aLabel->SetColor(Quantity_NOC_RED);    aLabel->SetFont("SimHei");    Viewer vout(50, 50, 500, 500);    vout << aLabel;    vout.StartMessageLoop2();    return 0;    }

霜吹花落

#include "TCollection_ExtendedString.hxx"#include "Resource_Unicode.hxx"#include "AIS_TextLabel.hxx"#include "AIS_InteractiveContext.hxx"#include"Viewer.h"int main() {    TCollection_ExtendedString tostr;    Standard_CString str = "霜吹花落";    Resource_Unicode::ConvertGBToUnicode(str, tostr);    Handle(AIS_TextLabel) aLabel = new AIS_TextLabel();    aLabel->SetPosition(gp_Pnt(0, 0, 0));    aLabel->SetText(tostr);    aLabel->SetHJustification(Graphic3d_HTA_CENTER);    aLabel->SetVJustification(Graphic3d_VTA_CENTER);    aLabel->SetHeight(50);    aLabel->SetZoomable(false);//如果允许缩放,你会发现放大后字太难看了    aLabel->SetAngle(0);    aLabel->SetColor(Quantity_NOC_YELLOW);    aLabel->SetFont("SimHei");//一定要设置合适的字体,不然不能实现功能    //如果有一天你需要鼠标选中文本时,下面代码有用,高亮文本    Handle(Prs3d_Drawer) aStyle = new Prs3d_Drawer(); // 获取高亮风格    aLabel->SetHilightAttributes(aStyle);    aStyle->SetMethod(Aspect_TOHM_COLOR);    aStyle->SetColor(Quantity_NOC_RED);    // 设置高亮颜色    aStyle->SetDisplayMode(1); // 整体高亮    aLabel->SetDynamicHilightAttributes(aStyle);    Viewer vout(50, 50, 500, 500);    vout << aLabel;    vout.StartMessageLoop2();    return 0;    }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/489394.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

入门编程,一定要从C语言开始吗?

对于编程入门学习者&#xff0c;C语言肯定不是首选。建议先确定自己的发展方向&#xff0c; 如果打算做Web 开发&#xff0c;可以先从学习HTML,CSS,Javascript开始&#xff0c;后台使用Node.JS&#xff0c;也是用Javascript 来编程, 可降低入门门槛。 在开始前我有一些资料…

MySQL索引优化、SQL优化-持续更新

背景 成本最低的优化手段&#xff0c;面试常问的面试题。 下面主要是讲InnoDB存储引擎的索引&#xff0c;InnoDB也是实际项目用的最多的存储引擎。 优势 提高数据查询效率。 缺点 占用空间、降低了增、删、改速度&#xff0c;因为要维护索引 原理 底层是B树数据结构。 …

关于Web APP 促进临床预测模型进入临床实践的讨论

关于Web APP 促进临床预测模型进入临床实践的讨论 关键词&#xff1a; 临床预测模型、Web APP、实践、标准、讨论、分享 近年来&#xff0c;随着机器学习技术的快速发展&#xff0c;临床预测模型在辅助诊断、预后评估、治疗方案选择等方面展现出巨大潜力。然而&#xff0c;将…

工时表软件:项目管理的效率利器

在当今的项目管理实践中&#xff0c;时间是最宝贵的资产之一。精准地追踪和管理项目工时对于项目的成功至关重要。工时表软件作为一种现代管理工具&#xff0c;其应用不仅简化了项目管理流程&#xff0c;还提高了工作效率&#xff0c;已成为现代企业管理不可或缺的一项利器。 …

[Vue warn]: Invalid vnode type when creating vnode: false

如题&#xff0c;意思是创建vnode时&#xff0c;vnode类型无效:false。 根据右边的索引点进去&#xff0c;发现定位的是组件loading。搜索loading发现声明了变量loading&#xff0c;更改后问题消失。

MySQL数据库高阶语句①

目录 一.按关键字排序 1.单字段排序 &#xff08;1&#xff09;按分数排序 &#xff08;2&#xff09;结合where进行条件筛选 2.多字段排序 &#xff08;1&#xff09;查询学生信息先按兴趣id升序排序&#xff0c;再按id升序排序 &#xff08;2&#xff09;查询信息按兴…

视频素材网站哪个比较好?8个优质视频素材软件app推荐

在探索那些能够让视频作品焕发生机的宝藏网站时&#xff0c;一个好的短视频素材库不仅能提升作品的视觉效果&#xff0c;还能赋予作品更深的情感层次。为了帮助你更好地寻找到这些珍贵的资源&#xff0c;以下是一系列精选的视频素材网站&#xff0c;全面支持你的视频创作需求。…

低照度图像增强算法---传统算法篇

YOLOv8n原图检测YOLOv8n增强后检测召回率和置信度都有提升 前言 这篇博客讲讲低照度,大家都催我出一些内容,没想到这么多同学搞这个,恰好我也做过这方面的一些工作,那今天就来讲解一些方法,低照度的图像增强大体分“传统算法”和“深度学习算法”; 目前低照度的图像增…

linux文本三剑客 --- grep、sed、awk

1、grep grep&#xff1a;使用正则表达式搜索文本&#xff0c;将匹配的行打印出来&#xff08;匹配到的标红&#xff09; 命令格式&#xff1a;grep [option] pattern file <1> 命令参数 -A<显示行数>&#xff1a;除了显示符合范本样式的那一列之外&#xff0c;并…

bsd猜想 Murmuration of Eliptic Curves(笔记)

BSD Alexey Pozdnyakov (University of Connecticut) YUTUBE视频&#xff0c; B站搬运地址新生代女数学家Nina Zubrilina得到椭圆曲线椋鸟群飞模式精确公式与证明 Arithmetic Geometry算术几何 希尔伯特第十问题 希尔伯特第十问题&#xff08;Hilbert’s Tenth Problem&#…

Elasticsearch8 - Docker安装Elasticsearch8.12.2

前言 最近在学习 ES&#xff0c;所以需要在服务器上装一个单节点的 ES 服务器环境&#xff1a;centos 7.9 安装 下载镜像 目前最新版本是 8.12.2 docker pull docker.elastic.co/elasticsearch/elasticsearch:8.12.2创建配置 新增配置文件 elasticsearch.yml http.host…

WordPress网站已经安装了SSL证书,但浏览器仍然提示不安全

WordPress网站已经安装了SSL证书&#xff0c;但浏览器仍然提示不安全 昨天我们新建了一个WordPress的网站&#xff0c;在已经安装了SSL证书的情况下&#xff0c;访问网站仍然会提示不安全。 我们使用的是Hostease提供的虚拟主机产品&#xff0c;之前从未出过这样的情况&#x…

【优选算法】专题1 -- 双指针 -- 复写0

前言&#xff1a; 补充一下前文没有写到的双指针入门知识&#xff1a;专题1 -- 双指针 -- 移动零 目录 基础入门知识&#xff1a; 1. 复写零&#xff08;easy&#xff09; 1. 题⽬链接&#xff1a;1089.复习0 - 力扣&#xff08;LeetCode&#xff09; 2. 题⽬描述&#xff…

大词汇量高质量3D物体生成需要解决哪些问题?如何解决?

作者:Vallee | 来源:计算机视觉工坊 在公众号「计算机视觉工坊」后台,回复「原论文」可获取论文pdf和代码链接 DiffTF: 基于Transformer的大词汇量3D扩散模型 大词汇量3D物体生成 最近基于扩散模型的3D生成方法大火,但如何生成大量类别且高质量的3D模型还没得到很好地解决…

喜获千万元价值补贴,探索 AI 领域新应用:Zilliz 全力支持 AI 初创企业

价值 1000 万元的大额补贴&#xff01;得到领先全行业的向量数据库团队支持&#xff01;尽享独家生态资源&#xff01;「Zilliz AI 初创计划」正式开启&#xff01; 「Zilliz AI 初创计划」是 Zilliz 面向 AI 初创企业推出的一项扶持计划&#xff0c;预计提供总计 1000 万元的 …

Docker 哲学 - tmpfs 存储

tem&#xff1a;temporary 暂时的 背景&#xff1a;只有在 linux 有该种方式 If youre running Docker on Linux, you have a third option: tmpfs mounts. When you create a container with a tmpfs mount, the container can create files outside the containers writabl…

数据库-事务

简介 事务&#xff08;Transaction&#xff09;是指数据库管理系统&#xff08;DBMS&#xff09;中执行的一个操作序列&#xff0c;这些操作要么全部成功执行&#xff0c;要么全部不执行&#xff0c;且在执行过程中保持数据的一致性。 例如&#xff1a; 张三给李四转账&#…

知识图谱推理算法综述(上):基于距离和图传播的模型

背景 知识图谱系统的建设需要工程和算法的紧密配合&#xff0c;在工程层面&#xff0c;去年蚂蚁集团联合 OpenKG 开放知识图谱社区&#xff0c;共同发布了工业级知识图谱语义标准 OpenSPG 并开源&#xff1b;算法层面&#xff0c;蚂蚁从知识融合&#xff0c;知识推理&#xff…

前三次笔记、表单和五彩导航

骨架&#xff1a; 笔记&#xff1a; 需要有包裹的内容&#xff0c;用双标签&#xff0c;不需要包裹内容就可以完成的操作用单标签 标签之间的关系只有父子关系和兄弟关系 标题标签只有h1-h6&#xff0c;且大小依次递减&#xff0c;独占一行 在段落标签“<p> </p>”…

【物联网开源平台】tingsboard二次开发

别看这篇了&#xff0c;这篇就当我的一个记录&#xff0c;我有空我再写过一篇&#xff0c;编译的时候出现了一个错误&#xff0c;然后我针对那一个错误执行了一个命令&#xff0c;出现了绿色的succes,我就以为整个tingsboard项目编译成功了&#xff0c;后面发现的时候&#xff…