[vtkusers] vtkGeoAlignedImageSource SetLatitudeRange and SetLongitudeRange
Donny
donnyz at charter.net
Sun Oct 24 13:54:50 EDT 2010
I am using vtkGeoView and would just like to apply a
vtkGeoAlignedImageSource to just the lower 48 United States. I have an image
that represents the US with extents of -126 to -66 Degrees Longitude and 24
to 50 Degrees Latitude. I thought I could just call SetLatitudeRange and
SetLongitudeRange on the image source object. This still wraps the image
around the whole globe, just at a lower resolution. Can someone tell me how
I can accomplish this.
m_geoview = vtkGeoView::New();
m_geoview->DisplayHoverTextOff();
m_geoview->GetRenderWindow()->SetMultiSamples(0);
m_geoview->GetRenderWindow()->SetSize(400,400);
vtkSmartPointer<vtkGeoTerrain> terrain =
vtkSmartPointer<vtkGeoTerrain>::New();
vtkGeoGlobeSource* globeSource = vtkGeoGlobeSource::New();
globeSource->Initialize();
terrain->SetSource(globeSource);
m_geoview->SetTerrain(terrain);
vtkSmartPointer<vtkGeoAlignedImageRepresentation> imageRep =
vtkSmartPointer<vtkGeoAlignedImageRepresentation>::New();
vtkGeoAlignedImageSource* alignedSource = vtkGeoAlignedImageSource::New();
vtkSmartPointer<vtkBMPReader> reader =
vtkSmartPointer<vtkBMPReader>::New();
reader->SetFileName("C:\\usa48.bmp");
reader->Update();
alignedSource->SetImage(reader->GetOutput());
alignedSource->Initialize();
alignedSource->SetLatitudeRange(24.0, 50.0);
alignedSource->SetLongitudeRange(-126.0, -66.0);
imageRep->SetSource(alignedSource);
m_geoview->AddRepresentation(imageRep);
m_geoview->ResetCamera();
m_geoview->GetRenderer()->GetActiveCamera()->Zoom(1.2);
vtkViewTheme* theme = vtkViewTheme::New();
m_geoview->ApplyViewTheme(theme);
theme->Delete();
m_geoview->Render();
Donny Zimmerman
donnyz at charter.net
308-227-1756
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101024/0d786af3/attachment.htm>
More information about the vtkusers
mailing list