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); // ShadedselDrawer->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 oncestatic 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 positionsRect.right - Rect.left, Rect.bottom - Rect.top, // Adjusted width and heightNULL, 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); // facesm_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); // facesm_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 creationm_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 parametersGraphic3d_RenderingParams& RenderParams = m_view->ChangeRenderingParams();RenderParams.IsAntialiasingEnabled = true;RenderParams.NbMsaaSamples = 8; // Anti-aliasing by multi-samplingRenderParams.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 pairm_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 positionCURSORINFO 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 statepos.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 windowsbreak;}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;    }

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

从数据页的角度看 B+ 树

资料来源 : 小林coding 小林官方网站 : 小林coding (xiaolincoding.com) 大家背八股文的时候&#xff0c;都知道 MySQL 里 InnoDB 存储引擎是采用 B 树来组织数据的。 这点没错&#xff0c;但是大家知道 B 树里的节点里存放的是什么呢&#xff1f;查询数据的过程又是怎样的&am…

填补市场空白,Apache TsFile 如何重新定义时序数据管理

欢迎全球开发者参与到 Apache TsFile 项目中。 刚刚过去的 2023 年&#xff0c;国产开源技术再次获得国际认可。 2023 年 11 月 15 日&#xff0c;经全球最大的开源软件基金会 ASF 董事会投票决议&#xff0c;时序数据文件格式 TsFile 正式通过&#xff0c;直接晋升为 Apache T…

【C++从练气到飞升】05---运算符重载

&#x1f388;个人主页&#xff1a;库库的里昂 ✨收录专栏&#xff1a;C从练气到飞升 &#x1f389;鸟欲高飞先振翅&#xff0c;人求上进先读书。 目录 ⛳️推荐 一、运算符重载的引用 二、运算符重载 三、赋值运算符重载 1 .赋值运算符重载格式: 2 .赋值运算符只能重载成…

【智能算法】飞蛾扑火算法(MFO)原理及实现

目录 1.背景2.算法原理2.1算法思想2.2算法过程 3.结果展示4.参考文献 1.背景 2015年&#xff0c;Mirjalili等人受到飞蛾受到火焰吸引行为启发&#xff0c;提出了飞蛾算法(Moth-Flame Optimization&#xff0c;MFO)。 2.算法原理 2.1算法思想 MFO基于自然界中飞蛾寻找光源的…

Qt读取本地系统时间的几种方式

一&#xff0c;使用Windows API函数GetLocalTime&#xff08;精确到毫秒&#xff09; typedef struct _SYSTEMTIME //SYSTEMTIME结构体定义 {   WORD wYear;//年   WORD wMonth;//月   WORD wDayOfWeek;//星期&#xff0c;0为星期日&#xff0c;1为星期一&#xff0c…

PCL ICP配准高阶用法——统计每次迭代的配准误差并可视化

目录 一、概述二、代码实现三、可视化代码四、结果展示本文由CSDN点云侠原创,原文链接。如果你不是在点云侠的博客中看到该文章,那么此处便是不要脸的爬虫。 一、概述 在进行论文写作时,需要做对比实验,来分析改进算法的性能,期间用到了迭代误差分布统计的比较分析,为直…

Claude 3似乎比GPT-4性能更高,更多的人在尝试使用它

Anthropic 是 OpenAI 的主要竞争对手之一&#xff0c;于 3 月初推出了其最新的大型语言模型 (LLM)&#xff0c;称为 Claude 3。事实证明&#xff0c;Claude 3 的性能优于 OpenAI 的旗舰产品 GPT-4&#xff0c;这让 AI 社区感到惊讶&#xff0c;这标志着 GPT-4 的第一个实例被超…

Java只有中国人在搞了吗?

还是看你将来想干啥。想干应用架构&#xff0c;与Java狗谈笑风生&#xff0c;沆瀣一气&#xff0c;你就好好写Java&#xff0c;学DDD&#xff0c;看Clean Architecture。你想成为炼丹玄学工程师&#xff0c;年入百万&#xff0c;就选python&#xff0c;专精各种paper。你不在意…

对话李喆:Martech在中国需要转化成以客户需求为驱动的模式

关于SaaS模式在中国的发展&#xff0c;网上出现多种声音。Marteker近期采访了一些行业专家&#xff0c;围绕SaaS模式以及Martech在中国的发展提出独特观点。赛诺贝斯副总裁李喆认为&#xff0c;SaaS可以分为场景化的SaaS、一体化的SaaS和功能化的SaaS&#xff0c;三者都有一定规…

