根据结果的基本分量的个数XT已经预置了RltScale、RltComplex、RltVector、RltTensor等几类通用结果类型。 扩展结果时,对象类应根据基本分量的个数或者从RltScale、RltVector、RltTensor中其一或者直接从XResult继承。以向量结果为例,需按照下列代码重新实现基类的接口。
class NewVecRlt: public XResult
{
DECLARE_CITEM(NewVecRlt)
public:
NewVecRlt(ulong id);
bool buildDerivedComponent(TypeID t);
};
REGISTER_CITEM(NewVecRlt, "CRLTNEWVECRLT", ResultManager::ctype(), 0);
NewVecRlt::NewVecRlt(ulong id, int type) : XResult(id, type)
{
m_oHeader.m_iDof = 3;
*this << Component_Vector_X << Component_Vector_Y << Component_Vector_Z << Component_Vector_Mag;
}