VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkGlobeSource.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00016 /*------------------------------------------------------------------------- 00017 Copyright 2008 Sandia Corporation. 00018 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00019 the U.S. Government retains certain rights in this software. 00020 -------------------------------------------------------------------------*/ 00021 00033 #ifndef __vtkGlobeSource_h 00034 #define __vtkGlobeSource_h 00035 00036 #include "vtkPolyDataAlgorithm.h" 00037 00038 class vtkCellArray; 00039 class vtkFloatArray; 00040 00041 00042 class VTK_GEOVIS_EXPORT vtkGlobeSource : public vtkPolyDataAlgorithm 00043 { 00044 public: 00045 vtkTypeRevisionMacro(vtkGlobeSource,vtkPolyDataAlgorithm); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00048 00049 // Descrpition: 00050 // This world point will be shifted to 0,0,0. 00051 // Used to avoid picking bug caused by rendering errors with large offsets. 00052 vtkSetVector3Macro(Origin, double); 00053 00055 00056 vtkSetClampMacro(StartLongitude,double,-180.0,180.0); 00057 vtkSetClampMacro(EndLongitude,double,-180.0,180.0); 00058 vtkSetClampMacro(StartLatitude,double,-90.0,90.0); 00059 vtkSetClampMacro(EndLatitude,double,-90.0,90.0); 00061 00063 00065 vtkSetClampMacro(LongitudeResolution,int,3,100); 00066 vtkGetMacro(LongitudeResolution,int); 00068 00070 00072 vtkSetClampMacro(LatitudeResolution,int,3,100); 00073 vtkGetMacro(LatitudeResolution,int); 00075 00077 00078 vtkSetClampMacro(Radius,double,0.0,VTK_DOUBLE_MAX); 00079 vtkGetMacro(Radius,double); 00081 00082 vtkSetClampMacro(CurtainHeight,double,0.0,VTK_DOUBLE_MAX); 00083 vtkGetMacro(CurtainHeight,double); 00084 00086 00092 vtkSetMacro(QuadrilateralTessellation,int); 00093 vtkGetMacro(QuadrilateralTessellation,int); 00094 vtkBooleanMacro(QuadrilateralTessellation,int); 00096 00100 static vtkGlobeSource *New(); 00101 00103 00105 static void ComputeGlobePoint( 00106 double theta, double phi, double radius, double* point, double* normal = 0); 00108 00110 00112 static void ComputeLatitudeLongitude( 00113 double* x, double& theta, double& phi); 00115 00116 protected: 00117 vtkGlobeSource(); 00118 ~vtkGlobeSource() {} 00119 00120 int RequestData( 00121 vtkInformation *, 00122 vtkInformationVector **, 00123 vtkInformationVector *); 00124 int RequestInformation( 00125 vtkInformation *, 00126 vtkInformationVector **, 00127 vtkInformationVector *); 00128 00129 void AddPoint( 00130 double theta, double phi, double radius, 00131 vtkPoints* newPoints, vtkFloatArray* newNormals, 00132 vtkFloatArray* newLongitudeArray, vtkFloatArray* newLatitudeArray, 00133 vtkDoubleArray* newLatLongArray); 00134 00135 00136 double Origin[3]; 00137 double Radius; 00138 double CurtainHeight; 00139 int LongitudeResolution; 00140 int LatitudeResolution; 00141 double StartLongitude; 00142 double EndLongitude; 00143 double StartLatitude; 00144 double EndLatitude; 00145 int QuadrilateralTessellation; 00146 00147 private: 00148 vtkGlobeSource(const vtkGlobeSource&); // Not implemented. 00149 void operator=(const vtkGlobeSource&); // Not implemented. 00150 }; 00151 00152 #endif