Presented by : Olivia Lin. Outline Preparation works –What software do I need? Source of sample codes –Online source: Supergeo Developer Network (SGDN)

Slides:



Advertisements
Similar presentations
Support.ebsco.com Using the Search History Feature Tutorial.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
ADABAS to RDBMS UsingNatQuery. The following session will provide a high-level overview of NatQuerys ability to automatically extract ADABAS data from.
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
Using Macros and Visual Basic for Applications (VBA) with Excel
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Intro to ArcMap Customization with Visual Basic  Create your own toolbars, buttons, interactive tools, and programs  Runs behind the scenes in ArcMap.
 2002 Prentice Hall. All rights reserved. Chapter 2 - Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Overview of the Visual Studio.NET.
AFOPro Spatial AFOPro Spatial is an extension created for ArcView 3.x. Before using the Tool the user must prepare some spatial data in ArcView. Add existing.
Advanced Object-Oriented Programming Features
SuperPad 3 Full-Function Mobile GIS Software. Overview  SuperPad, full-function mobile GIS software, is designed for field survey and data collection.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Desktop Publishing Features Designing Documents. Publication Terms  Graphics - Objects used to convey a message.  Multiple Columns - Layout used to.
Introduction to ArcGIS Add-Ins Exercises GIS/LIS Conference, 2014 Rochester, MN.
Beginning Programming with the Visual Studio.NET Environment.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Chapter 8: String Manipulation
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
INTRODUCTION TO FRONTPAGE. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features Features  Starting Front Page Starting Front Page  Components.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
An Introduction to Visual Basic
IE 411/511: Visual Programming for Industrial Applications
Arc: AddIns Dr Andy Evans. Java Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate.
Create an Image Map Web Publishing & Design. Hot Spots  hot spot: An area on an object containing a hyperlink. An entire object can be a single hot spot,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.
What is AutoCAD? A software drafting tool Particularly useful for Mechanical drawings Architectural drawings.
Copyright © 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins Introduction to Windows Chapter 2.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
Active-HDL Interfaces Building VHPI Applications C Compilation Course 9.
Endnote Tutorial How to Navigate Click to move forward Click to go back Click to return to Menu page.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
Chapter Two Creating a First Project in Visual Basic.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Using the AccuGlobe Software with the IndianaMap Using the AccuGlobe Software.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Jeremiah McNichols Partnership for Environmental Education and Rural Health PowerPoint Toolbar Creator Instructions and Foundation.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
1NetBeans Tutorial Using the “Properties” menu, name the List “List1” and the button “Button1”. NetBeans Tutorial6.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Microsoft Access By Ritesh Sharma. Introduction Microsoft Access is a desktop database program that enables you to enter, store, analyze,and present data.For.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Dive Into® Visual Basic 2010 Express
1. Introduction to Visual Basic
Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6
Social Media And Global Computing Introduction to Visual Studio
Chapter 2 – Introduction to the Visual Studio .NET IDE
Understanding the Visual IDE
GRAPHICAL USER INTERFACE
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Executive Reports, Instructions and Documentation
Presentation transcript:

Presented by : Olivia Lin

Outline Preparation works –What software do I need? Source of sample codes –Online source: Supergeo Developer Network (SGDN) Modify sample codes –Add a spatial query tool Unregister this application 2

Preparation works Developed by –Microsoft Visual Studio –Language : C #, C ++ –COM architecture SuperGIS Desktop 3

Source of Sample Code Supergeo Developer Network (SGDN)SGDN – 4

r 5

In SGDN, you’ll find more: 6

Get starting from SGDN 7

Example- Simple Map Information Sample This sample contains: Toolbar Combo box Drop-down menu Button 8

Example - Simple Map Information Sample 9

Simple Map Information Sample Step 1 Search and download the code from SGDN –R–Resource Center > Supergeo Samples –P–Products: SuperGIS Desktop, SuperGIS Extension –L–Languages & Platforms: C # –K–Key words : map information 10

Simple Map Information Sample Step 2 Set Start Action for application debugging –Select SuperGIS.exe for Start external program C:\Program Files\Supergeo\SuperGIS Desktop\SuperGIS.exe (32-bit) C:\Program Files (x86)\Supergeo\SuperGIS Desktop\SuperGIS.exe (64-bit) 11

Simple Map Information Sample Step 3 Start to debug this application In SuperGIS Desktop, you’ll see 12

Live demonstration 13

14 Modify sample codes - Add a spatial query tool to toolbar

Drag a rectangle over features and then retrieve the attribute in a message window. 15

Important Factors in Designing Spatial Query Add a class to inherit ITool & ICommand Perform the main action of Spatial Query tool in SGCore.ITool.OnMouseDown 16

Add a class 17

Add a class 18

Add reference –SGDataAcess –SGMap –SuperGeo User Interface 1.0 Type Library –using System.Runtime.InteropServices; –using System.Drawing 19

