From fff7470f1d74b0085355130350fa834ea8d37069 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 6 May 2015 13:50:11 +0200 Subject: Make XML array handling consistent setContent and getContent were using different XML formats previously. --- include/astra/XMLNode.h | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'include/astra') diff --git a/include/astra/XMLNode.h b/include/astra/XMLNode.h index f79c1a8..4d29d5c 100644 --- a/include/astra/XMLNode.h +++ b/include/astra/XMLNode.h @@ -119,14 +119,8 @@ public: */ vector getContentArray() const; - /** Get the content of the XML node as a c-array of float32 data. - * - * @param _pfData data array, shouldn't be initialized already. - * @param _iSize number of elements stored in _pfData - */ - void getContentNumericalArray(float32*& _pfData, int& _iSize) const; - /** Get the content of the XML node as a stl container of float32 data. + * NB: A 2D matrix is returned as a linear list * * @return node content */ @@ -259,13 +253,38 @@ public: */ void setContent(float32 _fValue); - /** Add a list of numerical data to the node: <...>_sText</...> + /** Add a list of numerical data to the node * * @param _pfList data * @param _iSize number of elements in the list */ void setContent(float32* _pfList, int _iSize); + /** Add a list of numerical data to the node + * + * @param _pfList data + * @param _iSize number of elements in the list + */ + void setContent(double* _pfList, int _iSize); + + /** Add a (2D) matrix of numerical data to the node + * + * @param _pfMatrix data + * @param _iWidth width of the matrix + * @param _iHeight height of the matrix + * @param transposed true is C order, false is Fortran order + */ + void setContent(float32* _pfMatrix, int _iWidth, int _iHeight, bool transposed); + + /** Add a (2D) matrix of numerical data to the node + * + * @param _pfMatrix data + * @param _iWidth width of the matrix + * @param _iHeight height of the matrix + * @param transposed true is C order, false is Fortran order + */ + void setContent(double* _pfMatrix, int _iWidth, int _iHeight, bool transposed); + /** Add an attribute to this node: <... _sName="_sValue"> * * @param _sName name of the attribute -- cgit v1.2.3