Commit 6bd183b3 authored by Sergey Luzyanin's avatar Sergey Luzyanin

PathMemory insteat Path

parent 29f2d598
......@@ -226,12 +226,7 @@ CChartSpace.prototype.getParentObjects = function()
return parents;
};
CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransform;
CChartSpace.prototype.recalculateChart = function()
{
if(this.chartObj == null)
this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this);
};
CChartSpace.prototype.canResize = CShape.prototype.canResize;
CChartSpace.prototype.canMove = CShape.prototype.canMove;
CChartSpace.prototype.canRotate = function()
......
This diff is collapsed.
......@@ -31,7 +31,7 @@
*/
"use strict";
var GLOBAL_PATH_COUNT = 0;
(
/**
* @param {Window} window
......@@ -516,6 +516,37 @@ function checkPointInMap(map, worksheet, row, col)
}
function CPathMemory(){
this.size = 1000;
this.ArrPathCommand = new Float64Array(this.size);
this.curPos = -1;
this.path = new AscFormat.Path2(this);
}
CPathMemory.prototype.AllocPath = function(){
if(this.curPos + 1 >= this.ArrPathCommand.length){
var aNewArray = new Float64Array((((3/2)*(this.curPos + 1)) >> 0) + 1);
for(var i = 0; i < this.ArrPathCommand.length; ++i){
aNewArray[i] = this.ArrPathCommand[i];
}
this.ArrPathCommand = aNewArray;
this.path.ArrPathCommand = aNewArray;
}
this.path.startPos = ++this.curPos;
this.path.curLen = 0;
this.ArrPathCommand[this.curPos] = 0;
return this.path;
};
CPathMemory.prototype.GetPath = function(index){
this.path.startPos = index;
this.path.curLen = 0;
return this.path;
};
function CChartSpace()
{
CChartSpace.superclass.constructor.call(this);
......@@ -539,6 +570,7 @@ function CChartSpace()
this.calculatedChart = null;
this.pathMemory = new CPathMemory();
this.bbox = null;
......@@ -567,7 +599,16 @@ function CChartSpace()
}
AscCommon.extendClass(CChartSpace, AscFormat.CGraphicObjectBase);
CChartSpace.prototype.select = CShape.prototype.select;
CChartSpace.prototype.AllocPath = function(){
return this.pathMemory.AllocPath().startPos;
};
CChartSpace.prototype.GetPath = function(index){
return this.pathMemory.GetPath(index);
}
CChartSpace.prototype.select = CShape.prototype.select;
CChartSpace.prototype.checkDrawingBaseCoords = CShape.prototype.checkDrawingBaseCoords;
CChartSpace.prototype.setDrawingBaseCoords = CShape.prototype.setDrawingBaseCoords;
CChartSpace.prototype.deleteBFromSerialize = CShape.prototype.deleteBFromSerialize;
......@@ -10380,6 +10421,7 @@ CChartSpace.prototype.addToSetPosition = function(dLbl)
CChartSpace.prototype.recalculateChart = function()
{
this.pathMemory.curPos = -1;
if(this.chartObj == null)
this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this);
......
This diff is collapsed.
......@@ -633,7 +633,7 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
var pxToMM = this.chartSpace.chartObj.calcProp.pxToMM;
var oChSz = this.chartSizes;
this.centerPoint = this.processor3D.convertAndTurnPoint((oChSz.startX + oChSz.w/2)*pxToMM, (oChSz.startY + oChSz.h/2)*pxToMM, this.depthPerspective/2);
//this.centerPoint = this.processor3D.convertAndTurnPoint((oChSz.startX + oChSz.w/2)*pxToMM, (oChSz.startY + oChSz.h/2)*pxToMM, this.depthPerspective/2);
}, this, []);
......@@ -646,13 +646,13 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
var dOldAlpha = null;
var oGraphics = overlay.Graphics ? overlay.Graphics : overlay;
if(AscFormat.isRealNumber(oGraphics.globalAlpha) && oGraphics.put_GlobalAlpha){
dOldAlpha = oGraphics.globalAlpha;
oGraphics.put_GlobalAlpha(false, 1);
}
this.objectToDraw.draw(overlay, transform);
this.objectToDraw2.draw(overlay, transform);
if(AscFormat.isRealNumber(dOldAlpha) && oGraphics.put_GlobalAlpha){
oGraphics.put_GlobalAlpha(true, dOldAlpha);
var graphics = oGraphics;
graphics.SaveGrState();
graphics.SetIntegerGrid(false);
graphics.transform3(oChartSpace.transform, false);
oChartSpace.chartObj.draw(oChartSpace, graphics);
graphics.RestoreGrState();
}
};
......@@ -712,7 +712,7 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
this.getBounds = function()
{
var boundsChecker = new AscFormat.CSlideBoundsChecker();
this.draw(boundsChecker);
//this.draw(boundsChecker);
var tr = this.transform;
var arr_p_x = [];
var arr_p_y = [];
......@@ -775,6 +775,14 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
this.view3D.rotX = 90;
}
var OldView = oChartSpace.chart.view3D;
oChartSpace.chart.view3D = this.view3D;
oChartSpace.recalcInfo.recalculateChart = true;
oChartSpace.recalculate();
oChartSpace.chart.view3D = OldView;
return;
this.processor3D.angleOx = this.view3D && this.view3D.rotX ? (- this.view3D.rotX / 360) * (Math.PI * 2) : 0;
this.processor3D.angleOy = this.view3D && this.view3D.rotY ? (- this.view3D.rotY / 360) * (Math.PI * 2) : 0;
this.processor3D.angleOz = 0;
......@@ -783,7 +791,7 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
// this.processor3D.calaculate3DProperties();
//this.processor3D.view3D = oChartSpace.chart.view3D;
this.calculateGeometry();
//this.calculateGeometry();
};
this.trackEnd = function()
......
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