Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
CaeUnsElementGroup Class Referenceabstract

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

virtual CaeUnsElementGroup::~CaeUnsElementGroup ( )
inlinevirtual

Destructor.

Definition at line 48 of file CaeUnsElementGroup.h.

Member Function Documentation

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().

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().

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--().

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().

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: