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

The unstructured element group class. More...

#include <CaeUnsElementGroup.h>

+ Inheritance diagram for CaeUnsElementGroup:

Public Member Functions

PWP_UINT32 elementCount (PWGM_ELEMCOUNTS *pDetails=0) const
 Get the number of elements in the group. More...
 
PWGM_HELEMENT enumElements (PWP_UINT32 ndx) const
 Get an element in the group. More...
 
PWGM_HELEMENT firstElement () const
 Get the first element in the group. More...
 
virtual ~CaeUnsElementGroup ()
 Destructor. More...
 

Protected Member Functions

virtual PWP_UINT32 elementCountImpl (PWGM_ELEMCOUNTS *pDetails) const =0
 Get the number of elements in the group. More...
 
virtual PWGM_HELEMENT enumElementsImpl (PWP_UINT32 ndx) const =0
 Get an element in the group. More...
 

Detailed Description

The unstructured element group class.

The CaeUnsElementGroup class defines the required interface for a collection of PWGM_HELEMENT handles. This interface presents the element collection as a sequential array. The elements are addressed using an index from 0 to elementCount() - 1.

The public interface provides three methods; elementCount(), enumElements(), and firstElement(). These methods use two protected virtual methods to implement the behavior.

An element group subclass must inherit CaeUnsElementGroup and implement its two pure virtual methods; elementCountImpl() and enumElementsImpl(). This abstraction lets element group subclasses store the PWGM_HELEMENT handles any way it needs as long as they can be addressed sequentially.

Sample Usage:

The following snippet is extracted from CaeUnsBlock.

virtual PWP_UINT32 elementCountImpl(PWGM_ELEMCOUNTS *pDetails = 0) const {
return PwBlkElementCount(block_, pDetails);
}
return PwBlkEnumElements(block_, ndx);
}
See also
CaeUnsBlock, CaeUnsGridModel, CaeUnsPatch

Definition at line 44 of file CaeUnsElementGroup.h.

Constructor & Destructor Documentation

◆ ~CaeUnsElementGroup()

virtual CaeUnsElementGroup::~CaeUnsElementGroup ( )
inlinevirtual

Destructor.

Definition at line 48 of file CaeUnsElementGroup.h.

Member Function Documentation

◆ elementCount()

PWP_UINT32 CaeUnsElementGroup::elementCount ( PWGM_ELEMCOUNTS pDetails = 0) const
inline

Get the number of elements in the group.

Parameters
pDetailsOptional pointer to a PWGM_ELEMCOUNTS buffer. If provided, pDetails receives the breakdown of element counts by type.
Returns
The total number of elements in the group.

Definition at line 59 of file CaeUnsElementGroup.h.

References elementCountImpl().

Referenced by CaeUnsGridModel::patchElementCount().

◆ elementCountImpl()

virtual PWP_UINT32 CaeUnsElementGroup::elementCountImpl ( PWGM_ELEMCOUNTS pDetails) const
protectedpure virtual

Get the number of elements in the group.

Element group subclasses must implement this pure virtual method.

Parameters
pDetailsOptional pointer to a PWGM_ELEMCOUNTS buffer. If provided, pDetails receives the breakdown of element counts by type.
Returns
The total number of elements in the group.

Referenced by elementCount().

◆ enumElements()

PWGM_HELEMENT CaeUnsElementGroup::enumElements ( PWP_UINT32  ndx) const
inline

Get an element in the group.

Parameters
ndxThe element's sequential index.
Returns
The element's PWGM_HELEMENT. If ndx is invalid, the returned handle is invalid.
See also
PWGM_HELEMENT, PWGM_HELEMENT_ISVALID()

Definition at line 70 of file CaeUnsElementGroup.h.

References enumElementsImpl().

Referenced by CaeUnsElement::CaeUnsElement(), CaeUnsElement::moveFirst(), CaeUnsElement::moveNext(), CaeUnsElement::movePrev(), CaeUnsElement::moveTo(), CaeUnsElement::operator++(), and CaeUnsElement::operator--().

◆ enumElementsImpl()

virtual PWGM_HELEMENT CaeUnsElementGroup::enumElementsImpl ( PWP_UINT32  ndx) const
protectedpure virtual

Get an element in the group.

Element group subclasses must implement this pure virtual method.

Parameters
ndxThe element's sequential index.
Returns
The element's PWGM_HELEMENT. If ndx is invalid, the returned handle is invalid.
See also
PWGM_HELEMENT, PWGM_HELEMENT_ISVALID()

Referenced by enumElements(), and firstElement().

◆ firstElement()

PWGM_HELEMENT CaeUnsElementGroup::firstElement ( ) const
inline

Get the first element in the group.

Returns
The element's PWGM_HELEMENT. If the group is empty, the returned handle is invalid.
Note
Equivalent to enumElements(0)
See also
PWGM_HELEMENT, PWGM_HELEMENT_ISVALID()

Definition at line 81 of file CaeUnsElementGroup.h.

References enumElementsImpl().


The documentation for this class was generated from the following file:
PWGM_HELEMENT
Grid element handle declaration.
Definition: apiGridModel.h:427
PWP_UINT32
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
PwBlkEnumElements
PWGM_HELEMENT PwBlkEnumElements(PWGM_HBLOCK block, PWP_UINT32 ndx)
Sequentially enumerate the block elements.
Definition: apiGridModel.cxx:317
PwBlkElementCount
PWP_UINT32 PwBlkElementCount(PWGM_HBLOCK block, PWGM_ELEMCOUNTS *pCounts)
Get the number of block elements.
Definition: apiGridModel.cxx:309
CaeUnsElementGroup::enumElementsImpl
virtual PWGM_HELEMENT enumElementsImpl(PWP_UINT32 ndx) const =0
Get an element in the group.
PWGM_ELEMCOUNTS
Element count information.
Definition: apiGridModel.h:774
CaeUnsElementGroup::elementCountImpl
virtual PWP_UINT32 elementCountImpl(PWGM_ELEMCOUNTS *pDetails) const =0
Get the number of elements in the group.