« lib/App/SeismicUnixGui/sunix/filter/sudipfilt.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/transform/succepstrum.pm »
| 1 | package viewer3; | ||
| 2 | |||
| 3 | |||
| 4 | =head1 DOCUMENTATION | ||
| 5 | |||
| 6 | =head2 SYNOPSIS | ||
| 7 | |||
| 8 | PERL PROGRAM NAME: VIEWER3 - VIEWER for 3-dimensional model ", | ||
| 9 | AUTHOR: Juan Lorenzo (Perl module only) | ||
| 10 | DATE: | ||
| 11 | DESCRIPTION: | ||
| 12 | Version: | ||
| 13 | |||
| 14 | =head2 USE | ||
| 15 | |||
| 16 | =head3 NOTES | ||
| 17 | |||
| 18 | =head4 Examples | ||
| 19 | |||
| 20 | =head3 SEISMIC UNIX NOTES | ||
| 21 | |||
| 22 | VIEWER3 - VIEWER for 3-dimensional model ", | ||
| 23 | |||
| 24 | viewer3 [parameters] < hzfile | ||
| 25 | |||
| 26 | Optional Parameters: ", | ||
| 27 | |||
| 28 | hue=1 =1 for hue =0 for black/white | ||
| 29 | q=-0.6,0.06,-0.06,0.8 define the quaternion | ||
| 30 | tbs=0.8 the lager the trackball size is, the slower it rotates | ||
| 31 | verbose=0 =1 print some useful information | ||
| 32 | rayfile=NULL ray path file to read in | ||
| 33 | wffile=NULL wavefront file to read in | ||
| 34 | sttfile=NULL surface traveltime file to read in | ||
| 35 | |||
| 36 | Menu: The rightmost mouse button, with cursor placed on the graphics | ||
| 37 | window activates the following menu: | ||
| 38 | Quit: quits the application | ||
| 39 | Full Screen: expands graphics window to full screen | ||
| 40 | White/Color Rays: selects colored (default) or white rays ", | ||
| 41 | Plot Rays: show the rays (default: off) | ||
| 42 | Surface Traveltimes: show surface traveltimes (default: off) | ||
| 43 | Wired or Solid WFs: style of wavefront display wireframe (default) | ||
| 44 | or solid ", | ||
| 45 | Plot Wavefronts: turn on wavefronts default: off | ||
| 46 | TRI or TETRA or LAYER or HORZ: toggles display from wireframe | ||
| 47 | triangulated horizons, to wireframe tetrahedra, | ||
| 48 | to solid layers, to solid horizons | ||
| 49 | Layer1: toggle layer on or off (default is on) | ||
| 50 | .... | ||
| 51 | |||
| 52 | Notes: | ||
| 53 | In general, the tetrahedra model should be generated by tetramod | ||
| 54 | (tetrahedra modle builder) which outputs a file called hzfile, so | ||
| 55 | that viewer3 can read input from stdin. | ||
| 56 | |||
| 57 | If, in addition, you have 3D raypath information (rayfile), wavefronts | ||
| 58 | (wffile) and surface traveltimes (sttfile), typically generated by | ||
| 59 | sutetraray (tetrahedral wavefront construction ray tracing), | ||
| 60 | then rays, wavefronts and surface traveltimes can be displayed as well | ||
| 61 | as the model. | ||
| 62 | |||
| 63 | The plot may be rotated by depressing the leftmost mouse button | ||
| 64 | and dragging the cursor in the desired direction of rotation. The speed | ||
| 65 | of rotation is controlled by the speed of the cursor. | ||
| 66 | |||
| 67 | The plot may be rescaled by depressing the shift key, while also | ||
| 68 | depressing and dragging the cursor up or down on the display window. | ||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | Credits: | ||
| 73 | CWP: Zhaobo Meng, 1996 | ||
| 74 | |||
| 75 | =head2 CHANGES and their DATES | ||
| 76 | |||
| 77 | =cut | ||
| 78 | use Moose; | ||
| 79 | our $VERSION = '0.0.1'; | ||
| 80 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 81 | |||
| 82 | my $get = L_SU_global_constants->new(); | ||
| 83 | |||
| 84 | my $var = $get->var(); | ||
| 85 | my $empty_string = $var->{_empty_string}; | ||
| 86 | |||
| 87 | |||
| 88 | my $viewer3 = { | ||
| 89 | _hue => '', | ||
| 90 | _q => '', | ||
| 91 | _rayfile => '', | ||
| 92 | _sttfile => '', | ||
| 93 | _tbs => '', | ||
| 94 | _verbose => '', | ||
| 95 | _wffile => '', | ||
| 96 | _Step => '', | ||
| 97 | _note => '', | ||
| 98 | }; | ||
| 99 | |||
| 100 | |||
| 101 | =head2 sub Step | ||
| 102 | |||
| 103 | collects switches and assembles bash instructions | ||
| 104 | by adding the program name | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | sub Step { | ||
| 109 | |||
| 110 | $viewer3->{_Step} = 'viewer3'.$viewer3->{_Step}; | ||
| 111 | return ( $viewer3->{_Step} ); | ||
| 112 | |||
| 113 | } | ||
| 114 | |||
| 115 | |||
| 116 | =head2 sub note | ||
| 117 | |||
| 118 | collects switches and assembles bash instructions | ||
| 119 | by adding the program name | ||
| 120 | |||
| 121 | =cut | ||
| 122 | |||
| 123 | sub note { | ||
| 124 | |||
| 125 | $viewer3->{_note} = 'viewer3'.$viewer3->{_note}; | ||
| 126 | return ( $viewer3->{_note} ); | ||
| 127 | |||
| 128 | } | ||
| 129 | |||
| 130 | |||
| 131 | =head2 sub clear | ||
| 132 | |||
| 133 | =cut | ||
| 134 | |||
| 135 | sub clear { | ||
| 136 | |||
| 137 | $viewer3->{_hue} = ''; | ||
| 138 | $viewer3->{_q} = ''; | ||
| 139 | $viewer3->{_rayfile} = ''; | ||
| 140 | $viewer3->{_sttfile} = ''; | ||
| 141 | $viewer3->{_tbs} = ''; | ||
| 142 | $viewer3->{_verbose} = ''; | ||
| 143 | $viewer3->{_wffile} = ''; | ||
| 144 | $viewer3->{_Step} = ''; | ||
| 145 | $viewer3->{_note} = ''; | ||
| 146 | } | ||
| 147 | |||
| 148 | |||
| 149 | =head2 sub hue | ||
| 150 | |||
| 151 | |||
| 152 | =cut | ||
| 153 | |||
| 154 | sub hue { | ||
| 155 | |||
| 156 | my ( $self,$hue ) = @_; | ||
| 157 | if ( $hue ne $empty_string ) { | ||
| 158 | |||
| 159 | $viewer3->{_hue} = $hue; | ||
| 160 | $viewer3->{_note} = $viewer3->{_note}.' hue='.$viewer3->{_hue}; | ||
| 161 | $viewer3->{_Step} = $viewer3->{_Step}.' hue='.$viewer3->{_hue}; | ||
| 162 | |||
| 163 | } else { | ||
| 164 | print("viewer3, hue, missing hue,\n"); | ||
| 165 | } | ||
| 166 | } | ||
| 167 | |||
| 168 | |||
| 169 | =head2 sub q | ||
| 170 | |||
| 171 | |||
| 172 | =cut | ||
| 173 | |||
| 174 | sub q { | ||
| 175 | |||
| 176 | my ( $self,$q ) = @_; | ||
| 177 | if ( $q ne $empty_string ) { | ||
| 178 | |||
| 179 | $viewer3->{_q} = $q; | ||
| 180 | $viewer3->{_note} = $viewer3->{_note}.' q='.$viewer3->{_q}; | ||
| 181 | $viewer3->{_Step} = $viewer3->{_Step}.' q='.$viewer3->{_q}; | ||
| 182 | |||
| 183 | } else { | ||
| 184 | print("viewer3, q, missing q,\n"); | ||
| 185 | } | ||
| 186 | } | ||
| 187 | |||
| 188 | |||
| 189 | =head2 sub rayfile | ||
| 190 | |||
| 191 | |||
| 192 | =cut | ||
| 193 | |||
| 194 | sub rayfile { | ||
| 195 | |||
| 196 | my ( $self,$rayfile ) = @_; | ||
| 197 | if ( $rayfile ne $empty_string ) { | ||
| 198 | |||
| 199 | $viewer3->{_rayfile} = $rayfile; | ||
| 200 | $viewer3->{_note} = $viewer3->{_note}.' rayfile='.$viewer3->{_rayfile}; | ||
| 201 | $viewer3->{_Step} = $viewer3->{_Step}.' rayfile='.$viewer3->{_rayfile}; | ||
| 202 | |||
| 203 | } else { | ||
| 204 | print("viewer3, rayfile, missing rayfile,\n"); | ||
| 205 | } | ||
| 206 | } | ||
| 207 | |||
| 208 | |||
| 209 | =head2 sub sttfile | ||
| 210 | |||
| 211 | |||
| 212 | =cut | ||
| 213 | |||
| 214 | sub sttfile { | ||
| 215 | |||
| 216 | my ( $self,$sttfile ) = @_; | ||
| 217 | if ( $sttfile ne $empty_string ) { | ||
| 218 | |||
| 219 | $viewer3->{_sttfile} = $sttfile; | ||
| 220 | $viewer3->{_note} = $viewer3->{_note}.' sttfile='.$viewer3->{_sttfile}; | ||
| 221 | $viewer3->{_Step} = $viewer3->{_Step}.' sttfile='.$viewer3->{_sttfile}; | ||
| 222 | |||
| 223 | } else { | ||
| 224 | print("viewer3, sttfile, missing sttfile,\n"); | ||
| 225 | } | ||
| 226 | } | ||
| 227 | |||
| 228 | |||
| 229 | =head2 sub tbs | ||
| 230 | |||
| 231 | |||
| 232 | =cut | ||
| 233 | |||
| 234 | sub tbs { | ||
| 235 | |||
| 236 | my ( $self,$tbs ) = @_; | ||
| 237 | if ( $tbs ne $empty_string ) { | ||
| 238 | |||
| 239 | $viewer3->{_tbs} = $tbs; | ||
| 240 | $viewer3->{_note} = $viewer3->{_note}.' tbs='.$viewer3->{_tbs}; | ||
| 241 | $viewer3->{_Step} = $viewer3->{_Step}.' tbs='.$viewer3->{_tbs}; | ||
| 242 | |||
| 243 | } else { | ||
| 244 | print("viewer3, tbs, missing tbs,\n"); | ||
| 245 | } | ||
| 246 | } | ||
| 247 | |||
| 248 | |||
| 249 | =head2 sub verbose | ||
| 250 | |||
| 251 | |||
| 252 | =cut | ||
| 253 | |||
| 254 | sub verbose { | ||
| 255 | |||
| 256 | my ( $self,$verbose ) = @_; | ||
| 257 | if ( $verbose ne $empty_string ) { | ||
| 258 | |||
| 259 | $viewer3->{_verbose} = $verbose; | ||
| 260 | $viewer3->{_note} = $viewer3->{_note}.' verbose='.$viewer3->{_verbose}; | ||
| 261 | $viewer3->{_Step} = $viewer3->{_Step}.' verbose='.$viewer3->{_verbose}; | ||
| 262 | |||
| 263 | } else { | ||
| 264 | print("viewer3, verbose, missing verbose,\n"); | ||
| 265 | } | ||
| 266 | } | ||
| 267 | |||
| 268 | |||
| 269 | =head2 sub wffile | ||
| 270 | |||
| 271 | |||
| 272 | =cut | ||
| 273 | |||
| 274 | sub wffile { | ||
| 275 | |||
| 276 | my ( $self,$wffile ) = @_; | ||
| 277 | if ( $wffile ne $empty_string ) { | ||
| 278 | |||
| 279 | $viewer3->{_wffile} = $wffile; | ||
| 280 | $viewer3->{_note} = $viewer3->{_note}.' wffile='.$viewer3->{_wffile}; | ||
| 281 | $viewer3->{_Step} = $viewer3->{_Step}.' wffile='.$viewer3->{_wffile}; | ||
| 282 | |||
| 283 | } else { | ||
| 284 | print("viewer3, wffile, missing wffile,\n"); | ||
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 | |||
| 289 | =head2 sub get_max_index | ||
| 290 | |||
| 291 | max index = number of input variables -1 | ||
| 292 | |||
| 293 | =cut | ||
| 294 | |||
| 295 | sub get_max_index { | ||
| 296 | my ($self) = @_; | ||
| 297 | my $max_index = 36; | ||
| 298 | |||
| 299 | return($max_index); | ||
| 300 | } | ||
| 301 | |||
| 302 | |||
| 303 | 1; |