Pointwise Plugin SDK
Create a Plugin Project

main page | next>

The following text is taken from the src/plugins/README.txt file.

/****************************************************************************
 *
 * Pointwise Plugin utility functions
 *
 * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
 *
 ***************************************************************************/

********************
*** Introduction ***
********************

This document covers the process of creating a "starting" plugin project. 
You can use this project to implement your plugins export logic.

It is suggested you verify your Pointwise Plugin SDK installation before 
making any of the changes detailed below.


Verify on windows:
---------------------------------------
Open the VisualStudio solution file .../PluginSDK/PluginSDK_vs2015.sln
Select the "Build/Batch Build..." menu
Press the "Select All" button
Press the "Rebuild" button

The sample plugins included with the SDK should build for all platforms 
(win64) and build types (debug, release). The resulting DLL plugins are 
located under the .../PluginSDK/dist/<platform> folders.

NOTE: These instructions assume your installation is Visual Studio 2015 and that 
it supports building the x64 platform type. Using other versions of Visual Studio 
is untested and unsupported.

Verify on unix and macOSX:
---------------------------------------
Open a command shell.

   % cd .../PluginSDK
   % make machine=MID plugins-dr

Where,
   ... is your SDK's installation path
   MID is one of linux_x86_64, or macosx. Use linux_x86_64 on a 64-bit build 
       machine. Use macosx for all intel based macOS build machines.

Alternately, if you set the "machine" environment variable, you can omit the 
machine=MID option.

   % cd .../PluginSDK
   % setenv machine linux_x86_64
   % make plugins-dr

The included sample plugins should build for the platform (linux_x86_64, macosx) 
and all build types (debug, release). The resulting plugins (.so or .dynlib) are 
located under the .../PluginSDK/dist/<platform> folders.


*************************
*** tclsh Information ***
*************************

The included mkplugin and mkplugin.bat scripts are used to create new plugin 
projects. These scripts require access to a tcl shell (tclsh). The scripts 
manage the proper integration of the new plugin project into the SDK framework.

For example;

    * Each plugin is assigned a unique id.
    * pluginRegistry.h is updated.
    * A make target is added.
    * Some plugin runtime data is initialized.

A tcl shell is included with your Pointwise installation. The pointwise tcl 
shell is invoked on unix using the script:

    /your/pointwise/installation/pointwise -b

and on winOS using:

    bin/tclsh

If Pointwise is not installed on your development machine, you will need to
download and install a tcl shell on your machine. There are free installations
available on the web. Try http://www.activestate.com/activetcl/ for a good tcl
shell.

The scripts assume that the tcl shell (tclsh) is can be launched by name only.
That is, typing "tclsh" on the command line will start the tcl shell without
errors. If not already working, you may want to add the tclsh folder to the
shell's path or create an alias (unix) or a tclsh.bat file (winOS).

If you do not want to make shell changes as outlined above, you can invoke the
underlying tcl file using the following command line:

for unix and macOSX:

    /path/to/your/tclsh mkplugin.tcl <command-line-arguments>

for windows:

    \path\to\your\tclsh mkplugin.tcl <command-line-arguments>

The <command-line-arguments> are detailed in the script section.


**************************************
*** A Few Comments Before We Begin ***
**************************************

A Pointwise CAE Plugin must be declared as exporting "Structured" or 
"Unstructured" grids. The CAE solver being targeted determines the type. If a 
solver supports both structured and unstructured grids, 2 separate plugins 
must be created.

A Pointwise Grid Import Plugin (GRDP) supports the importing of both 
"Structured" and "Unstructured" grids. Only one plugin is needed.

On every platform, the SDK builds all plugins using the platform's C++ compiler.
However, you can choose between one of two API entry point styles. Currently, C
and C++ entry point styles are supported for CAE plugins. Which style you choose 
depends on your development skill set. If you are most familiar with the C 
programming language, use the -c switch to create a plugin using C-style entry 
points. If you are most familiar with the C++ programming language, use the -cpp 
switch to create a plugin using C++-style entry points. No matter which style 
you choose, you are always free to use C++ for your plugin's internal code. See 
sections below for more details.

