2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
2007-04-25 03:01:35 +00:00
|
|
|
|
* \file InsetMathLim.cpp
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2003-08-02 11:30:30 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathLim.h"
|
2007-04-25 16:11:45 +00:00
|
|
|
|
#include "MathArray.h"
|
2006-10-22 10:15:23 +00:00
|
|
|
|
#include "MathStream.h"
|
2002-07-12 11:21:21 +00:00
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
using std::auto_ptr;
|
2003-08-02 11:30:30 +00:00
|
|
|
|
using std::endl;
|
2003-07-25 17:11:25 +00:00
|
|
|
|
|
2002-07-12 11:21:21 +00:00
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathLim::InsetMathLim
|
2002-07-12 11:21:21 +00:00
|
|
|
|
(MathArray const & f, MathArray const & x, MathArray const & x0)
|
2006-09-16 18:11:38 +00:00
|
|
|
|
: InsetMathNest(3)
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
|
|
|
|
cell(0) = f;
|
|
|
|
|
cell(1) = x;
|
|
|
|
|
cell(2) = x0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
auto_ptr<InsetBase> InsetMathLim::doClone() const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
2006-09-16 18:11:38 +00:00
|
|
|
|
return auto_ptr<InsetBase>(new InsetMathLim(*this));
|
2002-07-12 11:21:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathLim::normalize(NormalStream & os) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
|
|
|
|
os << "[lim " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-11-28 15:15:49 +00:00
|
|
|
|
bool InsetMathLim::metrics(MetricsInfo &, Dimension &) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
2003-08-02 11:30:30 +00:00
|
|
|
|
lyxerr << "should not happen" << endl;
|
2006-11-28 15:15:49 +00:00
|
|
|
|
return true;
|
2002-07-12 11:21:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathLim::draw(PainterInfo &, int, int) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
2003-08-02 11:30:30 +00:00
|
|
|
|
lyxerr << "should not happen" << endl;
|
2002-07-12 11:21:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathLim::maple(MapleStream & os) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
|
|
|
|
os << "limit(" << cell(0) << ',' << cell(1) << '=' << cell(2) << ')';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathLim::maxima(MaximaStream & os) const
|
2006-09-02 01:57:36 +00:00
|
|
|
|
{
|
|
|
|
|
os << "limit(" << cell(0) << ',' << cell(1) << ',' << cell(2) << ')';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathLim::mathematica(MathematicaStream & os) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
2006-09-02 01:57:36 +00:00
|
|
|
|
os << "Limit[" << cell(0) << ',' << cell(1) << "-> " << cell(2) << ']';
|
2002-07-12 11:21:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void InsetMathLim::mathmlize(MathStream & os) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
|
|
|
|
os << "lim(" << cell(0) << ',' << cell(1) << ',' << cell(2) << ')';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void InsetMathLim::write(WriteStream &) const
|
2002-07-12 11:21:21 +00:00
|
|
|
|
{
|
2003-08-02 11:30:30 +00:00
|
|
|
|
lyxerr << "should not happen" << endl;
|
2002-07-12 11:21:21 +00:00
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|