-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- distColors = vtkUnsignedCharArray::New();
- distColors->SetNumberOfComponents(3);
- distColors->SetNumberOfTuples(numPositiveVal);
- this->myDistribution->GetCellData()->SetScalars(distColors);
- distColors->Delete();
+ distColors = vtkUnsignedCharArray::New();
+ distColors->SetNumberOfComponents(3);
+ distColors->SetNumberOfTuples(numPositiveVal);
+ this->myDistribution->GetCellData()->SetScalars(distColors);
+ distColors->Delete();
- delimeter=0.01*size[0]; //1 % from horizontal size of the full presentation size.
- barWidth = size[0] - 4 - labelSize[0];
- distrHeight = barWidth/2;
+ delimeter=0.01*size[0]; //1 % from horizontal size of the full presentation size.
+ barWidth = size[0] - 4 - labelSize[0];
+ distrHeight = barWidth/2;
- // Distribution points
- shrink = delta*SHRINK_COEF;
- vtkIdType distPtsId=0;
- vtkIdType distPtsIds[4];
- for(i=0; i<numColors; i++) {
- if(myNbValues[i]) {
- itemH = distrHeight*((double)myNbValues[i]/maxValue);
-
- if(distrHeight == itemH)
- itemH = itemH - delimeter/2;
-
- x[1] = i*delta+shrink;
-
- // first point of polygon (quadrangle)
- x[0] = 0;
- distPtsIds[0] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- // second point of polygon (quadrangle)
- x[0] = itemH;
- distPtsIds[1] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- x[1] = i*delta+delta-shrink;
-
- // third point of polygon (quadrangle)
- x[0] = 0;
- distPtsIds[3] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- // fourth point of polygon (quadrangle)
- x[0] = itemH;
- distPtsIds[2] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- //Inser Quadrangle
- distrPolys->InsertNextCell(4,distPtsIds);
- }
- }
+ // Distribution points
+ shrink = delta*SHRINK_COEF;
+ vtkIdType distPtsId=0;
+ vtkIdType distPtsIds[4];
+ for(i=0; i<numColors; i++) {
+ if(myNbValues[i]) {
+ itemH = distrHeight*((double)myNbValues[i]/maxValue);
+
+ if(distrHeight == itemH)
+ itemH = itemH - delimeter/2;
+
+ x[1] = i*delta+shrink;
+
+ // first point of polygon (quadrangle)
+ x[0] = 0;
+ distPtsIds[0] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ // second point of polygon (quadrangle)
+ x[0] = itemH;
+ distPtsIds[1] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ x[1] = i*delta+delta-shrink;
+
+ // third point of polygon (quadrangle)
+ x[0] = 0;
+ distPtsIds[3] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ // fourth point of polygon (quadrangle)
+ x[0] = itemH;
+ distPtsIds[2] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ //Inser Quadrangle
+ distrPolys->InsertNextCell(4,distPtsIds);
+ }
+ }
// Customization of the vtkScalarBarActor to show distribution histogram.
double coef1, delimeter=0.0;
if(GetDistributionVisibility() && distrVisibility) {
// Customization of the vtkScalarBarActor to show distribution histogram.
double coef1, delimeter=0.0;
if(GetDistributionVisibility() && distrVisibility) {
- coef1=0.62;
- distrHeight = (int)((coef1/2)*size[1]);
- //delimeter between distribution diagram and scalar bar
- delimeter=0.02*size[1];
+ coef1=0.62;
+ distrHeight = (int)((coef1/2)*size[1]);
+ //delimeter between distribution diagram and scalar bar
+ delimeter=0.02*size[1];
- // Distribution points
- shrink = delta*SHRINK_COEF;
- vtkIdType distPtsId=0;
- vtkIdType distPtsIds[4];
- for(i=0; i<numColors; i++) {
- if(myNbValues[i]) {
- itemH = distrHeight*((double)myNbValues[i]/maxValue);
-
- // first point of polygon (quadrangle)
- x[0] = i*delta+shrink;
- x[1] = 0;
- distPtsIds[0] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- // second point of polygon (quadrangle)
- x[0] = i*delta+shrink;
- x[1] = itemH;
- distPtsIds[3] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- // third point of polygon (quadrangle)
- x[0] = i*delta+delta-shrink;
- x[1] = 0;
- distPtsIds[1] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- // fourth point of polygon (quadrangle)
- x[0] = i*delta+delta-shrink;
- x[1] = itemH;
- distPtsIds[2] = distPtsId;
- distrPts->SetPoint(distPtsId++,x);
-
- // Add polygon into poly data
- distrPolys->InsertNextCell(4,distPtsIds);
- }
- }
+ // Distribution points
+ shrink = delta*SHRINK_COEF;
+ vtkIdType distPtsId=0;
+ vtkIdType distPtsIds[4];
+ for(i=0; i<numColors; i++) {
+ if(myNbValues[i]) {
+ itemH = distrHeight*((double)myNbValues[i]/maxValue);
+
+ // first point of polygon (quadrangle)
+ x[0] = i*delta+shrink;
+ x[1] = 0;
+ distPtsIds[0] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ // second point of polygon (quadrangle)
+ x[0] = i*delta+shrink;
+ x[1] = itemH;
+ distPtsIds[3] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ // third point of polygon (quadrangle)
+ x[0] = i*delta+delta-shrink;
+ x[1] = 0;
+ distPtsIds[1] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ // fourth point of polygon (quadrangle)
+ x[0] = i*delta+delta-shrink;
+ x[1] = itemH;
+ distPtsIds[2] = distPtsId;
+ distrPts->SetPoint(distPtsId++,x);
+
+ // Add polygon into poly data
+ distrPolys->InsertNextCell(4,distPtsIds);
+ }
+ }