Set the class to visible –[ComVisible(true)] query is a public class Inherit ITool, Icommand 20

Implement ITool Click on “SGCore” > Select “Implement interface SGCore.ITool” 21

Design this tool 22

SGCore.ITrackTarget Detect user’s action by SGCore.ITrackTarget TkTgt; The track can be a circle, a linestring, a polygon or a rectangle. 23

SGCore.ICommandTarget Set the button’s target map object SGCore.ICommandTarget pMapTgt; 24

Start to design public IntPtr Cursor //mouse cursor style { get { System.Windows.Forms.Cursor m_cursor; m_cursor = System.Windows.Forms.Cursors.Cross; return (IntPtr)m_cursor.Handle; } 25

public bool OnContextMenu(int x, int y) { return true; } public void OnDblClick() { throw new NotImplementedException(); } public void OnHook(SGCore.ITrackTarget Hook) { TkTgt = Hook; } 26

public void OnKeyDown(short KeyCode, short Shift) { throw new NotImplementedException(); } public void OnKeyUp(short KeyCode, short Shift) { throw new NotImplementedException(); } 27

public void OnMouseDown(short Button, short Shift, int x, int y) { // Edit the command here } public void OnMouseMove(short Button, short Shift, int x, int y) { throw new NotImplementedException(); } public void OnMouseUp(short Button, short Shift, int x, int y) { throw new NotImplementedException(); } 28

public void OnMouseDown(short Button, short Shift, int x, int y) { SGCore.ILayerGroup LG = ((SuperObjects2.IMapCtrl)pMapTgt).Map as SGCore.ILayerGroup; SGMap.FeatureLayer plyr; plyr = (SGMap.FeatureLayer)LG.Layer[0]; //the tool for drag a rectangle SGUserInterface.TrackFeedbackNewEnvelope tk = new SGUserInterface.TrackFeedbackNewEnvelope(); SGSFCOMS.IGeometry pGeo; pGeo = TkTgt.Track((SGCore.ITrackFeedback)tk); //built the spatial query with intersect relationship SGDataAccess.BinarySpatialOperator pSpQry = new SGDataAccess.BinarySpatialOperator(); pSpQry.OperatorType = SGDataAccess.SGOBinarySpatialOperatorType.SGO_BSOT_Intersects; pSpQry.Geometry = pGeo; SGCore.IFeatureCursor pCur; SGCore.IFeature pFea; pCur = ((SGCore.IFeatureLayer)plyr).FeatureClass.Search((SGCore.IFeatureFilter)pSpQry); pFea = pCur.NextFeature(); while (!(pFea == null)) { System.Windows.Forms.MessageBox.Show(pFea[3].ToString()); //Indicate the field to display pFea = pCur.NextFeature(); } 29

public void OnMouseDown(short Button, short Shift, int x, int y) { SGCore.ILayerGroup LG = ((SuperObjects2.IMapCtrl)pMapTgt).Map as SGCore.ILayerGroup; SGMap.FeatureLayer plyr; plyr = (SGMap.FeatureLayer)LG.Layer[0]; //the tool for drag a rectangle SGUserInterface.TrackFeedbackNewEnvelope tk = new SGUserInterface.TrackFeedbackNewEnvelope(); SGSFCOMS.IGeometry pGeo; pGeo = TkTgt.Track((SGCore.ITrackFeedback)tk); //built the spatial query with intersect relationship SGDataAccess.BinarySpatialOperator pSpQry = new SGDataAccess.BinarySpatialOperator(); pSpQry.OperatorType = SGDataAccess.SGOBinarySpatialOperatorType.SGO_BSOT_Intersects; pSpQry.Geometry = pGeo; SGCore.IFeatureCursor pCur; SGCore.IFeature pFea; pCur = ((SGCore.IFeatureLayer)plyr).FeatureClass.Search((SGCore.IFeatureFilter)pSpQry); pFea = pCur.NextFeature(); while (!(pFea == null)) { System.Windows.Forms.MessageBox.Show(pFea[3].ToString()); //Indicate the field to display pFea = pCur.NextFeature(); } Define the map and the target layer 30

public void OnMouseDown(short Button, short Shift, int x, int y) { SGCore.ILayerGroup LG = ((SuperObjects2.IMapCtrl)pMapTgt).Map as SGCore.ILayerGroup; SGMap.FeatureLayer plyr; plyr = (SGMap.FeatureLayer)LG.Layer[0]; //the tool for drag a rectangle SGUserInterface.TrackFeedbackNewEnvelope tk = new SGUserInterface.TrackFeedbackNewEnvelope(); SGSFCOMS.IGeometry pGeo; pGeo = TkTgt.Track((SGCore.ITrackFeedback)tk); //built the spatial query with intersect relationship SGDataAccess.BinarySpatialOperator pSpQry = new SGDataAccess.BinarySpatialOperator(); pSpQry.OperatorType = SGDataAccess.SGOBinarySpatialOperatorType.SGO_BSOT_Intersects; pSpQry.Geometry = pGeo; SGCore.IFeatureCursor pCur; SGCore.IFeature pFea; pCur = ((SGCore.IFeatureLayer)plyr).FeatureClass.Search((SGCore.IFeatureFilter)pSpQry); pFea = pCur.NextFeature(); while (!(pFea == null)) { System.Windows.Forms.MessageBox.Show(pFea[3].ToString()); //Indicate the field to display pFea = pCur.NextFeature(); } Decide the queried shape 31

public void OnMouseDown(short Button, short Shift, int x, int y) { SGCore.ILayerGroup LG = ((SuperObjects2.IMapCtrl)pMapTgt).Map as SGCore.ILayerGroup; SGMap.FeatureLayer plyr; plyr = (SGMap.FeatureLayer)LG.Layer[0]; //the tool for drag a rectangle SGUserInterface.TrackFeedbackNewEnvelope tk = new SGUserInterface.TrackFeedbackNewEnvelope(); SGSFCOMS.IGeometry pGeo; pGeo = TkTgt.Track((SGCore.ITrackFeedback)tk); //built the spatial query with intersect relationship SGDataAccess.BinarySpatialOperator pSpQry = new SGDataAccess.BinarySpatialOperator(); pSpQry.OperatorType = SGDataAccess.SGOBinarySpatialOperatorType.SGO_BSOT_Intersects; pSpQry.Geometry = pGeo; SGCore.IFeatureCursor pCur; SGCore.IFeature pFea; pCur = ((SGCore.IFeatureLayer)plyr).FeatureClass.Search((SGCore.IFeatureFilter)pSpQry); pFea = pCur.NextFeature(); while (!(pFea == null)) { System.Windows.Forms.MessageBox.Show(pFea[3].ToString()); //Indicate the field to display pFea = pCur.NextFeature(); } Set the query action pSpQry is a query object 32

public void OnMouseDown(short Button, short Shift, int x, int y) { SGCore.ILayerGroup LG = ((SuperObjects2.IMapCtrl)pMapTgt).Map as SGCore.ILayerGroup; SGMap.FeatureLayer plyr; plyr = (SGMap.FeatureLayer)LG.Layer[0]; //the tool for drag a rectangle SGUserInterface.TrackFeedbackNewEnvelope tk = new SGUserInterface.TrackFeedbackNewEnvelope(); SGSFCOMS.IGeometry pGeo; pGeo = TkTgt.Track((SGCore.ITrackFeedback)tk); //built the spatial query with intersect relationship SGDataAccess.BinarySpatialOperator pSpQry = new SGDataAccess.BinarySpatialOperator(); pSpQry.OperatorType = SGDataAccess.SGOBinarySpatialOperatorType.SGO_BSOT_Intersects; pSpQry.Geometry = pGeo; SGCore.IFeatureCursor pCur; SGCore.IFeature pFea; pCur = ((SGCore.IFeatureLayer)plyr).FeatureClass.Search((SGCore.IFeatureFilter)pSpQry); pFea = pCur.NextFeature(); while (!(pFea == null)) { System.Windows.Forms.MessageBox.Show(pFea[3].ToString()); //Indicate the field to display pFea = pCur.NextFeature(); } Execute Spatial Query 33

public void OnMouseDown(short Button, short Shift, int x, int y) { // Edit the command here } public void OnMouseMove(short Button, short Shift, int x, int y) { throw new NotImplementedException(); } public void OnMouseUp(short Button, short Shift, int x, int y) { throw new NotImplementedException(); } 34

public bool QueryDeactivate() { TkTgt = null; return true; } 35

Implement ICommand Click on “SGCore” > Select “Implement interface SGCore.ICommand” 36

Start to design public string Caption { get { return "Spatial Query"; } } public bool Checked { get { return (TkTgt != null); } } 37

public bool Enabled { get { return true; } } public string HelpFile { get { return "NO Help"; } } 38

public IntPtr Image { get { return m_Icon.Handle; } } public int HelpTopicID { get { return 0; } } public string Name { get { return "Spatial Query"; } } Declare Icon m_Icon = null; Declare Icon m_Icon = null; 39

public void OnCommand(SGCore.ICommandTarget Parent) { pMapTgt = Parent; // The button of the target map // Use pMapTgt (ICommandTarget) to catch Parent } public string ToolTip { get { return "Spatial Query"; } } 40

Add to the Toolbar //In SimpleMapInfoToolbar.cs, add query Query queryBtn = new Query(); m_Cmd.Add(queryBtn); 41

Run this project 42

43 Live demonstration

Unregister this application In Windows Command Prompt, under C:\WINDOWS\Microsoft.NET\Framework\v \ –For C# > RegAsm.exe /u “ /.dll” –For C++ > Regsvr32 /u “ /.dll” 44

45 Live demonstration

Supergeo Technologies Inc. THANK YOU FOR JOINING THIS COURSE 46