Grid import plugins only support C at this time.

The set of PluginSDK API calls available to a given plugin will be determined 
by the plugin type and language. If you get an "undefined" function compile 
error, you may be using an API call unsupported for your plugin's type or 
language.

In the section below, we will be creating the unstructured, C-language plugin 
named "CaeUnsMyExporter". When complete, the cross-platform build will produce 
binaries similar to the following examples:

for BUILD=Release
    "/path/to/your/PluginSDK/dist/win32/plugins/CaeUnsMyExporter.dll"
    "/path/to/your/PluginSDK/dist/linux/plugins/libCaeUnsMyExporter.so"

for BUILD=Debug
    "/path/to/your/PluginSDK/dist/win32/plugins/debug/CaeUnsMyExporterd.dll"
    "/path/to/your/PluginSDK/dist/linux/plugins/debug/libCaeUnsMyExporterd.so"


************************************************************
*** Create a New Plugin Project with the mkplugin Script ***
************************************************************

*** CAE Exporter

Use the following steps to create an unstructured, C-language CAE plugin 
project (if you prefer the C++ language, you may use the -cpp switch in place 
of the -c switch).

Open a shell on your development platform.

Change to the "/path/to/your/PluginSDK" folder.

On the command line, enter the following...

for unix and macOSX:
    ./mkplugin -caeu -c MyExporter

for windows:
    mkplugin -caeu -c MyExporter

If all goes well, you should see a message similar to the following:

    "creating new unstructured c plugin 'CaeUnsMyExporter' with ID=20..."


*** Grid Importer

Use the following steps to create a C-language grid import plugin project.

Open a shell on your development platform.

Change to the "/path/to/your/PluginSDK" folder.

On the command line, enter the following...

for unix and macOSX:
    ./mkplugin -grdp -c MyImporter

for windows:
    mkplugin -grdp -c MyImporter

If all goes well, you should see a message similar to the following:

    "creating new import c plugin 'GrdpMyImporter' with ID=22..."


There are other switches supported by mkplugin. To see the full, command line 
usage, use the -h switch as:
    ./mkplugin -h    (unix and macOSX)
    mkplugin -h      (windows)


****************************
*** C-Style Entry Points ***
****************************

Using the -c switch, mkplugin produces a plugin with several empty C functions 
that you must modify with your plugin's logic.

For CAE exporters, these C-functions are:

  * PWP_BOOL runtimeCreate(...)
  * PWP_BOOL runtimeWrite(...)
  * PWP_VOID runtimeDestroy(...)

These functions are located in the runtimeWrite.cxx module. See the CAE Plugin 
SDK documentation for details.


For grid importers, these C-functions are:

  * PWP_BOOL runtimeReadGridCreate(...)
  * PWP_BOOL runtimeReadGrid(...)
  * PWP_VOID runtimeReadGridDestroy(...)

These functions are located in the runtimeReadGrid.cxx module. See the Plugin
SDK documentation for details.


******************************
*** C++-Style Entry Points ***
******************************

Using the -cpp switch, mkplugin produces a plugin class with empty methods
that you must modify with your plugin's logic. These class methods are:

  * static bool CaeUnsMyExporter::create(...)
  * virtual bool CaeUnsMyExporter::beginExport()
  * virtual PWP_BOOL CaeUnsMyExporter::write()
  * virtual bool CaeUnsMyExporter::endExport()
  * static void CaeUnsMyExporter::destroy(...)

The CaeUnsMyExporter class and methods are located in the CaeUnsMyExporter.h
and CaeUnsMyExporter.cxx modules. See the CAE Plugin SDK documentation for
details.


Grid importer plugins do not support a C++ API at this time.

--------------------

The End (for now)

main page | next>