1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/*
|
|
|
|
* File: math_root.h
|
|
|
|
* Purpose: Declaration of the root object
|
|
|
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
|
|
|
* Created: January 1999
|
|
|
|
* Description: Root math object
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright: 1999 Alejandro Aguilar Sierra
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* You are free to use and modify this code under the terms of
|
|
|
|
* the GNU General Public Licence version 2 or later.
|
|
|
|
*/
|
|
|
|
|
1999-11-15 11:06:41 +00:00
|
|
|
#ifndef MATH_ROOT
|
|
|
|
#define MATH_ROOT
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
#include "math_sqrtinset.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "symbol_def.h"
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-02-16 09:25:43 +00:00
|
|
|
/** The general n-th root inset.
|
|
|
|
\author Alejandro Aguilar Sierra
|
|
|
|
\version January 1999
|
|
|
|
*/
|
|
|
|
class MathRootInset : public MathSqrtInset {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
explicit
|
|
|
|
MathRootInset(short st = LM_ST_TEXT);
|
|
|
|
///
|
|
|
|
MathedInset * Clone();
|
|
|
|
///
|
|
|
|
void draw(Painter &, int x, int baseline);
|
|
|
|
///
|
|
|
|
void Write(std::ostream &, bool fragile);
|
|
|
|
///
|
|
|
|
void Metrics();
|
|
|
|
///
|
|
|
|
bool Inside(int, int);
|
|
|
|
///
|
|
|
|
void SetFocus(int, int);
|
|
|
|
///
|
2001-02-20 16:00:22 +00:00
|
|
|
void setData(MathedArray const &);
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
|
|
|
void GetXY(int & x, int & y) const;
|
|
|
|
///
|
2001-02-20 16:00:22 +00:00
|
|
|
MathedArray & GetData();
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
|
|
|
bool setArgumentIdx(int i);
|
|
|
|
///
|
|
|
|
int getArgumentIdx() const;
|
|
|
|
///
|
|
|
|
int getMaxArgumentIdx() const;
|
|
|
|
///
|
|
|
|
void SetStyle(short);
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
int idx_;
|
|
|
|
///
|
2001-02-28 11:56:36 +00:00
|
|
|
MathParInset uroot_;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
|
|
|
int wroot_;
|
|
|
|
///
|
|
|
|
int dh_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
2001-02-16 09:25:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
int MathRootInset::getArgumentIdx() const
|
|
|
|
{
|
|
|
|
return idx_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
|
|
|
int MathRootInset::getMaxArgumentIdx() const
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|