Pointwise Plugin SDK
Functions
Structured Grid Import Functions
+ Collaboration diagram for Structured Grid Import Functions:

Functions

PWGM_HCONNECTOR PwModCreateCon (PWGM_HGRIDMODEL model, PWP_UINT size)
 Creates a connector in a model. More...
 
PWGM_HBLOCK PwModCreateStrBlock (PWGM_HGRIDMODEL model, const PWGM_STR_SIZE blkSize)
 Creates a structured block in a model. More...
 
PWGM_HDOMAIN PwModCreateStrDomain (PWGM_HGRIDMODEL model, const PWGM_STR_SIZE domSize)
 Creates a structured domain in a model. More...
 

Detailed Description

These functions are used to import structured grids.

See also

Function Documentation

◆ PwModCreateCon()

PWGM_HCONNECTOR PwModCreateCon ( PWGM_HGRIDMODEL  model,
PWP_UINT  size 
)

Creates a connector in a model.

Parameters
modelThe grid model handle.
sizeSpecifies the number of points in the connector.
Returns
A connector handle.
See also
PwModCreateStrBlock(), PwModCreateStrDomain()
Sample usage:

These snippets are from the GrdpTEST sample plugin included with the Plugin SDK.

The doCreateCon() function creates a connector and loads its vertices:

static void
doCreateCon(const GRDP_RTITEM &rti)
{
// Create a 5 point connector
PwConSetName(hCon, "MyConnector-1");
PwVlstSetXYZ(hVL, 0, 0.0, 0.0, 1.5);
PwVlstSetXYZ(hVL, 1, 1.0, 0.0, 1.5);
PwVlstSetXYZ(hVL, 2, 1.0, 1.0, 1.5);
PwVlstSetXYZ(hVL, 3, 0.0, 1.0, 1.5);
PwVlstSetXYZ(hVL, 4, 0.0, 1.0, 2.5);
}
}

Definition at line 800 of file apiGridModel.cxx.

◆ PwModCreateStrBlock()

PWGM_HBLOCK PwModCreateStrBlock ( PWGM_HGRIDMODEL  model,
const PWGM_STR_SIZE  blkSize 
)

Creates a structured block in a model.

Parameters
modelThe grid model handle.
blkSizeSpecifies the ijk size of the structured block. The number of points is computed as (i * j * k).
Returns
A block handle.
See also
PwModCreateCon(), PwModCreateStrDomain()
Sample usage:

These snippets are from the GrdpTEST sample plugin included with the Plugin SDK.

The doCreateStrBlk() function creates a structured block and loads its vertices:

static void
doCreateStrBlk(const GRDP_RTITEM &rti)
{
const PWGM_STR_SIZE szBlk = { 2, 3, 3 }; // i j k
PWGM_HBLOCK hSBlk = PwModCreateStrBlock(rti.model, szBlk);
PwBlkSetName(hSBlk, "MyStrBlock-1");
// k=0 vertices
PwVlstSetXYZ3(hVL, n3(0, 0, 0), 0.0, 0.0, 0.0);
PwVlstSetXYZ3(hVL, n3(0, 1, 0), 0.0, 1.0, 0.0);
PwVlstSetXYZ3(hVL, n3(0, 2, 0), 0.0, 2.0, 0.0);
PwVlstSetXYZ3(hVL, n3(1, 0, 0), 1.0, 0.0, 0.0);
PwVlstSetXYZ3(hVL, n3(1, 1, 0), 1.0, 1.0, 0.0);
PwVlstSetXYZ3(hVL, n3(1, 2, 0), 1.0, 2.0, 0.0);
// k=1 vertices
PwVlstSetXYZ3(hVL, n3(0, 0, 1), 0.0, 0.0, 0.5);
PwVlstSetXYZ3(hVL, n3(0, 1, 1), 0.0, 1.0, 0.5);
PwVlstSetXYZ3(hVL, n3(0, 2, 1), 0.0, 2.0, 0.5);
PwVlstSetXYZ3(hVL, n3(1, 0, 1), 1.0, 0.0, 0.5);
PwVlstSetXYZ3(hVL, n3(1, 1, 1), 1.0, 1.0, 0.5);
PwVlstSetXYZ3(hVL, n3(1, 2, 1), 1.0, 2.0, 0.5);
// k=2 vertices
PwVlstSetXYZ3(hVL, n3(0, 0, 2), 0.0, 0.0, 1.0);
PwVlstSetXYZ3(hVL, n3(0, 1, 2), 0.0, 1.0, 1.0);
PwVlstSetXYZ3(hVL, n3(0, 2, 2), 0.0, 2.0, 1.0);
PwVlstSetXYZ3(hVL, n3(1, 0, 2), 1.0, 0.0, 1.0);
PwVlstSetXYZ3(hVL, n3(1, 1, 2), 1.0, 1.0, 1.0);
PwVlstSetXYZ3(hVL, n3(1, 2, 2), 1.0, 2.0, 1.0);
}
}

The doCreateStrBlk() helper functions:

inline static const PWGM_INDEX3 &
n3(const PWP_INT32 i, const PWP_INT32 j, const PWP_INT32 k)
{
static PWGM_INDEX3 ret;
ret.i = i;
ret.j = j;
ret.k = k;
return ret;
}

Definition at line 1386 of file apiGridModel.cxx.

◆ PwModCreateStrDomain()

PWGM_HDOMAIN PwModCreateStrDomain ( PWGM_HGRIDMODEL  model,
const PWGM_STR_SIZE  domSize 
)

Creates a structured domain in a model.

Parameters
modelThe grid model handle.
domSizeSpecifies the ij size of the structured domain. The value of k is ignored. The number of points is computed as (i * j).
Returns
A domain handle.
See also
PwModCreateCon(), PwModCreateStrBlock()
Sample usage:

These snippets are from the GrdpTEST sample plugin included with the Plugin SDK.

The doCreateStrDom() function creates a structured domain and loads its vertices:

static void
doCreateStrDom(const GRDP_RTITEM &rti)
{
const PWGM_STR_SIZE szBlk = { 2, 3 }; // i j (k ignored)
PwDomSetName(hSDom, "MyStrDomain-1");
PwVlstSetXYZ2(hVL, n2(0, 0), 0.0, 0.0, 0.0);
PwVlstSetXYZ2(hVL, n2(0, 1), 0.0, 1.0, 0.0);
PwVlstSetXYZ2(hVL, n2(0, 2), 0.0, 2.0, 0.0);
PwVlstSetXYZ2(hVL, n2(1, 0), 1.0, 0.0, 0.0);
PwVlstSetXYZ2(hVL, n2(1, 1), 1.0, 1.0, 0.0);
PwVlstSetXYZ2(hVL, n2(1, 2), 1.0, 2.0, 0.0);
}
}

The doCreateStrDom() helper functions:

inline static const PWGM_INDEX2 &
n2(const PWP_INT32 i, const PWP_INT32 j)
{
static PWGM_INDEX2 ret;
ret.i = i;
ret.j = j;
return ret;
}

Definition at line 1394 of file apiGridModel.cxx.

