Commit 6fa4b32c authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

nary (new)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48108 954022d7-b5bf-4e40-9824-e11837661b57
parent 6a56a3a1
......@@ -7,14 +7,17 @@ function CDegreeOrdinary()
extend(CDegreeOrdinary, CMathBase);
CDegreeOrdinary.prototype.init = function()
{
this.setDimension(1, 2);
var oBase = new CMathContent();
this.init_2(oBase);
}
CDegreeOrdinary.prototype.init_2 = function(base)
{
this.setDimension(1, 2);
var oDegree = new CMathContent();
oDegree.setReduct(DEGR_REDUCT);
var degree = new CMathContent();
degree.setReduct(DEGR_REDUCT);
this.addMCToContent(oBase, oDegree);
this.addMCToContent(base, degree);
}
CDegreeOrdinary.prototype.old_setContent = function()
{
......
......@@ -205,6 +205,9 @@ CMathContent.prototype =
case 8:
mathElem = new CNary();
break;
case 30:
mathElem = new CMathBase();
break;
}
if( mathElem !== null )
......@@ -438,11 +441,319 @@ CMathContent.prototype =
integr.init(0,0,0);
integr.fillPlaceholders();
break;
case 24:
var integr = this.createMComponent(8);
integr.init(0,1,3);
integr.fillPlaceholders();
break;
case 25:
var integr = this.createMComponent(8);
integr.init(0,0,3);
integr.fillPlaceholders();
break;
case 26:
var integr = this.createMComponent(8);
integr.init(1,0,0);
integr.fillPlaceholders();
break;
case 27:
var integr = this.createMComponent(8);
integr.init(1,1,3);
integr.fillPlaceholders();
break;
case 28:
var integr = this.createMComponent(8);
integr.init(1,0,3);
integr.fillPlaceholders();
break;
case 29:
var integr = this.createMComponent(8);
integr.init(2,0,0);
integr.fillPlaceholders();
break;
case 30:
var integr = this.createMComponent(8);
integr.init(2,1,3);
integr.fillPlaceholders();
break;
case 31:
var integr = this.createMComponent(8);
integr.init(2,0,3);
integr.fillPlaceholders();
break;
case 32:
var integr = this.createMComponent(8);
integr.init(3,0,0);
integr.fillPlaceholders();
break;
case 33:
var integr = this.createMComponent(8);
integr.init(3,1,3);
integr.fillPlaceholders();
break;
case 34:
var integr = this.createMComponent(8);
integr.init(3,0,3);
integr.fillPlaceholders();
break;
case 35:
var integr = this.createMComponent(8);
integr.init(4,0,0);
integr.fillPlaceholders();
break;
case 36:
var integr = this.createMComponent(8);
integr.init(4,1,3);
integr.fillPlaceholders();
break;
case 37:
var integr = this.createMComponent(8);
integr.init(4,0,3);
integr.fillPlaceholders();
break;
case 38:
var integr = this.createMComponent(8);
integr.init(5,0,0);
integr.fillPlaceholders();
break;
case 39:
var integr = this.createMComponent(8);
integr.init(5,1,3);
integr.fillPlaceholders();
break;
case 40:
var integr = this.createMComponent(8);
integr.init(5,0,3);
integr.fillPlaceholders();
break;
case 41:
var base = this.createMComponent(30);
base.setDimension(1,1);
base.setContent();
var elem = base.getElement(0,0);
elem.addTxt("dx");
break;
case 42:
var base = this.createMComponent(30);
base.setDimension(1,1);
base.setContent();
var elem = base.getElement(0,0);
elem.addTxt("dy");
break;
case 43:
var base = this.createMComponent(30);
base.setDimension(1,1);
base.setContent();
var elem = base.getElement(0,0);
elem.addTxt("");
break;
case 44:
var sigma = this.createMComponent(8);
sigma.init(6,0,0);
sigma.fillPlaceholders();
break;
case 45:
var sigma = this.createMComponent(8);
sigma.init(6,0,3);
sigma.fillPlaceholders();
break;
case 46:
var sigma = this.createMComponent(8);
sigma.init(6,1,3);
sigma.fillPlaceholders();
break;
case 47:
var sigma = this.createMComponent(8);
sigma.init(6,0,2);
sigma.fillPlaceholders();
break;
case 48:
var sigma = this.createMComponent(8);
sigma.init(6,1,2);
sigma.fillPlaceholders();
break;
case 49:
var product = this.createMComponent(8);
product.init(7,0,0);
product.fillPlaceholders();
break;
case 50:
var product = this.createMComponent(8);
product.init(7,0,3);
product.fillPlaceholders();
break;
case 51:
var product = this.createMComponent(8);
product.init(7,1,3);
product.fillPlaceholders();
break;
case 52:
var product = this.createMComponent(8);
product.init(7,0,2);
product.fillPlaceholders();
break;
case 53:
var product = this.createMComponent(8);
product.init(7,1,2);
product.fillPlaceholders();
break;
case 54:
var product = this.createMComponent(8);
product.init(8,0,0);
product.fillPlaceholders();
break;
case 55:
var product = this.createMComponent(8);
product.init(8,0,3);
product.fillPlaceholders();
break;
case 56:
var product = this.createMComponent(8);
product.init(8,1,3);
product.fillPlaceholders();
break;
case 57:
var product = this.createMComponent(8);
product.init(8,0,2);
product.fillPlaceholders();
break;
case 58:
var product = this.createMComponent(8);
product.init(8,1,2);
product.fillPlaceholders();
break;
case 59:
var union = this.createMComponent(8);
union.init(9,0,0);
union.fillPlaceholders();
break;
case 60:
var union = this.createMComponent(8);
union.init(9,0,3);
union.fillPlaceholders();
break;
case 61:
var union = this.createMComponent(8);
union.init(9,1,3);
union.fillPlaceholders();
break;
case 62:
var union = this.createMComponent(8);
union.init(9,0,2);
union.fillPlaceholders();
break;
case 63:
var union = this.createMComponent(8);
union.init(9,1,2);
union.fillPlaceholders();
break;
case 64:
var union = this.createMComponent(8);
union.init(10,0,0);
union.fillPlaceholders();
break;
case 65:
var union = this.createMComponent(8);
union.init(10,0,3);
union.fillPlaceholders();
break;
case 66:
var union = this.createMComponent(8);
union.init(10,1,3);
union.fillPlaceholders();
break;
case 67:
var union = this.createMComponent(8);
union.init(10,0,2);
union.fillPlaceholders();
break;
case 68:
var union = this.createMComponent(8);
union.init(10,1,2);
union.fillPlaceholders();
break;
case 69:
var logicalOr = this.createMComponent(8);
logicalOr.init(11,0,0);
logicalOr.fillPlaceholders();
break;
case 70:
var logicalOr = this.createMComponent(8);
logicalOr.init(11,0,3);
logicalOr.fillPlaceholders();
break;
case 71:
var logicalOr = this.createMComponent(8);
logicalOr.init(11,1,3);
logicalOr.fillPlaceholders();
break;
case 72:
var logicalOr = this.createMComponent(8);
logicalOr.init(11,0,2);
logicalOr.fillPlaceholders();
break;
case 73:
var logicalOr = this.createMComponent(8);
logicalOr.init(11,1,2);
logicalOr.fillPlaceholders();
break;
case 74:
var logicalOr = this.createMComponent(8);
logicalOr.init(12,0,0);
logicalOr.fillPlaceholders();
break;
case 75:
var logicalOr = this.createMComponent(8);
logicalOr.init(12,0,3);
logicalOr.fillPlaceholders();
break;
case 76:
var logicalOr = this.createMComponent(8);
logicalOr.init(12,1,3);
logicalOr.fillPlaceholders();
break;
case 77:
var logicalOr = this.createMComponent(8);
logicalOr.init(12,0,2);
logicalOr.fillPlaceholders();
break;
case 78:
var logicalOr = this.createMComponent(8);
logicalOr.init(12,1,2);
logicalOr.fillPlaceholders();
break;
case 79:
var sigma = this.createMComponent(8);
sigma.init(6,0,2);
var iter = sigma.getLowerIterator();
iter.addTxt("k");
var base = sigma.getBase();
var fract = base.createMComponent(0);
fract.init();
fract.hideBar(true);
var num = fract.getNumerator();
num.addTxt("n");
var den = fract.getDenominator();
den.addTxt("k");
break;
case 80:
var sigma = this.createMComponent(8);
sigma.init(6,0,3);
var iterUp = sigma.getUpperIterator();
iterUp.addTxt("n");
var iterLow = sigma.getLowerIterator();
iterLow.addTxt("i=0");
var base = sigma.getBase();
base.fillPlaceholders();
break;
/*case 24:
var integr = this.createMComponent(8);
integr.init(0,0,1);
......
......@@ -73,9 +73,33 @@ CNary.prototype.init = function(index, orderType, iterType)
base.init(sign);
}
}
else if(orderType == 1)
{
if(iterType == 1)
{
base = new CDegreeOrdinary();
base.init_2(sign);
base.setIndex(1);
}
else if(iterType == 2)
{
base = new CDegreeOrdinary();
base.init_2(sign);
base.setIndex(-1);
}
else if(iterType == 3)
{
base = new CDegreeSubSup(0);
base.init_2(sign);
}
}
this.addMCToContent(base, arg);
}
CNary.prototype.setDistance = function()
{
this.dW = this.Parent.getTxtPrp().FontSize/36*2.45;
}
CNary.prototype.getBase = function()
{
return this.elements[0][1];
......@@ -110,7 +134,11 @@ CNaryUnd.prototype.setDistance = function()
}
CNaryUnd.prototype.getCenter = function()
{
return this.elements[0][0].size.height + this.dW + this.elements[1][0].size.center ;
return this.elements[0][0].size.height + this.dH + this.elements[1][0].size.center ;
}
CNaryUnd.prototype.getUpperIterator = function()
{
return this.elements[0][0];
}
......@@ -137,6 +165,10 @@ CNaryOvr.prototype.getCenter = function()
{
return this.elements[0][0].size.center;
}
CNaryOvr.prototype.getLowerIterator= function()
{
return this.elements[1][0];
}
function CNaryUndOvr()
{
......@@ -239,6 +271,15 @@ CNaryUndOvr.prototype.findDisposition = function(mCoord)
return {pos: {x: pos_x, y: pos_y}, mCoord: {x: X, y: Y}, inside_flag: inside_flag};
}
CNaryUndOvr.prototype.getLowerIterator = function()
{
return this.elements[2][0];
}
CNaryUndOvr.prototype.getUpperIterator = function()
{
return this.elements[0][0];
}
function CNaryOperator(flip)
......@@ -444,7 +485,7 @@ CSigma.prototype.getCoord = function()
X[35] = 16252; Y[35] = 5200;
var textScale = this.params.font.FontSize/850; // 1000 pt
var textScale = this.Parent.getTxtPrp().FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64;
var h1 = Y[0] - Y[21],
......@@ -515,7 +556,7 @@ CSigma.prototype.calculateSizeGlyph = function()
{
// пока размер не меняем в зависимости от высоты аргумента
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 8.997900390624999*betta,
_height = 11.994444444444444*betta;
......@@ -646,7 +687,7 @@ CProduct.prototype.getCoord = function()
X[62] = 67894; Y[62] = 0;
var textScale = this.params.font.FontSize/850, // 1000 pt
var textScale = this.Parent.getTxtPrp().FontSize/850, // 1000 pt
alpha = textScale*25.4/96 /64;
var h1 = Y[9],
......@@ -676,7 +717,7 @@ CProduct.prototype.getCoord = function()
}
CProduct.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 10.312548828125*betta,
_height = 11.994444444444444*betta;
......@@ -747,8 +788,7 @@ CUnion.prototype.getCoord = function()
}
CUnion.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
this.gap = 0.93*betta;
var _width = 9.38*betta,
......@@ -866,7 +906,7 @@ CLogicalOr.prototype.getCoord = function()
X[6] = 10613; Y[6] = 0;
X[7] = 0; Y[7] = 0;
var textScale = this.params.font.FontSize/850, // 1000 pt
var textScale = this.Parent.getTxtPrp().FontSize/850, // 1000 pt
alpha = textScale*25.4/96 /64;
var w1 = X[1],
......@@ -897,14 +937,7 @@ CLogicalOr.prototype.getCoord = function()
}
CLogicalOr.prototype.calculateSizeGlyph = function()
{
/*var sign = new CMathText(this.params);
sign.init(0x22C1);
var size = sign.size;*/
//var _width = 8.819444444444445,
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 9.6159*betta,
_height = 11.994444444444444*betta;
......@@ -1173,7 +1206,7 @@ CDoubleIntegral.prototype.drawPath = function(XX, YY)
}
CDoubleIntegral.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 14.2296*betta,
_height = 13.7*betta;
......@@ -1223,7 +1256,7 @@ CTripleIntegral.prototype.drawPath = function(XX, YY)
}
CTripleIntegral.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 18.925368*betta,
_height = 13.7*betta;
......@@ -2664,7 +2697,7 @@ CContourIntegral.prototype.draw = function()
WW = coord2.W,
HH = coord2.H;
var textScale = this.params.font.FontSize/850; // 1000 pt
var textScale = this.Parent.getTxtPrp().FontSize/850;// 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
var shX = (WW - W)*alpha/2,
......@@ -2708,7 +2741,7 @@ CContourIntegral.prototype.draw = function()
}
CContourIntegral.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 8.624*betta,
_height = 13.7*betta;
......@@ -3167,7 +3200,7 @@ CSurfaceIntegral.prototype.draw = function()
HH = coord2.H;
var textScale = this.params.font.FontSize/850; // 1000 pt
var textScale = this.Parent.getTxtPrp().FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -3213,7 +3246,7 @@ CSurfaceIntegral.prototype.draw = function()
}
CSurfaceIntegral.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 14.2296*betta,
_height = 13.7*betta;
......@@ -3742,7 +3775,7 @@ CVolumeIntegral.prototype.draw = function()
HH = coord2.H;
var textScale = this.params.font.FontSize/850; // 1000 pt
var textScale = this.Parent.getTxtPrp().FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -3788,7 +3821,7 @@ CVolumeIntegral.prototype.draw = function()
}
CVolumeIntegral.prototype.calculateSizeGlyph = function()
{
var betta = this.params.font.FontSize/36;
var betta = this.Parent.getTxtPrp().FontSize/36;
var _width = 18.925368*betta,
_height = 13.7*betta;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment