Commit 1262dc74 authored by Ben Boeckel's avatar Ben Boeckel

Views/Geovis: remove deprecated module

Marked as legacy in 8.2.
parent 1f598d10
set(classes
vtkGeoView
vtkGeoView2D)
vtk_module_add_module(VTK::ViewsGeovis
CLASSES ${classes})
vtk_module_test_data(
Data/CityPopulationsUTF8.txt
Data/NE2_ps_bath_small.jpg
Data/masonry-wide.jpg)
add_subdirectory(Cxx)
#vtk_add_test_cxx(vtkViewsGeovisCxxTests tests
# TestGeoView.cxx
# TestGeoView2D.cxx
# TestGeoView2DPopulation.cxx)
#
#vtk_test_cxx_executable(vtkViewsGeovisCxxTests tests
# RENDERING_FACTORY)
NAME
VTK::ViewsGeovis
LIBRARY_NAME
vtkViewsGeovis
CONDITION
NOT VTK_LEGACY_REMOVE
GROUPS
Views
DEPENDS
VTK::ViewsInfovis
PRIVATE_DEPENDS
VTK::CommonCore
VTK::GeovisCore
VTK::InfovisLayout
VTK::InteractionStyle
VTK::RenderingCore
VTK::ViewsCore
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkGeoView.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
/**
* @class vtkGeoView
* @brief A 3D geospatial view.
*
*
* vtkGeoView is a 3D globe view. The globe may contain a multi-resolution
* geometry source (vtkGeoTerrain), multiple multi-resolution image sources
* (vtkGeoAlignedImageRepresentation), as well as other representations such
* as vtkRenderedGraphRepresentation. At a minimum, the view must have a terrain
* and one image representation. The view uses vtkGeoInteractorStyle to orbit,
* zoom, and tilt the view, and contains a vtkCompassWidget for manipulating
* the camera.
*
* Each terrain or image representation contains a vtkGeoSource subclass which
* generates geometry or imagery at multiple resolutions. As the camera
* position changes, the terrain and/or image representations may ask its
* vtkGeoSource to refine the geometry. This refinement is performed on a
* separate thread, and the data is added to the view when it becomes available.
*
* @sa
* vtkGeoTerrain vtkGeoAlignedImageRepresentation vtkGeoSource
*/
#ifndef vtkGeoView_h
#define vtkGeoView_h
#include "vtkViewsGeovisModule.h" // For export macro
#include "vtkRenderView.h"
class vtkActor;
class vtkAssembly;
class vtkGeoAlignedImageRepresentation;
class vtkGeoInteractorStyle;
class vtkGeoTerrain;
class vtkGlobeSource;
class vtkImageData;
class vtkPolyDataMapper;
class vtkViewTheme;
#if !defined(VTK_LEGACY_REMOVE)
class VTKVIEWSGEOVIS_EXPORT vtkGeoView : public vtkRenderView
{
public:
static vtkGeoView *New();
vtkTypeMacro(vtkGeoView, vtkRenderView);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Adds an image representation with a simple terrain model using
* the image in the specified file as the globe terrain.
*/
vtkGeoAlignedImageRepresentation* AddDefaultImageRepresentation(vtkImageData* image);
/**
* Prepares the view for rendering.
*/
void PrepareForRendering() override;
/**
* Rebuild low-res earth source; call after (re)setting origin.
*/
void BuildLowResEarth( double origin[3] );
//@{
/**
* Whether the view locks the heading when panning.
* Default is off.
*/
virtual void SetLockHeading(bool lock);
virtual bool GetLockHeading();
vtkBooleanMacro(LockHeading, bool);
//@}
/**
* Convenience method for obtaining the internal interactor style.
*/
vtkGeoInteractorStyle* GetGeoInteractorStyle();
/**
* Method to change the interactor style.
*/
virtual void SetGeoInteractorStyle(vtkGeoInteractorStyle* style);
//@{
/**
* The terrain (geometry) model for this earth view.
*/
virtual void SetTerrain(vtkGeoTerrain* terrain);
vtkGetObjectMacro(Terrain, vtkGeoTerrain);
//@}
/**
* Update and render the view.
*/
void Render() override;
protected:
vtkGeoView();
~vtkGeoView() override;
vtkGlobeSource* LowResEarthSource;
vtkPolyDataMapper* LowResEarthMapper;
vtkActor* LowResEarthActor;
vtkAssembly* Assembly;
vtkGeoTerrain* Terrain;
int UsingMesaDrivers;
private:
vtkGeoView(const vtkGeoView&) = delete;
void operator=(const vtkGeoView&) = delete;
};
#endif //VTK_LEGACY_REMOVE
#endif
/*=========================================================================
Program: Visualization Toolkit
Module: vtkGeoView2D.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
#include "vtkGeoView2D.h"
#include "vtkAssembly.h"
#include "vtkCamera.h"
#include "vtkCollection.h"
#include "vtkGeoAlignedImageRepresentation.h"
#include "vtkGeoTerrain2D.h"
#include "vtkInteractorStyleRubberBand2D.h"
#include "vtkObjectFactory.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkSmartPointer.h"
#include "vtkViewTheme.h"
vtkStandardNewMacro(vtkGeoView2D);
vtkCxxSetObjectMacro(vtkGeoView2D, Surface, vtkGeoTerrain2D);
vtkGeoView2D::vtkGeoView2D()
{
VTK_LEGACY_BODY(vtkGeoView2D::vtkGeoView2D, "VTK 8.2");
this->Surface = nullptr;
this->SetInteractionModeTo2D();
this->Assembly = vtkAssembly::New();
this->Renderer->AddActor(this->Assembly);
this->SetSelectionModeToFrustum();
}
vtkGeoView2D::~vtkGeoView2D()
{
this->SetSurface(nullptr);
if (this->Assembly)
{
this->Assembly->Delete();
}
}
vtkAbstractTransform* vtkGeoView2D::GetTransform()
{
if (this->Surface)
{
return this->Surface->GetTransform();
}
return nullptr;
}
void vtkGeoView2D::PrintSelf( ostream& os, vtkIndent indent )
{
this->Superclass::PrintSelf( os, indent );
os << indent << "Assembly: " << this->Assembly << "\n";
os << indent << "Surface: " << this->Surface << "\n";
}
void vtkGeoView2D::ApplyViewTheme(vtkViewTheme* theme)
{
this->Superclass::ApplyViewTheme(theme);
this->Renderer->SetBackground(theme->GetBackgroundColor());
this->Renderer->SetBackground2(theme->GetBackgroundColor2());
this->Renderer->GradientBackgroundOn();
}
void vtkGeoView2D::PrepareForRendering()
{
this->Superclass::PrepareForRendering();
if (!this->Surface)
{
return;
}
vtkSmartPointer<vtkCollection> collection =
vtkSmartPointer<vtkCollection>::New();
for (int i = 0; i < this->GetNumberOfRepresentations(); ++i)
{
vtkDataRepresentation* r = this->GetRepresentation(i);
vtkGeoAlignedImageRepresentation* img = vtkGeoAlignedImageRepresentation::SafeDownCast(r);
if (img)
{
collection->AddItem(img);
}
}
if (collection->GetNumberOfItems() > 0)
{
this->Surface->AddActors(this->Renderer, this->Assembly, collection);
}
}
void vtkGeoView2D::Render()
{
// If this is the first time, render an extra time to get things
// initialized for the first PrepareForRendering pass.
this->RenderWindow->MakeCurrent();
if (!this->RenderWindow->IsCurrent())
{
this->Update();
this->PrepareForRendering();
this->RenderWindow->Render();
}
this->Superclass::Render();
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkGeoView2D.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
/**
* @class vtkGeoView2D
* @brief A 2D geospatial view.
*
*
* vtkGeoView is a 2D globe view. The globe may contain a multi-resolution
* geometry source (vtkGeoTerrain2D), multiple multi-resolution image sources
* (vtkGeoAlignedImageRepresentation), as well as other representations such
* as vtkGeoGraphRepresentation2D. At a minimum, the view must have a terrain
* and one image representation. By default, you may select in the view with
* the left mouse button, pan with the middle button, and zoom with the right
* mouse button or scroll wheel.
*
* Each terrain or image representation contains a vtkGeoSource subclass which
* generates geometry or imagery at multiple resolutions. As the camera
* position changes, the terrain and/or image representations may ask its
* vtkGeoSource to refine the geometry. This refinement is performed on a
* separate thread, and the data is added to the view when it becomes available.
*
* @sa
* vtkGeoTerrain2D vtkGeoAlignedImageRepresentation vtkGeoSource
*/
#ifndef vtkGeoView2D_h
#define vtkGeoView2D_h
#include "vtkViewsGeovisModule.h" // For export macro
#include "vtkRenderView.h"
class vtkAssembly;
class vtkGeoTerrain2D;
class vtkViewTheme;
#if !defined(VTK_LEGACY_REMOVE)
class VTKVIEWSGEOVIS_EXPORT vtkGeoView2D : public vtkRenderView
{
public:
static vtkGeoView2D *New();
vtkTypeMacro(vtkGeoView2D,vtkRenderView);
void PrintSelf( ostream& os, vtkIndent indent ) override;
vtkGeoView2D();
~vtkGeoView2D() override;
vtkGetObjectMacro(Surface, vtkGeoTerrain2D);
virtual void SetSurface(vtkGeoTerrain2D* surf);
/**
* Returns the transform associated with the surface.
*/
vtkAbstractTransform* GetTransform() override;
/**
* Apply the view theme to this view.
*/
void ApplyViewTheme(vtkViewTheme* theme) override;
/**
* Update and render the view.
*/
void Render() override;
protected:
vtkGeoTerrain2D* Surface;
vtkAssembly* Assembly;
void PrepareForRendering() override;
private:
vtkGeoView2D(const vtkGeoView2D&) = delete;
void operator=(const vtkGeoView2D&) = delete;
};
#endif //VTK_LEGACY_REMOVE
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment