Pointwise Plugin SDK
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

The grid block base class. More...

#include <CaeGridModel.h>

+ Inheritance diagram for CaeBlock:
+ Collaboration diagram for CaeBlock:

Public Member Functions

bool condition (PWGM_CONDDATA &condData) const
 Gets the block's condition data. More...
 
bool data (PWGM_BLOCKDATA &data)
 Get the block data. More...
 
PWP_UINT32 index () const
 Get a block's index. More...
 
bool isValid () const
 Determines a block's validity. More...
 
CaeBlockmoveFirst (PWGM_HGRIDMODEL model)
 Rebinds an instance to the first block in a model. More...
 
CaeBlockmoveNext ()
 Rebinds an instance to the next block in a model. More...
 
CaeBlockmovePrev ()
 Rebinds an instance to the previous block in a model. More...
 
CaeBlockmoveTo (PWGM_HGRIDMODEL model, PWP_UINT32 ndx)
 Rebinds an instance to a specific model block. More...
 
 operator PWGM_HBLOCK () const
 The PWGM_HBLOCK cast operator. More...
 
CaeBlockoperator++ ()
 Prefix increment to the next block in a model. More...
 
CaeBlock operator++ (int)
 Postfix increment to the next block in a model. More...
 
CaeBlockoperator-- ()
 Prefix decrement to the previous block in a model. More...
 
CaeBlock operator-- (int)
 Postfix decrement to the previous block in a model. More...
 
CaeBlockoperator= (const CaeBlock &rhs)
 Assignment operator. More...
 
CaeBlockoperator= (PWGM_HBLOCK block)
 Assignment operator. More...
 
bool operator== (const CaeBlock &rhs) const
 Compares two CaeBlock instances for equality. More...
 
bool setExportName (const char *name)
 Set the name used to identify the block or group of blocks in the exported grid. More...
 

Protected Member Functions

 CaeBlock ()
 Default constructor. More...
 
 CaeBlock (const CaeBlock &src)
 Copy constructor. More...
 
 CaeBlock (PWGM_HBLOCK block)
 Block handle constructor. More...
 
 CaeBlock (PWGM_HGRIDMODEL model, PWP_UINT32 ndx=0)
 Model and block index constructor. More...
 
 ~CaeBlock ()
 Destructor. More...
 

Protected Attributes

PWGM_HBLOCK block_
 The bound PWGM_HBLOCK. More...
 

Detailed Description

The grid block base class.

This class cannot be directly instantiated. It can only be used as a subclass.

See also
CaeUnsBlock, CaeStrBlock.

Definition at line 174 of file CaeGridModel.h.

Constructor & Destructor Documentation

◆ CaeBlock() [1/4]

CaeBlock::CaeBlock ( const CaeBlock src)
inlineprotected

Copy constructor.

Binds this block to the same block as src.

Parameters
srcA block instance.

Definition at line 182 of file CaeGridModel.h.

References block_.

◆ ~CaeBlock()

CaeBlock::~CaeBlock ( )
inlineprotected

Destructor.

Definition at line 187 of file CaeGridModel.h.

◆ CaeBlock() [2/4]

CaeBlock::CaeBlock ( )
inlineprotected

Default constructor.

Constructs an invalid block.

Note
The block can be made valid using moveTo() or moveFirst().
See also
moveTo(), moveFirst(), moveNext(), movePrev()

Definition at line 388 of file CaeGridModel.h.

References block_.

◆ CaeBlock() [3/4]

CaeBlock::CaeBlock ( PWGM_HBLOCK  block)
inlineprotected

Block handle constructor.

Constructs a block bound to the specified handle.

Parameters
blockThe block handle to bind.
See also
CaeUnsBlock, CaeStrBlock

Definition at line 399 of file CaeGridModel.h.

◆ CaeBlock() [4/4]

CaeBlock::CaeBlock ( PWGM_HGRIDMODEL  model,
PWP_UINT32  ndx = 0 
)
inlineprotected

Model and block index constructor.

Constructs a block bound to the grid block at the specified index.

Parameters
modelThe grid model handle.
ndxThe block's index.
See also
CaeUnsBlock, CaeStrBlock

Definition at line 409 of file CaeGridModel.h.

References moveTo().

Member Function Documentation

◆ condition()

bool CaeBlock::condition ( PWGM_CONDDATA condData) const
inline

Gets the block's condition data.

Parameters
condDataThe PWGM_CONDDATA buffer.
Returns
true if successful.
Sample usage:
// see CaeUnsXMLCPP::writeBlock() above
if (block.condition(cData)) {
writeCondData(cData);
}
void
CaeUnsXMLCPP::writeCondData(const PWGM_CONDDATA &condData)
{
fprintf(fp(), "%s<condition name='%s' id='%ld' type='%s' typeid='%ld' />\n",
tabs(), condData.name, (long)condData.id, condData.type,
(long)condData.tid);
}

Definition at line 215 of file CaeGridModel.h.

References block_, and PwBlkCondition().

◆ data()

bool CaeBlock::data ( PWGM_BLOCKDATA data)
inline

Get the block data.

Parameters
dataA PWGM_BLOCKDATA buffer.
Returns
true if successful.
See also
PwBlock()

Definition at line 225 of file CaeGridModel.h.

References block_, and PwBlock().

◆ index()

PWP_UINT32 CaeBlock::index ( ) const
inline

Get a block's index.

Returns
The block's grid model index.
See also
CaeGridModel::enumBlocks()

Definition at line 197 of file CaeGridModel.h.

References block_, and PWGM_HBLOCK_ID.

◆ isValid()

bool CaeBlock::isValid ( ) const
inline

Determines a block's validity.

Returns
true if the block is valid.

Definition at line 242 of file CaeGridModel.h.

References block_, and PWGM_HBLOCK_ISVALID.

◆ moveFirst()

CaeBlock& CaeBlock::moveFirst ( PWGM_HGRIDMODEL  model)
inline

Rebinds an instance to the first block in a model.

Parameters
modelThe grid model.
Returns
A self reference.
Note
Equivalent to calling moveTo(model, 0).
See also
moveTo(), movePrev(), moveNext()

Definition at line 288 of file CaeGridModel.h.

References moveTo().

◆ moveNext()

CaeBlock& CaeBlock::moveNext ( )
inline

Rebinds an instance to the next block in a model.

Returns
A self reference.
Note
If already on the last block, the block will become invalid.
See also
moveTo(), moveFirst(), movePrev(), isValid()

Definition at line 298 of file CaeGridModel.h.

References block_, PWGM_HBLOCK_H, PWGM_HBLOCK_ID, and PwModEnumBlocks().

Referenced by operator++().

◆ movePrev()

CaeBlock& CaeBlock::movePrev ( )
inline

Rebinds an instance to the previous block in a model.

Returns
A self reference.
Note
If already on the first block, the block will become invalid.
See also
moveTo(), moveFirst(), movePrev(), moveNext(), isValid()

Definition at line 333 of file CaeGridModel.h.

References block_, PWGM_HBLOCK_H, PWGM_HBLOCK_ID, and PwModEnumBlocks().

Referenced by operator--().

◆ moveTo()

CaeBlock& CaeBlock::moveTo ( PWGM_HGRIDMODEL  model,
PWP_UINT32  ndx 
)
inline

Rebinds an instance to a specific model block.

Parameters
modelThe grid model.
ndxThe block's index.
Returns
A self reference.
Note
If ndx is not a valid index, the block will become invalid.
See also
moveFirst(), movePrev(), moveNext(), isValid()

Definition at line 276 of file CaeGridModel.h.

References block_, and PwModEnumBlocks().

Referenced by CaeBlock(), and moveFirst().

◆ operator PWGM_HBLOCK()

CaeBlock::operator PWGM_HBLOCK ( ) const
inline

The PWGM_HBLOCK cast operator.

Definition at line 376 of file CaeGridModel.h.

References block_.

◆ operator++() [1/2]

CaeBlock& CaeBlock::operator++ ( )
inline

Prefix increment to the next block in a model.

Returns
A self reference.
Note
Equivalent to calling moveNext().
If already on the last block, the block will become invalid.
See also
moveTo(), moveFirst(), movePrev(), isValid()

Definition at line 311 of file CaeGridModel.h.

References moveNext().

Referenced by operator++().

◆ operator++() [2/2]

CaeBlock CaeBlock::operator++ ( int  )
inline

Postfix increment to the next block in a model.

Returns
A copy of the block before it was moved.
Note
If already on the last block, the block will become invalid.
See also
moveTo(), moveFirst(), movePrev(), moveNext(), isValid()

Definition at line 321 of file CaeGridModel.h.

References operator++().

◆ operator--() [1/2]

CaeBlock& CaeBlock::operator-- ( )
inline

Prefix decrement to the previous block in a model.

Returns
A self reference.
Note
Equivalent to calling movePrev().
If already on the first block, the block will become invalid.
See also
moveTo(), moveFirst(), movePrev(), moveNext(), isValid()

Definition at line 346 of file CaeGridModel.h.

References movePrev().

Referenced by operator--().

◆ operator--() [2/2]

CaeBlock CaeBlock::operator-- ( int  )
inline

Postfix decrement to the previous block in a model.

Returns
A copy of the block before it was moved.
Note
If already on the first block, the block will become invalid.
See also
moveTo(), moveFirst(), movePrev(), moveNext(), isValid()

Definition at line 356 of file CaeGridModel.h.

References operator--().

◆ operator=() [1/2]

CaeBlock& CaeBlock::operator= ( const CaeBlock rhs)
inline

Assignment operator.

Rebind this block to the same block as rhs.

Parameters
rhsA patch instance.
Returns
A self reference.

Definition at line 252 of file CaeGridModel.h.

References block_.

◆ operator=() [2/2]

CaeBlock& CaeBlock::operator= ( PWGM_HBLOCK  block)
inline

Assignment operator.

Rebind this instance to the specified block handle.

Parameters
blockThe block handle.
Returns
A self reference.

Definition at line 263 of file CaeGridModel.h.

References block_.

◆ operator==()

bool CaeBlock::operator== ( const CaeBlock rhs) const
inline

Compares two CaeBlock instances for equality.

Returns
true if both instances are bound to the same grid block or both blocks are invalid.

Definition at line 371 of file CaeGridModel.h.

References block_.

◆ setExportName()

bool CaeBlock::setExportName ( const char *  name)
inline

Set the name used to identify the block or group of blocks in the exported grid.

Parameters
nameThe exported name.
Returns
true if successful.
See also
PwBlkSetExportName()

Definition at line 236 of file CaeGridModel.h.

References block_, and PwBlkSetExportName().

Member Data Documentation

◆ block_

PWGM_HBLOCK CaeBlock::block_
protected

The documentation for this class was generated from the following file:
PWGM_CONDDATA::id
PWP_UINT32 id
grid-defined condition id
Definition: apiGridModel.h:646
PWGM_CONDDATA::tid
PWP_UINT32 tid
cae-defined condition id
Definition: apiGridModel.h:648
PWGM_CONDDATA::name
const char * name
grid-defined condition name
Definition: apiGridModel.h:645
PWGM_CONDDATA::type
const char * type
cae-defined condition physical type name
Definition: apiGridModel.h:647
PWGM_CONDDATA
Condition descriptor data type.
Definition: apiGridModel.h:644