// // time: Wed Apr 24 07:58:07 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE UnsquishGlyph // CATEGORY Macros // DESCRIPTION Produces a glyph which will result in an unsquished glyph when the object has been scaled // INPUT scale_factor; value list or field; (none); scaling used for overall image // INPUT glyph_quality; scalar or string or field or group; .5; quality of glyph // INPUT scalar; value list or field; 1; should glyph be scalar (1) or vector (0) // OUTPUT unsquished_glyph; object; Use as the "type" parameter of AutoGlyph or Glyph // End MDF // // comment: Often people are visualizing data which has vastly different extents in the different dimensions. Scale is used to modify the appearance of the final image. If Scale is used immediately prior to the Image tool, then any AutoAxes used will display the correct, unscaled values along the axes. Unfortunately, if glyphs are used in the image, the glyphs will be scaled as well, and will show up as "squished". // comment: // comment: This macro provides a simple solution for the "squished glyph syndrome". You give the macro the scale factor which you plan to use for the entire image. The macro produces an inversely squished glyph which you in turn give as a "user-given glyph" (see the man page for AutoGlyph if you're interested). Simply pass the output of the macro to the second tab of Glyph or AutoGlyph (the "type" parameter. // comment: // comment: You need to tell the macro whether you want a scalar or vector glyph, and the "quality" of the glyph (a number from 0 to 1, or one of the defined glyph types (again, see the AutoGlyph man page). // comment: // comment: (C) COPYRIGHT International Business Machines Corp. 1996. // comment: All Rights Reserved. // comment: Licensed Materials - Property of IBM // comment: // comment: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. // comment: // comment: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IBM DOES NOT WARRANT AGAINST THE INFRINGMENT OF PATENTS, COPYRIGHT OR ANY OTHER INTELLECTUAL PROPERTY RIGHTS OF OTHERS. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, IS WITH YOU. // workspace: width = 561, height = 520 // layout: snap = 0, width = 50, height = 50, align = NN // macro UnsquishGlyph( scale_factor ,glyph_quality = .5 ,scalar = 1 ) -> ( unsquished_glyph ) { // // node Input[5]: x = 268, y = 40, inputs = 0, label = Input // parameter: position = 3, name = 'scalar', value = '1', descriptive = 0, description = 'should glyph be scalar (1) or vector (0)', required = 0, visible = 1 // UnsquishGlyph_Input_5_out_1 = scalar; // // node Compute[2]: x = 343, y = 55, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1" // expression: value = a+1 // name[2]: value = a // UnsquishGlyph_Compute_2_out_1 = Compute( "$0+1", UnsquishGlyph_Input_5_out_1 ) [instance: 2, cache: 1]; // // node Switch[1]: x = 448, y = 69, inputs = 3, label = Switch // input[2]: defaulting = 0, visible = 1, type = 16777245, value = {0 1 0} // input[3]: defaulting = 0, visible = 1, type = 67108863, value = 1 // UnsquishGlyph_Switch_1_out_1 = Switch( UnsquishGlyph_Compute_2_out_1, {0 1 0}, 1 ) [instance: 1, cache: 1]; // // node Construct[1]: x = 464, y = 159, inputs = 4, label = Construct // input[1]: defaulting = 0, visible = 1, type = 16777224, value = {[0 0 0]} // UnsquishGlyph_Construct_1_out_1 = Construct( {[0 0 0]}, NULL, NULL, UnsquishGlyph_Switch_1_out_1 ) [instance: 1, cache: 1]; // // node Input[2]: x = 199, y = 32, inputs = 0, label = Input // parameter: position = 2, name = 'glyph_quality', value = '.5', descriptive = 0, description = 'quality of glyph', required = 0, visible = 1 // UnsquishGlyph_Input_2_out_1 = glyph_quality; // // node Glyph[1]: x = 367, y = 248, inputs = 7, label = Glyph // input[3]: defaulting = 1, visible = 1, type = 5, value = NULL // input[4]: defaulting = 0, visible = 1, type = 5, value = 1.0 // UnsquishGlyph_Glyph_1_out_1 = Glyph( UnsquishGlyph_Construct_1_out_1, UnsquishGlyph_Input_2_out_1, NULL, 1.0, NULL, NULL, NULL ) [instance: 1, cache: 1]; // // node Input[1]: x = 120, y = 31, inputs = 0, label = Input // parameter: position = 1, name = 'scale_factor', value = ' ', descriptive = 0, description = 'scaling used for overall image', required = 1, visible = 1 // UnsquishGlyph_Input_1_out_1 = scale_factor; // // node Compute[1]: x = 151, y = 153, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "1./$0" // expression: value = 1./a // name[2]: value = a // UnsquishGlyph_Compute_1_out_1 = Compute( "1./$0", UnsquishGlyph_Input_1_out_1 ) [instance: 1, cache: 1]; // // node Scale[1]: x = 248, y = 370, inputs = 2, label = Scale // UnsquishGlyph_Scale_1_out_1 = Scale( UnsquishGlyph_Glyph_1_out_1, UnsquishGlyph_Compute_1_out_1 ) [instance: 1, cache: 1]; // // node Output[1]: x = 256, y = 457, inputs = 1, label = Output // parameter: position = 1, name = 'unsquished_glyph', value = ' ', descriptive = 0, description = 'Use as the "type" parameter of AutoGlyph or Glyph', required = 0, visible = 1 // unsquished_glyph = UnsquishGlyph_Scale_1_out_1; // network: end of macro body } UnsquishGlyph_Input_5_out_1 = NULL; UnsquishGlyph_Compute_2_out_1 = NULL; UnsquishGlyph_Switch_1_out_1 = NULL; UnsquishGlyph_Construct_1_out_1 = NULL; UnsquishGlyph_Input_2_out_1 = NULL; UnsquishGlyph_Glyph_1_out_1 = NULL; UnsquishGlyph_Input_1_out_1 = NULL; UnsquishGlyph_Compute_1_out_1 = NULL; UnsquishGlyph_Scale_1_out_1 = NULL;