資源簡介
使用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?????{
?????????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
評論
共有 條評論