Pointwise Plugin SDK
|
The unstructured grid model face stream handler class. More...
#include <CaeUnsGridModel.h>
Public Member Functions | |
virtual PWP_UINT32 | streamBegin (const PWGM_BEGINSTREAM_DATA &data) |
Virtual begin stream implementation. More... | |
virtual PWP_UINT32 | streamEnd (const PWGM_ENDSTREAM_DATA &data) |
Virtual end stream implementation. More... | |
virtual PWP_UINT32 | streamFace (const PWGM_FACESTREAM_DATA &data)=0 |
Pure virtual face stream handler method. More... | |
virtual | ~CaeFaceStreamHandler () |
Destructor. More... | |
The unstructured grid model face stream handler class.
Handler objects passed to CaeUnsGridModel::streamFaces() must inherit the CaeFaceStreamHandler class and implement the streamFace() pure virtual method. Optionally, the subclass can also reimplement the streamBegin() and streamEnd() virtual methods as needed.
The following snippets are extracted from the unstructured XML sample plugin (CaeUnsXMLCPP).
The CaeUnsXMLCPP plugin sets the desired face and element type ordering in its CaeUnsXMLCPP::beginExport()
method. The face order is obtained from the published faceOrder attribute. The element type order is hard-coded to TRI, QUAD, other.
During the execution of the CaeUnsXMLCPP::write()
method, the CaeUnsXMLCPP plugin starts streaming faces with a call to its CaeUnsXMLCPP::writeFaces()
method. Since CaeUnsXMLCPP inherits from CaeFaceStreamHandler, it uses itself, *this
, as the stream handler. Faces will only be steamed if the export has not been aborted and if CaePlugin::conditionsOnly()
returns false.
The CaeUnsXMLCPP plugin implements the stream handler methods. CaeUnsXMLCPP::streamBegin()
writes an XML <faces>
tag followed by the element count details. CaeUnsXMLCPP::streamFace()
calls CaeUnsXMLCPP::writeFaceData()
for each streamed face. CaeUnsXMLCPP::streamEnd()
writes an XML </faces>
tag. In all cases, the handler functions return the value from a progress method. These methods only return false if the export has been aborted.
CaeUnsXMLCPP::writeFaceData()
writes an XML <face>
tag. Depending on the face's data.type
, different tag attributes are written. If a boundary face, the condition data is written with a call to CaeUnsXMLCPP::writeCondData()
. For all faces, the element connectivity is written with a call to CaeUnsXMLCPP::writeElemData()
. Finally, a closing </face>
tag is written.
CaeUnsXMLCPP::writeElemData()
writes a self-closed XML <element
/> tag.
Definition at line 72 of file CaeUnsGridModel.h.
|
inlinevirtual |
Destructor.
Definition at line 76 of file CaeUnsGridModel.h.
|
inlinevirtual |
Virtual begin stream implementation.
This method is called only once by CaeUnsGridModel::streamFaces() just before faces are streamed.
Subclasses are not required to implement this virtual method. The default implementation does nothing and returns 1.
data | The begin stream data. |
Definition at line 93 of file CaeUnsGridModel.h.
References PWGM_BEGINSTREAM_DATA::userData.
Referenced by beginCB().
|
inlinevirtual |
Virtual end stream implementation.
This method is called only once by CaeUnsGridModel::streamFaces() after all faces have been streamed.
Subclasses are not required to implement this virtual method. The default implementation does nothing and returns 1.
data | The end stream data. |
Definition at line 126 of file CaeUnsGridModel.h.
References PWGM_ENDSTREAM_DATA::userData.
Referenced by endCB().
|
pure virtual |
Pure virtual face stream handler method.
This method is called once by CaeUnsGridModel::streamFaces() for each face in the grid model.
Subclasses are required to implement this virtual method.
data | The face data. |
Referenced by faceCB().