Class PoPieChartRep

All Implemented Interfaces:
SafeDisposable

public class PoPieChartRep extends PoChart
Class to build a 3D pie chart. Builds a 3D pie chart on 1D mesh (PoIrregularMesh1D or PoRegularMesh1D). The size (angle) of each slice is given by the geometry of the current mesh 1D, and the height of each slice is given by one of the value-set of the current mesh 1D specified by the field yValuesIndex. Names attached to each slice are given by one of the string-set of the current mesh 1D specified by the field stringsIndex. With this mecanism all slices have not necessary the same height. On contrary, if all slices must have the same height, set the field yValuesIndex to -1 and set the field height to the desired height. The pie chart origin is at (0,0,0) after applying the current transformation.

The current label hints (PoLabelHints) is used to specify the appearance of annotations for each slice. All annotations depend on the current miscellaneous text attributes which defines the font names, line length and so on (PoMiscTextAttr). All numerical values depend on the current numerical display format (PoNumericDisplayFormat). Each slice can be beveled thanks to the current beveled edge values (PoBevelEdge). The current complexity (SoComplexity) is used to determine the tessellation of slices.

The interpretation of colorBinding is the following :

  • INHERITED: All slices are colored with the same inherited color.
  • PER_PART, PER_VERTEX: A color is used for each slice.

File format/default:

PoPieChartRep {

    colorBinding INHERITED
    yValuesIndex -1
    colorValuesIndex 1
    material NULL
    stringsIndex 0
    radiusMin 0.0
    radiusMax 1.0
    sliceToTranslateNumber 0
    sliceToTranslateRadius 0.0
    height 0.3
    isNameVisible false
    isValueVisible false
    isPercentageVisible true
    annoDistToCenter 0.5
    annoHeightFromSlice 0.2
    isAnnoSliceColor true
    annoFontSize 0.1
}

