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

1. N-арные опрераторы (переделала свойства)

2. добавила элемент Box

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49182 954022d7-b5bf-4e40-9824-e11837661b57
parent f46ffdc3
......@@ -216,6 +216,25 @@ CBorderBox.prototype.findDisposition = function(mCoord)
}
CBorderBox.prototype.getElement = function()
{
return this.elements[0][0];
}
function CBox()
{
this.type = null;
CMathBase.call(this);
}
extend(CBox, CMathBase);
CBox.prototype.init = function(props)
{
this.type = props.type;
this.bSpacing = ( props.spacing === 1 || props.spacing === true ) ? true : false;
this.setDimension(1, 1);
this.setContent();
}
CBox.prototype.getElement = function()
{
return this.elements[0][0];
}
\ No newline at end of file
......@@ -7,14 +7,7 @@ function CDegree()
extend(CDegree, CMathBase);
CDegree.prototype.init = function(props)
{
this.type = props.type;
this.setDimension(1, 2);
var oBase = new CMathContent();
var oDegree = new CMathContent();
oDegree.setReduct(DEGR_REDUCT);
this.addMCToContent(oBase, oDegree);
this.init_2( props, new CMathContent() );
}
CDegree.prototype.init_2 = function(props, oBase)
{
......@@ -42,12 +35,12 @@ CDegree.prototype.recalculateSize = function()
_width += this.dW;
if(this.type === 1 )
if(this.type === SUPERSCRIPT )
{
this.shiftDegree = 0;
_center = _height - (this.elements[0][0].size.height - this.elements[0][0].size.center);
}
else if(this.type === -1 )
else if(this.type === SUBSCRIPT )
{
this.shiftDegree = _height - this.elements[0][1].size.height;
_center = this.elements[0][0].size.center;
......
This diff is collapsed.
......@@ -26,5 +26,29 @@ var PreSubSup = -1;
var SQUARE_RADICAL = 0;
var DEGREE_RADICAL = 1;
var NARY_INTEGRAL = 0;
var NARY_DOUBLE_INTEGRAL = 1;
var NARY_TRIPLE_INTEGRAL = 2;
var NARY_CONTOUR_INTEGRAL = 3;
var NARY_SURFACE_INTEGRAL = 4;
var NARY_VOLUME_INTEGRAL = 5;
var NARY_SIGMA = 6;
var NARY_PRODUCT = 7;
var NARY_COPRODUCT = 8;
var NARY_UNION = 9;
var NARY_INTERSECTION = 10;
var NARY_LOGICAL_OR = 11;
var NARY_LOGICAL_AND = 12;
var NARY_UndOvr = 0;
var NARY_SubSup = 1;
var BOX_DIFF = 0;
var BOX_OpEmu = 1;
var BOX_ALIGN = 2;
var BOX_BREAK = 3;
var BOX_NOBREAK = 4;
var LIMIT_LOW = 0;
var LIMIT_UP = 1;
\ No newline at end of file
......@@ -13,15 +13,118 @@
function CNary()
{
CSubMathBase.call(this);
}
extend(CNary, CSubMathBase);
CNary.prototype.init = function(props)
{
this.typeSign = props.sign;
this.limLoc = props.limLoc;
this.supHide = props.supHide;
this.subHide = props.subHide;
if(props.limLoc == "undOvr" || props.limLocType == NARY_UndOvr)
this.limLoc = 0;
else if(props.limLoc === "subSup"|| props.limLocType == NARY_SubSup)
this.limLoc = 1;
else
this.limLoc = 1;
this.supHide = (props.supHide === 1 || props.supHide === true) ? true : false;
this.subHide = (props.subHide === 1 || props.subHide === true) ? true : false;
this.setDimension(1, 2);
var sign = null;
if(props.sign == 0x222B || props.signType == NARY_INTEGRAL)
sign = new CIntegral();
else if(props.sign == 0x222C || props.signType == NARY_DOUBLE_INTEGRAL)
sign = new CDoubleIntegral();
else if(props.sign == 0x222D || props.signType == NARY_TRIPLE_INTEGRAL)
sign = new CTripleIntegral();
else if(props.sign == 0x222E || props.signType == NARY_CONTOUR_INTEGRAL )
sign = new CContourIntegral();
else if(props.sign == 0x222F || props.signType == NARY_SURFACE_INTEGRAL )
sign = new CSurfaceIntegral();
else if(props.sign == 0x2230 || props.signType == NARY_VOLUME_INTEGRAL)
sign = new CVolumeIntegral();
else if(props.sign ==0x2211 || props.signType == NARY_SIGMA)
sign = new CSigma();
else if(props.sign == 0x220F || props.signType == NARY_PRODUCT)
sign = new CProduct();
else if(props.sign ==0x2210 || props.signType == NARY_COPRODUCT)
sign = new CProduct(-1);
else if(props.sign == 0x22C3 || props.signType == NARY_UNION)
sign = new CUnion();
else if(props.sign == 0x22C2 || props.signType == NARY_INTERSECTION)
sign = new CUnion(-1);
else if(props.sign == 0x22C1 || props.signType == NARY_LOGICAL_OR)
sign = new CLogicalOr();
else if(props.sign == 0x22C0 || props.signType == NARY_LOGICAL_AND)
sign = new CLogicalOr(-1);
else
sign = new CIntegral();
var arg = new CMathContent(),
base;
if(this.limLoc === 0)
{
if(this.supHide && this.subHide)
{
base = sign;
}
else if( this.supHide && !this.subHide )
{
base = new CNaryUnd();
base.init(sign);
}
else if( !this.supHide && this.subHide )
{
base = new CNaryOvr();
base.init(sign);
}
else
{
base = new CNaryUndOvr();
base.init(sign);
}
}
else
{
if( this.supHide && !this.subHide )
{
base = new CDegree();
props = {type: SUPERSCRIPT};
base.init_2(props, sign);
}
else if( !this.supHide && this.subHide )
{
base = new CDegree();
props = {type: SUBSCRIPT};
base.init_2(props, sign);
}
else
{
base = new CDegreeSubSup();
props = {type: SubSup};
base.init_2(props, sign);
}
}
this.addMCToContent(base, arg);
}
CNary.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/36*2.45;
}
CNary.prototype.getBase = function()
{
return this.elements[0][1];
}
CNary.prototype.getUpperIterator = function()
{
return this.elements[0][0].getUpperIterator();
}
CNary.prototype.getLowerIterator = function()
{
return this.elements[0][0].getLowerIterator();
}
......
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