Hexagon Geospatial
MENU

Developers Knowledge Base

Read articles and post questions in this comprehensive developer community and support forum.
Showing results for 
Search instead for 
Do you mean 

Creating a Project from Scratch

by Technical Evangelist ‎10-06-2015 11:52 AM - edited ‎06-22-2016 02:29 PM (686 Views)

Start by opening Visual Studio. Select File->New->Project… and create a Win32 Project in the same directory as the examples. Uncheck the Create directory for solution option.

 

SMSDK VS Example 5.png

 

In the Application Wizard, click Next to reach the Application Settings page and select DLL as the application type. Also, ensure that the Empty Project check box is checked. Then click Finish.

 

SMSDK VS Example 6.png

 

Your new empty project should now be open in Visual Studio.

 

Before we apply the settings, we need to add the 64-bit Unicode configurations. Open the Configuration Manager by clicking Build->Configuration Manager…

 

From the popup list under Active solution configurations, choose <New…>. Set the name to UDebug and Copy settings from: to Debug. Click OK and then repeat this process for URelease and Release.

 

From the popup list under Active solution platform, choose <New…>. Set the platform to x64 and Copy settings from to: Win32. Click OK, and then close the Configuration Manager.

 

Right click on the project in the Solution Explorer and select Properties from the menu.

 

The following properties need to be set in all configurations (Win32Release, Win32Debug, x64URelease, x64UDebug):

 

General

  • Set Output Directory to your plug-ins directory

SMSDK VS Example 7.png

 

C/C++

 

General
  • Add the Spatial Modeler SDK include directory to the Additional Include Directories.

SMSDK VS Example 8.png

 

Preprocessor
  • Add __STDC__ to the Preprocessor Definitions

SMSDK VS Example 9.png

 

Linker

 
General
  • Add the Spatial Modeler SDK library directory to the Additional Library Directories.

SMSDK VS Example 10.png

 

Input
  • Add sblib.lib, eCommonU.lib and pluginManager.lib to Additional Dependencies. If you are creating a RasterOperator, you should include sbrasterlib.lib and sbbasiclib.lib as well.

SMSDK VS Example 11.png

 

Custom Build Step

 

General
  • Set Command Line to $(SpatialModelerSDKHome)\bin\$(Platform)$(Configuration)\configure_plugin.exe $(TargetPath) replacing $(SpatialModelerSDKHome) with your Spatial Modeler SDK install directory
  • Set Description to Configuring Spatial Modeler plugin
  • Set Outputs to $(TargetDir)$(TargetName).xml;%(Outputs)

The purpose of this custom build step is to generate an XML file to accompany your plug-in. The XML file identifies the operators contained in your plug-in so that Spatial Modeler can learn their attributes (name, inputs and outputs) without needing to load your plug-in and its dependent libraries, which may be time consuming. This custom build step is optional but highly recommended.

 

SMSDK VS Example 12.png

 

Once all of the settings are correct, you are ready to begin coding your new plugin.

 

Previous article:  Copying and Modifying an Example Project

Overview
Contributors