本文整理汇总了C++中GeoPoint::getPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoPoint::getPoint方法的具体用法?C++ GeoPoint::getPoint怎么用?C++ GeoPoint::getPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoPoint
的用法示例。
在下文中一共展示了GeoPoint::getPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VisualisePath
void PathVisualiser::VisualisePath(int* path, int len) {
int totColours = 256 * 3;
int thisColour;
renderer->SetBackground(1, 1, 1);
for (int i = 0; i < len; i++) {
int viewIndex = path[i];
GeoPoint* view = oc->geoSphere->getView(oc->path[i]);
float* pos = view->getPoint();
vtkSmartPointer<vtkSphereSource> aViewSphereS = vtkSmartPointer<vtkSphereSource>::New();
aViewSphereS->SetCenter(pos[0], pos[1], pos[2]);
aViewSphereS->SetRadius(sphereRadius);
aViewSphereS->SetPhiResolution(20);
aViewSphereS->SetThetaResolution(20);
thisColour = (totColours / len) * i;
float b = 0;
float g = 0;
float r = 0;
float ifl = (float) i;
float len3rd = (float) (len / 3);
if (ifl < len3rd) {
b = ifl / len3rd;
}
if (ifl >= len3rd && ifl < (2 * len3rd)) {
g = (ifl - len3rd) / len3rd;
}
if (ifl > (2 * len3rd)) {
r = (ifl - (2 * len3rd)) / len3rd;
}
//
//// if(b>1){
//// g=--b;
//// }
//// if(b>1){
//// r=--b;
//// g--;
//// }
cout << " for view " << i << " view " << viewIndex << " pos " << pos[0] << " " << pos[1] << " " << pos[2] << " colours " << r << " " << g << " " << b << endl;
aViewSphereS->Update();
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(aViewSphereS->GetOutputPort());
vtkSmartPointer<vtkActor> aViewSphereActor = vtkSmartPointer<vtkActor>::New();
aViewSphereActor->SetMapper(mapper);
aViewSphereActor->GetProperty()->SetAmbient(1); //SetShading(0);
aViewSphereActor->GetProperty()->SetDiffuse(0.5); //SetShading(0);
aViewSphereActor->GetProperty()->SetSpecular(0.5); //SetShading(0);
//aViewSphereActor->GetProperty()->SetInterpolationToFlat(); //aViewSphereActor->GetProperty()->SetOpacity(0.5);
aViewSphereActor->GetProperty()->SetColor(r, g, b);
renderer->AddActor(aViewSphereActor);
//cout<<"adding actor at "<<pos[0]<<" "<<pos[1]<<" "<<pos[2]<<endl;
}
// Create a sphere
// vtkSmartPointer<vtkSphereSource> sphereSource =
// vtkSmartPointer<vtkSphereSource>::New();
// sphereSource->SetCenter(0.0, 0.0, 0.0);
// sphereSource->SetRadius(2.0);
//
// vtkSmartPointer<vtkPolyDataMapper> mapper =
// vtkSmartPointer<vtkPolyDataMapper>::New();
// mapper->SetInputConnection(sphereSource->GetOutputPort());
//
// vtkSmartPointer<vtkActor> actor =
// vtkSmartPointer<vtkActor>::New();
// actor->SetMapper(mapper);
// renderer->AddActor(actor);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
renderWindow->Render();
renderWindowInteractor->Start();
vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter = vtkSmartPointer<vtkWindowToImageFilter>::New();
windowToImageFilter->SetInput(renderWindow);
vtkSmartPointer<vtkPNGWriter> writer = vtkSmartPointer<vtkPNGWriter>::New();
writer->SetInput(windowToImageFilter->GetOutput());
string filename = "pathVis.png";
windowToImageFilter->Update();
filename = *(oc->resultsPath) + filename;
cout << "OUTPUTTING to " << filename << endl;
writer->SetFileName(filename.c_str());
writer->Write();
}