PWGM_INDEX3::j
PWP_INT32 j
j-coordinate used for 3D and 2D grids
Definition: apiGridModel.h:890
PwVlstSetXYZ2
PWP_BOOL PwVlstSetXYZ2(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX2 ndx2, const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
Set the XYZ of a point in a 2D structured vertex list.
Definition: apiGridModel.cxx:932
PwBlkSetName
PWP_BOOL PwBlkSetName(PWGM_HBLOCK block, const char *name)
Set a block's name.
Definition: apiGridModel.cxx:840
PWGM_HDOMAIN
An opaque handle to a grid domain element.
Definition: apiGridModel.h:372
PwModCreateStrBlock
PWGM_HBLOCK PwModCreateStrBlock(PWGM_HGRIDMODEL model, const PWGM_STR_SIZE blkSize)
Creates a structured block in a model.
Definition: apiGridModel.cxx:1386
PWP_INT32
int PWP_INT32
32-bit integer
Definition: apiPWP.h:207
PwConSetName
PWP_BOOL PwConSetName(PWGM_HCONNECTOR connector, const char *name)
Set a connector's name.
Definition: apiGridModel.cxx:832
PWGM_INDEX3::i
PWP_INT32 i
i-coordinate used for 3D and 2D grids
Definition: apiGridModel.h:889
PWGM_INDEX3
Structured grid ijk index data type.
Definition: apiGridModel.h:888
GRDP_RTITEM
The data representing a grid importer instance.
Definition: apiGRDPUtils.h:117
PWGM_INDEX2
Structured grid ijk index data type.
Definition: apiGridModel.h:897
PwModCreateStrDomain
PWGM_HDOMAIN PwModCreateStrDomain(PWGM_HGRIDMODEL model, const PWGM_STR_SIZE domSize)
Creates a structured domain in a model.
Definition: apiGridModel.cxx:1394
PwVlstSetXYZ
PWP_BOOL PwVlstSetXYZ(PWGM_HVERTEXLIST vertlist, const PWP_UINT ndx, const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
Set the XYZ of a point in a 1D vertex list.
Definition: apiGridModel.cxx:900
PWGM_INDEX2::j
PWP_INT32 j
j-coordinate used for 2D grids
Definition: apiGridModel.h:899
PWGM_HBLOCK
An opaque handle to a grid block element.
Definition: apiGridModel.h:345
PWGM_INDEX3::k
PWP_INT32 k
k-coordinate used for 3D grids only
Definition: apiGridModel.h:891
GRDP_RTITEM::model
PWGM_HGRIDMODEL model
Runtime grid model handle to import.
Definition: apiGRDPUtils.h:157
PwBlkGetVertexList
PWGM_HVERTEXLIST PwBlkGetVertexList(PWGM_HBLOCK block)
Get the vertex list associated with an unstructured or structured block.
Definition: apiGridModel.cxx:808
PWGM_INDEX2::i
PWP_INT32 i
i-coordinate used for 2D grids
Definition: apiGridModel.h:898
PwConGetVertexList
PWGM_HVERTEXLIST PwConGetVertexList(PWGM_HCONNECTOR connector)
Get the vertex list associated with a connector.
Definition: apiGridModel.cxx:824
PWGM_STR_SIZE
PWGM_INDEX3 PW_DLL_IMPEXP PWGM_STR_SIZE
Structured grid ijk size data type.
Definition: apiGridModel.h:904
PwVlstSetXYZ3
PWP_BOOL PwVlstSetXYZ3(PWGM_HVERTEXLIST vertlist, const PWGM_INDEX3 ndx3, const PWGM_XYZVAL x, const PWGM_XYZVAL y, const PWGM_XYZVAL z)
Set the XYZ of a point in a 3D structured vertex list.
Definition: apiGridModel.cxx:963
PwDomSetName
PWP_BOOL PwDomSetName(PWGM_HDOMAIN domain, const char *name)
Set a domain's name.
Definition: apiGridModel.cxx:848
PWGM_HVERTEXLIST_ISVALID
#define PWGM_HVERTEXLIST_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:538
PwDomGetVertexList
PWGM_HVERTEXLIST PwDomGetVertexList(PWGM_HDOMAIN domain)
Get the vertex list associated with an unstructured or structured domain.
Definition: apiGridModel.cxx:816
PWGM_HCONNECTOR
An opaque handle to a grid connector element.
Definition: apiGridModel.h:507
PwModCreateCon
PWGM_HCONNECTOR PwModCreateCon(PWGM_HGRIDMODEL model, PWP_UINT size)
Creates a connector in a model.
Definition: apiGridModel.cxx:800
PWGM_HVERTEXLIST
Grid vertex list handle declaration.
Definition: apiGridModel.h:536