【vue3学习之路(一)】

文章目录 前言一、vue3项目创建1.1环境准备1.1.1 基于 vue-cli 创建&#xff08;脚手架创建&#xff09;1.1.2 基于 vite 创建&#xff08;推荐&#xff09; 二、熟悉流程总结 前言 参考视频&#xff1a;https://www.bilibili.com/video/BV1Za4y1r7KE?p10&spm_id_frompag…

辅助功能IOU(交并比)_3.2

实现两个目标框的交并比候选框在多目标跟踪中的表达方式及相应转换方法 IOU(Intersection over Union)&#xff0c;“交并比”&#xff0c;是计算机视觉和图像处理中常用的一个评价指标&#xff0c;尤其在目标检测任务中用来衡量模型预测的目标框与真实目标框的重合程度。 具体…

(附源码)基于Spring Boot + Vue的招聘平台设计与实现

前言 &#x1f497;博主介绍&#xff1a;✌专注于Java、小程序技术领域和毕业项目实战✌&#x1f497; &#x1f447;&#x1f3fb; 精彩专栏 推荐订阅&#x1f447;&#x1f3fb; 2024年Java精品实战案例《100套》 &#x1f345;文末获取源码联系&#x1f345; &#x1f31…

服务消费微服务

文章目录 1.示意图2.环境搭建1.创建会员消费微服务模块2.删除不必要的两个文件3.检查父子模块的pom.xml文件1.子模块2.父模块 4.pom.xml 添加依赖&#xff08;刷新&#xff09;5.application.yml 配置监听端口和服务名6.com/sun/springcloud/MemberConsumerApplication.java 创…

【windows】安装 Tomcat 及配置环境变量

&#x1f468;‍&#x1f393;博主简介 &#x1f3c5;云计算领域优质创作者   &#x1f3c5;华为云开发者社区专家博主   &#x1f3c5;阿里云开发者社区专家博主 &#x1f48a;交流社区&#xff1a;运维交流社区 欢迎大家的加入&#xff01; &#x1f40b; 希望大家多多支…

【大模型】VS Code(Visual Studio Code)上安装的扩展插件用不了,设置VS Code工作区信任

文章目录 一、找到【管理工作区信任】二、页面显示处于限制模式&#xff0c;改为【信任】三、测试四、总结 【运行环境】win 11 相关文章&#xff1a; 【大模型】直接在VS Code(Visual Studio Code)上安装CodeGeeX插件的过程 【问题】之前在 VS Code上安装 CodeGeeX 插件后&…

Linux命令学习入门

文章目录 登录注销关机重启Vim编辑器快捷键文件目录类打包、解包、压缩和解压指令输出重定向>和追加>>指令时间日期类搜索查找类用户管理文件所有者所在组权限管理变更权限crond任务时间调度crond相关指令&#xff1a;特殊符号说明&#xff1a; at定时任务磁盘分区磁盘…

记录三菱:Works2-FB块

创建一个FB块&#xff0c;启保停&#xff0c;定义输入输出引脚&#xff0c;注意这里的数据类型是Bit 打开主程序&#xff0c;将FB块拖出来 启保停&#xff1a;加入时间设定&#xff0c;时间显示倒着

基于C/C++的easyx实现贪吃蛇游戏

文章目录&#xff1a; 一&#xff1a;运行效果 1.演示 2.思路和功能 二&#xff1a;代码 文件架构 Demo 必备知识&#xff1a;基于C/C的easyx图形库教程 一&#xff1a;运行效果 1.演示 效果图◕‿◕✌✌✌ 基于C/C的easyx实现贪吃蛇游戏运行演示 参考&#xff1a;【C语…

Oracle:ORA-01830错误-更改数据库时间格式

1,先把报错SQL语句拿出来执行&#xff0c;看看是不是报的这个错 ORA-01830: 日期格式图片在转换整个输入字符串之前结束 2&#xff0c;然后查看默认日期格式是不是“YYYY-MM-DD HH24:MI:SS”&#xff08;正确格式&#xff09;。&#xff1b; 执行&#xff1a; SELECT * FRO…

citus的快速开始

准备 dockercitus最新版本&#xff08;docker pull citusdata/citus&#xff09; docker网络 docker network create --subnet172.72.9.0/24 citus-test docker network ls启动citus服务 启动协调节点 docker run -dit --name citus-cod -p 5433:5432 -e POSTGRES_PASSWOR…