艾尔格力
艾尔格力
哈哈
关注数: 2
粉丝数: 17
发帖数: 278
关注贴吧数: 28
mimics 分开连在一起的两部分并且分开建模 如图,想把这两部分分开建模,求各位大佬指导,感激不尽!!!!!!!!!!!!!!!!!!!!!!!!!
请教各位大佬 我想用vtk实现 鼠标左键画曲线 出现问题 我想用鼠标画曲线,就是一段段 直线连接成曲线,代码如下: double x = this->Interactor->GetEventPosition()[0];//xy是否是不断变化的? double y = this->Interactor->GetEventPosition()[1]; /*int x = this->Interactor->GetMousePosition; int y = this->Interactor->GetEventPosition;*/ double worldpos[4]; vtkPoints* points1 = vtkPoints::New(); this->ComputeDisplayToWorld(x, y, 0, worldpos); points1->InsertNextPoint(worldpos[0], worldpos[1], worldpos[2]);//points1得到的是一个点还是很多点? for (int i=0;i<points1->GetNumberOfPoints();i++) {vtkSmartPointer<vtkLineSource> lineSource = vtkSmartPointer<vtkLineSource>::New(); lineSource->SetPoint1(points1->GetPoint(i)); lineSource->SetPoint2(points1->GetPoint(i+1)); vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New(); mapper->SetInputConnection(lineSource->GetOutputPort()); vtkSmartPointer<vtkActor> actor1 = vtkSmartPointer<vtkActor>::New(); actor1->SetMapper(mapper); actor1->GetProperty()->SetColor(1.0, 0.0, 0.0); this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(actor1); renderer->GetRenderWindow()->GetInteractor()->Initialize(); renderer->GetRenderWindow()->GetInteractor()->Render(); 获取当前鼠标位置,然后鼠标移动获取下一位置,然后画线,目前发现线起点总是 在右侧不知道为什么,求大佬指导!
vtk+qt 随鼠标移动绘制曲线 请问有没有大神做过vtk 随着鼠标移动绘制曲线,大概怎么做可以指导一下吗?如果有代码的话更是万分感激!
1
下一页