资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

C++VTK鼠标网格表面绘制曲线-创新互联

程序示例精选

成都创新互联公司长期为上1000家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为永定企业提供专业的网站制作、成都网站制作,永定网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。

C++ VTK鼠标表面绘制曲线

如需安装运行环境或远程调试,见文章底部微信名片,由专业技术人员远程协助!

前言

C++ VTK鼠标表面绘制曲线,功能完善,代码整洁,规则,易读。


文章目录         一、所需工具软件         二、使用步骤                 1. 主要代码                 2. 运行结果          三、在线协助
一、所需工具软件           1. Visual Studio以上           2. VTK库 二、使用步骤 1.主要代码

代码如下(示例):

#include#include#include#include#include#include#include#include#include#includenamespace {

	class MyCallback : public vtkCommand
	{
	public:
		static MyCallback* New()
		{
			return new MyCallback;
		}
		MyCallback()
		{
		}

		virtual void Execute(vtkObject* caller, unsigned long, void*)
		{
			vtkContourWidget* contourWidget =
				reinterpret_cast(caller);
			vtkContourRepresentation* rep = static_cast(

		}

		void SetSphereSource(vtkSmartPointersphere)
		{
			this->SphereSource = sphere;
		}

	private:
		vtkSmartPointerSphereSource;
	};

} // namespace

int main(int, char*[])
{
	vtkNewcolors;

	vtkNewsphereSource;
	sphereSource->SetRadius(5);
	sphereSource->Update();

	vtkNewmapper;
	mapper->SetInputConnection(sphereSource->GetOutputPort());

	vtkNewactor;
	actor->SetMapper(mapper);
	actor->GetProperty()->SetColor(colors->GetColor3d("MistyRose").GetData());

	// Create the RenderWindow, Renderer
	vtkNewrenderer;
	vtkNewrenderWindow;
	renderWindow->AddRenderer(renderer);
	renderWindow->SetWindowName("PolygonalSurfacePointPlacer");

	vtkNewinteractor;
	interactor->SetRenderWindow(renderWindow);

	renderer->AddActor(actor);
	renderer->SetBackground(colors->GetColor3d("CadetBlue").GetData());

	vtkNewcontourWidget;
	contourWidget->SetInteractor(interactor);

	vtkOrientedGlyphContourRepresentation* rep =
		dynamic_cast(
			contourWidget->GetRepresentation());

	vtkNewpointPlacer;
	pointPlacer->AddProp(actor);
	pointPlacer->GetPolys()->AddItem(sphereSource->GetOutput());

	rep->GetLinesProperty()->SetColor(colors->GetColor3d("Crimson").GetData());
	rep->GetLinesProperty()->SetLineWidth(3.0);
	rep->SetPointPlacer(pointPlacer);

	contourWidget->EnabledOn();
	renderer->ResetCamera();
	renderWindow->Render();

	interactor->Start();

	return EXIT_SUCCESS;
}
4.运行结果如下: 

三、在线协助: 

如需安装运行环境或远程调试,见文章底部微信名片,由专业技术人员远程协助!

我的主页:https://blog.csdn.net/alicema1111?type=blog

你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧


文章标题:C++VTK鼠标网格表面绘制曲线-创新互联
本文网址:http://cdkjz.cn/article/dcdsoi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220