---
name: "Terrain Processor SDK Manual"
type: topic
source: https://community.bistudio.com/wiki/Terrain_Processor_SDK_Manual
revid: 349828
updated: 2023-11-20T22:10:30Z
---

# Terrain Processor SDK Manual

[Terrain Processor](../topics/Terrain_Processor.md) has its own **SDK** which allows the creation of new tasks. Hereafter, you will find a quick introduction of the setup of the new project. All you need is the Visual Studio (an Express version is enough) and the SDK which is available in [Arma 3 Samples](http://store.steampowered.com/app/390500).

### Create New Project in Visual Studio

Start Microsoft Visual Studio and create a new Project.

Configure it to be an empty DLL.

### Add include and library directories

Then, go to the configuration of the project and edit the debug configuration to include the library directory (VC++ Directories option group).

### Add lib to dependencies

From the project configuration, go to *Linker*, *Input* and define the additional dependencies.

### Create plugin source files

Create a new header called **pluginTest.h** with the following content:

```cpp
#pragma once

#include "TerrainProcessorPlugin.h"

using namespace TerrainProcessorSDK;

// Test plugin.
class PluginTest : public TerrainProcessorPlugin
{
public:
    // Sample parameter
    TerrainProcessorParameterDefinition _sampleParameter;

    // Constructor.
    PluginTest();
    // Process shape.
    virtual void ProcessShape(IRunContext& context, ShapeFiles::SHPShape* shape, const ShapeParameters& shapeParameters);
};
```

Then a code file called **pluginTest.cpp** with this content:

```cpp
#include "PluginTest.h"
#include <algorithm>
#include <cmath>

// Constructor.
PluginTest::PluginTest()
    : TerrainProcessorPlugin(
    "Test",
    "Test plugin.",
    GTPolyline,
    TPPFlagsShapeFile | TPPFlagsDEM)
{
    _sampleParameter = TerrainProcessorParameterDefinition(
    "Sample parameter",
    "Sample parameter. \r\n"
    "Default value is : 10",
    "10",
    TPPT_DOUBLE);
    _parameters.push_back(_sampleParameter);
}

// Process shape.
void PluginTest::ProcessShape(IRunContext& context, ShapeFiles::SHPShape* shape, const ShapeParameters& shapeParameters)
{
    _sampleParameter = _parameters[0];
}
```

### Create Plugin.cpp and DllExport.def

New code file named **Plugin.cpp**:

```cpp
#include <vector>
#include <memory>
#include "TerrainProcessorPlugin.h"
#include "PluginTest.h"

using namespace TerrainProcessorSDK;

// Get plugins function.
__declspec(dllexport) bool __stdcall GetPlugins(std::reference_wrapper<std::vector<std::shared_ptr<TerrainProcessorPlugin>>> plugins)
{
    plugins.get().push_back(std::make_shared<PluginTest>());

    return true;
}
```

And finally a new **module-definitions** file:

```cpp
LIBRARY PLUGIN_TEST
EXPORTS
    GetPlugins        @1
```

<sub>Source: [BI Community Wiki — Terrain Processor SDK Manual](https://community.bistudio.com/wiki/Terrain_Processor_SDK_Manual) (revision 349828).</sub>
