[vtkusers] vtkGeoAlignedImageSource SetLatitudeRange and SetLongitudeRange
Aashish Chaudhary
aashish.chaudhary at kitware.com
Mon Oct 25 08:59:44 EDT 2010
Donny,
This could be a possible bug. I will have a look.
Thanks for reporting this.
Regards,
Aashish
On Sun, Oct 24, 2010 at 1:54 PM, Donny <donnyz at charter.net> wrote:
> 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
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
--
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
More information about the vtkusers
mailing list