Commit e5f0f890 authored by GoshaZotov's avatar GoshaZotov

for stacked hbar charts

parent a3bfbde4
...@@ -113,7 +113,7 @@ Processor3D.prototype.calaculate3DProperties = function(baseDepth, gapDepth, bIs ...@@ -113,7 +113,7 @@ Processor3D.prototype.calaculate3DProperties = function(baseDepth, gapDepth, bIs
{ {
this._calculateCameraDiff(); this._calculateCameraDiff();
if(this.view3D.rAngAx || (!this.view3D.rAngAx && this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.HBar && null !== this.view3D.hPercent)) if(this.view3D.rAngAx)
{ {
this._recalculateScaleWithMaxWidth(); this._recalculateScaleWithMaxWidth();
} }
...@@ -134,7 +134,7 @@ Processor3D.prototype._calculateAutoHPercent = function() ...@@ -134,7 +134,7 @@ Processor3D.prototype._calculateAutoHPercent = function()
if(this.hPercent == null) if(this.hPercent == null)
{ {
this.hPercent = this.view3D.hPercent === null ? (heightLine / widthLine) : this.view3D.hPercent / 100; this.hPercent = this.view3D.hPercent === null ? (heightLine / widthLine) : this.view3D.hPercent / 100;
if(this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.HBar && this.view3D.hPercent === null && this.view3D.rAngAx) if(this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.HBar && ((this.view3D.hPercent === null && this.view3D.rAngAx) || (this.view3D.hPercent !== null && !this.view3D.rAngAx)))
this.hPercent = 1 / this.hPercent; this.hPercent = 1 / this.hPercent;
} }
}; };
......
...@@ -11943,14 +11943,54 @@ CSortFaces.prototype = ...@@ -11943,14 +11943,54 @@ CSortFaces.prototype =
var intersectionsParallelepipeds = this._getIntersectionsParallelepipeds(parallelepipeds); var intersectionsParallelepipeds = this._getIntersectionsParallelepipeds(parallelepipeds);
var intersections = intersectionsParallelepipeds.intersections; var intersections = intersectionsParallelepipeds.intersections;
var revIntersections = intersectionsParallelepipeds.reverseIntersections; var revIntersections = intersectionsParallelepipeds.reverseIntersections;
var countIntersection = intersectionsParallelepipeds.countIntersection;
var startIndexs = []; var startIndexes = [];
var test = []; for(var i = 0; i < countIntersection.length; i++)
for(var i = 0; i < parallelepipeds.length; i++) {
if(countIntersection[i] === 0)
{
startIndexes.push({index: parseInt(i)});
}
}
if(startIndexes.length === 0)
{ {
if(intersections[i] === undefined) var maxIndexes = 1;
var mapIndexes = {};
for(var i = 0; i < countIntersection.length; i++)
{
if(countIntersection[i] === maxIndexes)
{
startIndexes.push({index: parseInt(i)});
mapIndexes[parseInt(i)] = 1;
}
}
//для stacked заглушка. пересмотреть!!!
var arr = [];
for(var i = 0; i < startIndexes.length; i++)
{
var index = startIndexes[i].index;
var temp = false;
for(var j in revIntersections[index])
{
if(mapIndexes[j])
{
temp = true;
break;
}
}
if(temp)
{
arr.push({index: parseInt(index)});
}
}
if(arr.length)
{ {
startIndexs.push({index: parseInt(i)}); startIndexes = arr;
} }
} }
...@@ -11990,10 +12030,9 @@ CSortFaces.prototype = ...@@ -11990,10 +12030,9 @@ CSortFaces.prototype =
return res; return res;
}; };
for(var i = 0; i < startIndexes.length; i++)
for(var i = 0; i < startIndexs.length; i++)
{ {
dfs(startIndexs[i].index); dfs(startIndexes[i].index);
} }
var addIndexes = {}; var addIndexes = {};
...@@ -12022,11 +12061,13 @@ CSortFaces.prototype = ...@@ -12022,11 +12061,13 @@ CSortFaces.prototype =
var intersections = []; var intersections = [];
var reverseIntersections = []; var reverseIntersections = [];
var countIntersection = [];
console.time("_getIntersectionsParallelepipeds"); console.time("_getIntersectionsParallelepipeds");
for(var i = 0; i < parallelepipeds.length; i++) for(var i = 0; i < parallelepipeds.length; i++)
{ {
//из каждой точки данного параллалепипеда строим прямые до точки наблюдателя //из каждой точки данного параллалепипеда строим прямые до точки наблюдателя
var fromParallalepiped = parallelepipeds[i]; var fromParallalepiped = parallelepipeds[i];
countIntersection[i] = 0;
for(var m = 0; m < parallelepipeds.length; m++) for(var m = 0; m < parallelepipeds.length; m++)
{ {
...@@ -12065,6 +12106,8 @@ CSortFaces.prototype = ...@@ -12065,6 +12106,8 @@ CSortFaces.prototype =
reverseIntersections[m] = []; reverseIntersections[m] = [];
} }
countIntersection[i]++;
intersections[i][m] = 1; intersections[i][m] = 1;
reverseIntersections[m][i] = 1; reverseIntersections[m][i] = 1;
...@@ -12079,7 +12122,7 @@ CSortFaces.prototype = ...@@ -12079,7 +12122,7 @@ CSortFaces.prototype =
} }
console.timeEnd("_getIntersectionsParallelepipeds"); console.timeEnd("_getIntersectionsParallelepipeds");
return {intersections: intersections, reverseIntersections: reverseIntersections}; return {intersections: intersections, reverseIntersections: reverseIntersections, countIntersection: countIntersection};
}, },
sortFaces: function(faces) sortFaces: function(faces)
......
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