<html> <head> <link REL="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> <title></title> </head> <body> <h4><a name="Heading249">CATALOG PARTS</a></h4> <blockquote> <p><b>PoPieChartRep</b> {</p> </blockquote> <blockquote> <blockquote> <p><b>Separator</b> <tt>alternateRep</tt> (from PoBase) {</p> </blockquote> <blockquote> <blockquote> <p><b>AppearanceKit</b> <tt>appearance</tt> (from PoBase)</p> </blockquote> </blockquote> <blockquote> <blockquote> <p><i>Specifies the appearance of all the kit. By default lightModel.model=PHONG.</i></p> </blockquote> </blockquote> <blockquote> <blockquote> <p><b>MatrixTransform</b> <tt>domainTransform</tt> (from PoBase)</p> </blockquote> </blockquote> <blockquote> <blockquote> <p><i>Corresponds to the domain transformation.</i></p> <b><p>Separator</b> <tt>sliceSep</tt> {</p> <i><p>Contains properties and shapes to draw the slices.</i> <ul> <b><p>AppearanceKit</b> <tt>sliceApp</tt></p> </ul> <ul> <i><p>Specifies the appearance of the slices.</i></p> </ul> <ul> <b><p>Group</b> <tt>slice</tt></p> </ul> <ul> <i><p>Contains a list of couple SoMaterial and SoIndexedFaceSet shapes to draw the slices.</i></p> </ul> <p>}</p> <b><p>Separator</b> <tt>annotationSep</tt> {</p> <i><p>Contains properties and shapes to draw the annotations.</i> <ul> <b><p>AppearanceKit</b> <tt>annotationApp</tt></p> </ul> <ul> <i><p>Specifies the appearance of the annotations.&nbsp; font.size and font.name are set when the kit is rebuilt. </i></p> </ul> <ul> <b><p>Group</b> <tt>annotation</tt></p> </ul> <blockquote> <i><p>Contains a list of couple SoMaterial and SoText3/SoAnnoText3/SoAsciiText (cf PoBase.setTextType() and PoBase.setVRML2Mode() for choosing the text type) if the field colorBinding is different from INHERITED and the field isAnnoSliceColor is set to true, a list of SoText3/SoAnnoText3/SoAsciiText otherwise.</i></p> </blockquote> <p>}</p> <b><p>Separator</b> <tt>annotationLineSep</tt> {</p> <i><p>Contains properties and shapes to draw lines from the annotations to the slices.</i> <ul> <b><p>AppearanceKit</b> <tt>annotationLineApp</tt></p> </ul> <ul> <i><p>Specifies the appearance of the lines.</i></p> </ul> <ul> <b><p>Group</b> <tt>annotationLine</tt></p> </ul> <ul> <i><p>Contains a list of couple SoMaterial and SoLineSet shape to draw the label lines if the field colorBinding is different from INHERITED and the field isAnnoSliceColor is set to true, a list of SoLineSet otherwise.</i></p> </ul> <p>}</p> </blockquote> <p>}</p> </blockquote> </blockquote> <blockquote> <p>}</p> </blockquote> </body> </html>

  • Field Details

    • stringsIndex

      public final SoSFInt32 stringsIndex
      Defines the index of the set of strings used for the names attached to slices. If the field value is negative, no names is attached to slices.
    • radiusMin

      public final SoSFFloat radiusMin
      Defines the mininum radius of the pie chart. If this value is equal to zero, then we obtain sectors otherwise we obtain rings.
    • radiusMax

      public final SoSFFloat radiusMax
      Defines the maximum radius of the pie chart.
    • sliceToTranslateNumber

      public final SoMFShort sliceToTranslateNumber
      Numbers (slice numbers begin at 0) of the slices to translate. sliceToTranslateNumber[i] is the number of the i-th slice to translate.
    • sliceToTranslateRadius

      public final SoMFFloat sliceToTranslateRadius
      Translation values along the bisectors of the slices. sliceToTranslateRadius[i] is the translate value along the bisector of the i-th slice.
    • height

      public final SoSFFloat height
      Defines the height of the pie chart if the field yValuesIndex is different from -1.
    • isNameVisible

      public final SoSFBool isNameVisible
      Defines if the name of each slice is visible. Slice names are given by the set of strings defined by the field stringsIndex.
    • isValueVisible

      public final SoSFBool isValueVisible
      Defines if the value of each slice is visible.
    • isPercentageVisible

      public final SoSFBool isPercentageVisible
      Defines if the percentage of each slice is visible.
    • annoDistToCenter

      public final SoSFFloat annoDistToCenter
      Defines the distance from the pie chart center of the displayed annotations (name/value/percentage).
    • annoHeightFromSlice

      public final SoSFFloat annoHeightFromSlice
      Defines the height of the displayed annotations (name/value/percentage) from the top of each slice.
    • annoFontSize

      public final SoSFFloat annoFontSize
      Define the font size of the annotation.
    • isAnnoSliceColor

      public final SoSFBool isAnnoSliceColor
      Determines if the color of for annotation is the same as slices.
  • Constructor Details

    • PoPieChartRep

      public PoPieChartRep()
      Constructor.
  • Method Details

    • setSliceToTranslate

      public void setSliceToTranslate(int sliceNumber, float radius)
      Convenience methods to set the fields sliceToTranslateNumber and sliceToTranslateRadius. This is equivalent to the following pseudo code:
       for (i=0; i < min(sliceToTranslateNumber.getNum(),sliceToTranslateRadius.getNum()); i++)
         if (sliceNumber == sliceToTranslateNumber[i]) break;
       sliceToTranslateRadius[i] = radius;
       sliceToTranslateNumber[i] = sliceNumber;
    • getSliceToTranslate

      public float getSliceToTranslate(int sliceNumber)
      Gets the current translation of a slice. Returns 0 if sliceNumber slice does not exist or sliceNumber slice is not translated, the translation radius otherwise.
    • getPickedSliceNumber

      public int getPickedSliceNumber(SoPath path)
      Allow the user to retreive the slice number (sliceNumber argument) which has been picked from a picked path (path argument) (cf SoSelection node for more information about picking). Return false, if the picked path does not correspond to a slice of the pie chart (sliceNumber is not significative), true otherwise.
    • getClassNodekitCatalog

      public static SoNodekitCatalog getClassNodekitCatalog()
      Returns the SoNodekitCatalog for this class.