home products news downloads documentation support gallery online maps resellers search
TNTmips Downloads Menu

HOME

CONTACT US

CURRENT RELEASE
  TNT 2013

DEVELOPMENT VERSION
  TNT 2014

TNTmips Pro
PRIOR RELEASES
  TNT 2012

FREE SOFTWARE
  TNTmips Free
  TNTatlas
  TNTsdk

MORE DOWNLOADS
  HASP Key Driver
  Screen Recorder
  TNT Language Kits
  Sample Geodata
  TNT Scripts

DOCUMENTATION
  TNTmips Tutorials
  Tutorial Datasets
  Technical Guides
  Scripts
  Quick Guides

MORE INFO
  Download FAQs
  FTP
  Download Managers
  Find Reseller

SITE MAP


View3d.sml


################################################################
#
#	VIEW3D.SML
#
#	Demonstration SML script 
#
#	Requires a tntdisp dated 3-Feb-98 or later
#
################################################################

class XmForm form;			# The main form dialog
raster Composite, Elevation;
class GRE_VIEW3D view;
class GRE_LAYER_RASTER layer, surflayer;		# Our base layer
class PushButtonItem button1, button2;
class XmForm button_row;
class GRE_GROUP group;
#
#	Callback for when "Exit" is pressed
#
proc cbQuit(class widget widget) {
	DialogClose(form);
	}

#
#	Callback for when "Controls" is pressed
#
proc cbControls(class widget widget) {
	ViewOpen3DControls(view);
	}

#####################################################
#
#	MAIN PROGRAM
#
GetInputRasters(Composite, Elevation);

form = CreateModalFormDialog("test");
button1 = CreatePushButtonItem("Controls", cbControls);
button2 = CreatePushButtonItem("Exit", cbQuit);
button_row = CreateButtonRow(form, button1, button2);
button_row.BottomWidget = form;

#	Create a group to display the raster in and quick-add it.

group = DispCreate2DGroup();	# It's the view that makes it 3D
surflayer = GroupQuickAddRasterVar(group, Elevation, 1);
layer = GroupQuickAddRasterVar(group, Composite);

#	Create a 3D view for this group in our form.  
numeric height, width;
height = NumLins(Composite);
width = NumCols(Composite);
while (height > 700 or width > 1000) {
	height /= 2;
	width /= 2;
	}

view = GroupCreate3DView(group, form, "view", height, width);
form.BottomWidget = button_row;
#view.ScalePosVisible = 0;
View3DReadPosIni(view, "3dpos");

#	Open the dialog.

DialogOpen(form);
ViewRedraw(view);

#	Wait for the dialog to close. 

DialogWaitForClose(form);

#
#	Destroy our form to free up its memory.  
#
View3DWritePosIni(view, "3dpos");
ViewDestroy(view);
GroupDestroy(group);
DestroyWidget(form);


Back Home ©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010   USA
Business & Sales: (402)477-9554  Support: (402)477-9562  Fax: (402)477-9559
Business info@microimages.com  Support support@microimages.com  Web webmaster@microimages.com

25 March 2009

page update: 26 May 11