资源简介
使用qwtPlot3D实现三维曲线、轨迹绘制的例子,使用qt基于c++开发,可以直接运行,无需额外配置,里面包含了所有需要的库文件和头文件,弄了好久才弄出来的,我没有在网上找到其他的类似的代码,在一些博主和热心人的帮助下,完成了例子,谢谢他们。希望能对大家有用

代码片段和文件信息
#include “line3d.h“
using namespace Qwt3D;
Qwt3D::Line3D::Line3D()
{
rgba.a = 1;
rgba.b = 0.3;
rgba.r = 0.6;
rgba.g = 1;
}
Qwt3D::Line3D::Line3D(double thickbool smooth)
{
lineThick = thick;
smooth_ = smooth;
rgba.a = 1;
rgba.b = 0.3;
rgba.r = 0.6;
rgba.g = 1;
}
void Qwt3D::Line3D::configure(double thick bool smooth)
{
lineThick = thick;
smooth_ = smooth;
}
void Qwt3D::Line3D::drawBegin()
{
setDeviceLineWidth(lineThick);
oldstate_ = glIsEnabled(GL_LINE_SMOOTH);
if (smooth_)
glEnable(GL_LINE_SMOOTH);
else
glDisable(GL_LINE_SMOOTH);
//glPointSize(10);
glBegin( GL_LINE_STRIP);
}
void Qwt3D::Line3D::drawEnd()
{
glEnd();
if (oldstate_)
glEnable(GL_LINE_SMOOTH);
else
glDisable(GL_LINE_SMOOTH);
}
void Qwt3D::Line3D::draw(Qwt3D::Triple const& pos)
{
glColor4d(rgba.rrgba.grgba.brgba.a);
glVertex3d(pos.xpos.ypos.z);
}
void Qwt3D::Line3D::draw()
{
for (int i = 0; i < lineData.size(); i ++)
{
draw(lineData[i]);
}
}
void Qwt3D::Line3D::rdraw()
{
for (int i = lineData.size()-1; i >0; i--)
{
draw(lineData[i]);
}
}
void Qwt3D::Line3D::add(Qwt3D::Triple const & t)
{
lineData.push_back(t);
}
void Qwt3D::Line3D::setLineColor(RGBA color)
{
this->rgba = color;
}
//void Qwt3D::Line3D::getColor(int pointIndex)
//{
//}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-19 10:57 qwtplot3D\
目录 0 2019-05-19 10:57 qwtplot3D\qwtplot3D\
文件 1351 2019-03-26 16:07 qwtplot3D\qwtplot3D\ILD.pro
目录 0 2019-05-19 10:57 qwtplot3D\qwtplot3D\include\
文件 6863 2007-05-20 17:51 qwtplot3D\qwtplot3D\include\gl2ps.h
文件 756 2016-11-18 18:03 qwtplot3D\qwtplot3D\include\mylineplot3d.h
文件 1509 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_autoptr.h
文件 1440 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_autoscaler.h
文件 5895 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_axis.h
文件 2188 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_color.h
文件 2450 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_colorlegend.h
文件 3760 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_coordsys.h
文件 1216 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_drawable.h
文件 2177 2016-11-04 17:30 qwtplot3D\qwtplot3D\include\qwt3d_enrichment.h
文件 3434 2019-03-20 16:37 qwtplot3D\qwtplot3D\include\qwt3d_enrichment_std.h
文件 1671 2005-07-10 16:54 qwtplot3D\qwtplot3D\include\qwt3d_function.h
文件 1601 2007-05-20 17:51 qwtplot3D\qwtplot3D\include\qwt3d_global.h
文件 398 2005-07-10 16:54 qwtplot3D\qwtplot3D\include\qwt3d_graphplot.h
文件 943 2005-07-10 16:54 qwtplot3D\qwtplot3D\include\qwt3d_gridmapping.h
文件 517 2005-07-19 17:40 qwtplot3D\qwtplot3D\include\qwt3d_helper.h
文件 3864 2005-09-05 16:27 qwtplot3D\qwtplot3D\include\qwt3d_io.h
文件 2767 2005-07-10 16:54 qwtplot3D\qwtplot3D\include\qwt3d_io_gl2ps.h
文件 874 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_io_reader.h
文件 2357 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_label.h
文件 497 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_mapping.h
文件 399 2005-07-10 16:54 qwtplot3D\qwtplot3D\include\qwt3d_multiplot.h
文件 2797 2017-08-31 17:15 qwtplot3D\qwtplot3D\include\qwt3d_openglhelper.h
文件 1551 2005-07-10 16:54 qwtplot3D\qwtplot3D\include\qwt3d_parametricsurface.h
文件 13604 2005-08-18 09:49 qwtplot3D\qwtplot3D\include\qwt3d_plot.h
文件 1944 2005-09-05 16:27 qwtplot3D\qwtplot3D\include\qwt3d_portability.h
文件 2912 2005-09-05 20:41 qwtplot3D\qwtplot3D\include\qwt3d_scale.h
............此处省略18个文件信息
- 上一篇:UG二次来发 外部模式
- 下一篇:MFC教师课程管理系统+mysql
相关资源
- 国际象棋的qt源代码
- QT上位机
- qt媒体播放器
- QT5开发及源代码
- qt完整项目
- C++ mqtt 用法
- qt进度条(RoundProgressBar)
- Qt的纽带风格界面实现(Office Ribbon风
- qt 实现画板
- QT Hisi demo
- 基础qt数据库读取和显示
- Qt画图工具源码(qgraphics draw)
- Qt查询SQLite数据库
- QtWebApp
- Qt 实现心电图
- Qt实现 屏幕截图
- qt cmd实现ping
- QT实现USB摄像头拍照
- qt texteditor(富文本编辑器)
- qt 串口助手源码
- qt登录富文本编辑器和文档打印设计
- 使用QWT库实现接收串口数据,并根据
- QT SQLite封装
- QT半透明效果界面
- Qt5串口通信-windows
- 计算机远程唤醒和关机
- 使用wxWidgets进行跨平台程序开发
- QT 动态曲线
- QT视频播放器(基于FFmpeg)
- 嵌入式QtC++编程课件
评论
共有 条评论