2001-02-13 13:28:32 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
#ifndef MATH_MATRIXINSET_H
|
|
|
|
#define MATH_MATRIXINSET_H
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "math_parinset.h"
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
/** Multiline math paragraph base class.
|
|
|
|
This is the base to all multiline editable math objects
|
2001-02-16 09:25:43 +00:00
|
|
|
like array and eqnarray.
|
|
|
|
\author Alejandro Aguilar Sierra
|
|
|
|
*/
|
|
|
|
class MathMatrixInset : public MathParInset {
|
|
|
|
public:
|
|
|
|
///
|
2001-02-28 17:21:16 +00:00
|
|
|
MathMatrixInset(int m, int n, short st = LM_ST_TEXT);
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2001-02-26 12:53:35 +00:00
|
|
|
MathedInset * Clone();
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
|
|
|
void draw(Painter &, int, int);
|
|
|
|
///
|
|
|
|
void Write(std::ostream &, bool fragile);
|
|
|
|
///
|
|
|
|
void Metrics();
|
|
|
|
///
|
2001-02-20 16:00:22 +00:00
|
|
|
void setData(MathedArray const &);
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
|
|
|
void SetAlign(char, string const &);
|
|
|
|
///
|
|
|
|
int GetColumns() const;
|
|
|
|
///
|
|
|
|
int GetRows() const;
|
|
|
|
///
|
|
|
|
virtual bool isMatrix() const;
|
2001-03-16 12:54:34 +00:00
|
|
|
|
2001-02-16 09:25:43 +00:00
|
|
|
private:
|
|
|
|
/// Number of columns & rows
|
|
|
|
int nc_;
|
|
|
|
///
|
|
|
|
int nr_;
|
|
|
|
/// tab sizes
|
|
|
|
std::vector<int> ws_;
|
|
|
|
///
|
|
|
|
char v_align_; // add approp. type
|
|
|
|
///
|
2001-02-13 13:28:32 +00:00
|
|
|
//std::vector<char> h_align;
|
2001-02-16 09:25:43 +00:00
|
|
|
string h_align_; // a vector would perhaps be more correct
|
2001-02-13 13:28:32 +00:00
|
|
|
};
|
2001-02-16 09:25:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
int MathMatrixInset::GetColumns() const
|
|
|
|
{
|
|
|
|
return nc_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
int MathMatrixInset::GetRows() const
|
|
|
|
{
|
|
|
|
return nr_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
bool MathMatrixInset::isMatrix() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
#endif
|