Class PoPieChart
- java.lang.Object
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
PoPieChart2D
,PoPieChart3D
public class PoPieChart extends PoGraphMaster
Abstract class for pie chart representation. Abstract class for all pie chart representations. This class handles all pie chart attributes. A pie chart represents the relative size of one datum in relation to a set of data. Each datum is given by a numerical value which is expressed as a percentage of the sum of the values of the entire set of data. This percentage is used to calculate the angle of the slice representing the datum. All slices together make up a pie chart.The slices of which the value is small can be regroup in a same slice. This slice is called the grouping slice.
There are 2 types of pie chart annotations. Internal annotations and external annotations. Futhermore annotations can be framed by a box. All annotations are draw with the Z-Buffer desactivated, that is, they are always visible.
There are 5 groups of fields attributes
- Geometric and data of the pie chart.
- radius
- sliceText
- sliceValue
- sliceColor
- sliceAngleStep
- Attribute of internal annotations : annotations drawn inside each slices.
- intAnnotPosition
- intAnnotAlignment
- intAnnotTextVisibility
- intAnnotValueVisibility
- intAnnotPercentVisibility
- intAnnotAddStringVisibility
- intAnnotTextFontName
- intAnnotTextFontSize
- intAnnotValueFontName
- intAnnotValueFontSize
- intAnnotPercentFontName
- intAnnotPercentFontSize
- intAnnotAddString
- intAnnotDistance
- Attribute of external annotations : annotations drawn outside each slices.
- extAnnotPosition
- extAnnotAlignment
- extAnnotTextVisibility
- extAnnotValueVisibility
- extAnnotPercentVisibility
- extAnnotAddStringVisibility
- extAnnotTextFontName
- extAnnotTextFontSize
- extAnnotValueFontName
- extAnnotValueFontSize
- extAnnotPercentFontName
- extAnnotPercentFontSize
- extAnnotAddString
- extAnnotDistance1
- extAnnotDistance2
- extAnnotDistance3
- Attribute of arrows : an arrow is drawn between slices and each external annotations.
- arrowVisibility
- arrowHeight
- arrowWidth
- Attribute for the translation of slices.
- sliceToTranslateNumber
- sliceToTranslateValue
- Attribute of the grouping slice : The slices of which the value is small can be regroup in a same slice, call grouping slice.
- sliceGroupActive
- sliceGroupMinValue
- sliceGroupFlagMin
- sliceGroupString
)
All pie chart texts depend on the current miscellaneous text attributes which define the font name, line length and so on. If the method setMiscTextAttr(textAttr) is called, the current miscellaneous text attributes is "textAttr". Otherwise the current miscellaneous text attributes are specified in the current inherited state (cf property node
PoMiscTextAttr
).All pie chart numerical values depend on the current numerical display format. If the method setFormat(format) is called, the current numerical display format is "format". Otherwise the current numerical display format is specified in the current inherited state (cf property node
PoNumericDisplayFormat
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PoPieChart.Alignments
Type of annotation alignment.static class
PoPieChart.ExtAnnotPositions
Type of external annotation position.static class
PoPieChart.IntAnnotPositions
Type of internal annotation position.static class
PoPieChart.PercentStatus
Type of threshold for the grouping slice.-
Nested classes/interfaces inherited from class com.openinventor.meshviz.graph.PoBase
PoBase.NodeWriteFormats, PoBase.TextTypes, PoBase.UpdateMethodTypes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFFloat
arrowHeight
Height of the arrow.SoSFBool
arrowVisibility
Visibility of the arrow.SoSFFloat
arrowWidth
Width of the arrow.SoSFString
extAnnotAddString
String concatened with exterior values.SoSFBool
extAnnotAddStringVisibility
Specify the visibility of a string concatenated with the exterior values (if they are visible).SoSFEnum<PoPieChart.Alignments>
extAnnotAlignment
Exterior annotation alignment.SoSFFloat
extAnnotDistance1
Distance from the pie chart center to the end of the arrow.SoSFFloat
extAnnotDistance2
Distance from the end of the arrow to the middle of the arrow.SoSFFloat
extAnnotDistance3
Distance from the middle of the arrow to the start of the arrow.SoSFString
extAnnotPercentFontName
Exterior percentage font name.SoSFFloat
extAnnotPercentFontSize
Font size of exterior percentages.SoSFBool
extAnnotPercentVisibility
Exterior percent visibility (percent are computed from sliceValue field)SoSFEnum<PoPieChart.ExtAnnotPositions>
extAnnotPosition
Exterior annotation position.SoSFString
extAnnotTextFontName
Exterior text (texts of sliceText field) font name.SoSFFloat
extAnnotTextFontSize
Font size of exterior texts (texts of sliceText field).SoSFBool
extAnnotTextVisibility
Exterior text visibility (texts of sliceText field).SoSFString
extAnnotValueFontName
Exterior value (values of sliceValue field) font name.SoSFFloat
extAnnotValueFontSize
Font size of exterior values (values of sliceValue field).SoSFBool
extAnnotValueVisibility
Exterior value visibility (values of sliceValue field).SoSFString
intAnnotAddString
String concatened with interior values.SoSFBool
intAnnotAddStringVisibility
Specify the visibility of a string concatenated with the interior values (if they are visible).SoSFEnum<PoPieChart.Alignments>
intAnnotAlignment
Interior annotation alignment.SoSFFloat
intAnnotDistance
Distance from the pie chart center to the interior annotation box center.SoSFString
intAnnotPercentFontName
Interior percentage font name.SoSFFloat
intAnnotPercentFontSize
Font size of interior percentages.SoSFBool
intAnnotPercentVisibility
Interior percent visibility (percent are computed from sliceValue field)SoSFEnum<PoPieChart.IntAnnotPositions>
intAnnotPosition
Interior annotation position.SoSFString
intAnnotTextFontName
Interior text (texts of sliceText field) font name.SoSFFloat
intAnnotTextFontSize
Font size of interior texts (texts of sliceText field).SoSFBool
intAnnotTextVisibility
Interior text visibility (texts of sliceText field).SoSFString
intAnnotValueFontName
Interior value (values of sliceValue field) font name.SoSFFloat
intAnnotValueFontSize
Font size of interior values (values of sliceValue field).SoSFBool
intAnnotValueVisibility
Interior value visibility (values of sliceValue field).SoSFFloat
radius
Radius of the pie chart.SoSFFloat
sliceAngleStep
Slice are approximated by a polygon, that is a sequence of straight line segments.SoMFColor
sliceColor
Color associated to each slice of the pie chart.SoSFBool
sliceGroupActive
Activate or Deactivate the regrouping of small values.SoSFEnum<PoPieChart.PercentStatus>
sliceGroupFlagMin
Indicate if the value sliceGroupMinValue is interpreted as percentage (PERCENTAGE) or not (ABSOLUTE).SoSFFloat
sliceGroupMinValue
Threshold underneath the slice are regrouped.SoSFString
sliceGroupString
String for the regrouping slice.SoMFString
sliceText
Text associated to each slice of the pie chart.SoMFShort
sliceToTranslateNumber
Numbers (slice numbers begin at 0) of the slices to translate.SoMFFloat
sliceToTranslateValue
Translation values along the bisectors of the slices.SoMFFloat
sliceValue
Value associated to each slice of the pie chart.-
Fields inherited from class com.openinventor.inventor.nodekits.SoBaseKit
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SoNodekitCatalog
getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.PbNumericDisplayFormat
getFormat()
Gets a reference to aPbNumericDisplayFormat
object for the numerical display format of values of the pie chart.PbMiscTextAttr
getMiscTextAttr()
Gets a reference to aPbMiscTextAttr
for miscellaneous text attributes.int
getPickedSliceNumber(SoPath path)
Allow the user to retreive the slice number (sliceNumber argument) which has been picked from a picked path (path argument) (cfSoSelection
node for more information about picking).float
getSliceToTranslate(int sliceNumber)
Gets the current translation of a slice.void
setFormat(PbNumericDisplayFormat format)
Sets a reference to aPbNumericDisplayFormat
object for the numerical display format of values of the pie chart.void
setMiscTextAttr(PbMiscTextAttr textAttr)
Sets a reference to aPbMiscTextAttr
for miscellaneous text attributes.void
setSliceToTranslate(int sliceNumber, float translateValue)
Convenience methods to set the fields sliceToTranslateNumber and sliceToTranslateValue.-
Methods inherited from class com.openinventor.meshviz.graph.PoBase
addPostRebuildCallback, addPreRebuildCallback, getDomain, getNodeWriteFormat, getTextType, getUpdateMethod, isBuilt, isModified, isVRML2Mode, rebuild, setDomain, setNodeWriteFormat, setTextType, setUpdateMethod, setVRML2Mode, touchKit
-
Methods inherited from class com.openinventor.inventor.nodekits.SoBaseKit
getNodekitCatalog, getPart, getPart, getPartString, getViewportIsEnabled, getViewportOrigin, getViewportSize, isSearchingChildren, set, set, setPart, setSearchingChildren
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
radius
public final SoSFFloat radius
Radius of the pie chart.
-
sliceText
public final SoMFString sliceText
Text associated to each slice of the pie chart. Take care that sliceText.getNum() is equal to sliceValue.getNum(), otherwise the number of slices of the pie chart is the minimun of sliceText.getNum() and sliceValue.getNum().
-
sliceValue
public final SoMFFloat sliceValue
Value associated to each slice of the pie chart. Take care that sliceText.getNum() is equal to sliceValue.getNum(), otherwise the number of slices of the pie chart is the minimun of sliceText.getNum() and sliceValue.getNum().
-
sliceColor
public final SoMFColor sliceColor
Color associated to each slice of the pie chart. If sliceColor.getNum() < sliceText.getNum(), then the interpretation of sliceColor is cyclical.
-
intAnnotPosition
public final SoSFEnum<PoPieChart.IntAnnotPositions> intAnnotPosition
Interior annotation position.
-
intAnnotAlignment
public final SoSFEnum<PoPieChart.Alignments> intAnnotAlignment
Interior annotation alignment.
-
intAnnotTextVisibility
public final SoSFBool intAnnotTextVisibility
Interior text visibility (texts of sliceText field).
-
intAnnotValueVisibility
public final SoSFBool intAnnotValueVisibility
Interior value visibility (values of sliceValue field).
-
intAnnotPercentVisibility
public final SoSFBool intAnnotPercentVisibility
Interior percent visibility (percent are computed from sliceValue field)
-
intAnnotAddStringVisibility
public final SoSFBool intAnnotAddStringVisibility
Specify the visibility of a string concatenated with the interior values (if they are visible).
-
intAnnotAddString
public final SoSFString intAnnotAddString
String concatened with interior values.
-
intAnnotTextFontName
public final SoSFString intAnnotTextFontName
Interior text (texts of sliceText field) font name. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
-
intAnnotTextFontSize
public final SoSFFloat intAnnotTextFontSize
Font size of interior texts (texts of sliceText field). If this value is less or equal to 0, the font size is fixed at 0.025. This value is a percentage of the current domain (cfPoBase
description).
-
intAnnotValueFontName
public final SoSFString intAnnotValueFontName
Interior value (values of sliceValue field) font name. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
-
intAnnotValueFontSize
public final SoSFFloat intAnnotValueFontSize
Font size of interior values (values of sliceValue field). If this value is less or equal to 0, the font size is fixed at 0.025. This value is a percentage of the current domain (cfPoBase
description).
-
intAnnotPercentFontName
public final SoSFString intAnnotPercentFontName
Interior percentage font name. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
-
intAnnotPercentFontSize
public final SoSFFloat intAnnotPercentFontSize
Font size of interior percentages. If this value is less or equal to 0, the font size is fixed at 0.025. This value is a percentage of the current domain (cfPoBase
description).
-
intAnnotDistance
public final SoSFFloat intAnnotDistance
Distance from the pie chart center to the interior annotation box center. If this value is less or equal to 0, the distance is fixed to 2/3 of the radius.
-
extAnnotPosition
public final SoSFEnum<PoPieChart.ExtAnnotPositions> extAnnotPosition
Exterior annotation position.
-
extAnnotAlignment
public final SoSFEnum<PoPieChart.Alignments> extAnnotAlignment
Exterior annotation alignment.
-
extAnnotTextVisibility
public final SoSFBool extAnnotTextVisibility
Exterior text visibility (texts of sliceText field).
-
extAnnotValueVisibility
public final SoSFBool extAnnotValueVisibility
Exterior value visibility (values of sliceValue field).
-
extAnnotPercentVisibility
public final SoSFBool extAnnotPercentVisibility
Exterior percent visibility (percent are computed from sliceValue field)
-
extAnnotAddStringVisibility
public final SoSFBool extAnnotAddStringVisibility
Specify the visibility of a string concatenated with the exterior values (if they are visible).
-
extAnnotAddString
public final SoSFString extAnnotAddString
String concatened with exterior values.
-
extAnnotTextFontName
public final SoSFString extAnnotTextFontName
Exterior text (texts of sliceText field) font name. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
-
extAnnotTextFontSize
public final SoSFFloat extAnnotTextFontSize
Font size of exterior texts (texts of sliceText field). If this value is less or equal to 0, the font size is fixed at 0.025. This value is a percentage of the current domain (cfPoBase
description).
-
extAnnotValueFontName
public final SoSFString extAnnotValueFontName
Exterior value (values of sliceValue field) font name. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
-
extAnnotValueFontSize
public final SoSFFloat extAnnotValueFontSize
Font size of exterior values (values of sliceValue field). If this value is less or equal to 0, the font size is fixed at 0.025. This value is a percentage of the current domain (cfPoBase
description).
-
extAnnotPercentFontName
public final SoSFString extAnnotPercentFontName
Exterior percentage font name. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
-
extAnnotPercentFontSize
public final SoSFFloat extAnnotPercentFontSize
Font size of exterior percentages. If this value is less or equal to 0, the font size is fixed at 0.025. This value is a percentage of the current domain (cfPoBase
description).
-
extAnnotDistance1
public final SoSFFloat extAnnotDistance1
Distance from the pie chart center to the end of the arrow. If this value is less or equal to 0, the distance is fixed to 21/20 of the radius.
-
extAnnotDistance2
public final SoSFFloat extAnnotDistance2
Distance from the end of the arrow to the middle of the arrow. If this value is less or equal to 0, the distance is fixed to 1/10 of the radius.
-
extAnnotDistance3
public final SoSFFloat extAnnotDistance3
Distance from the middle of the arrow to the start of the arrow. If this value is less or equal to 0, the distance is fixed to 1/5 of the radius.
-
arrowVisibility
public final SoSFBool arrowVisibility
Visibility of the arrow.
-
arrowHeight
public final SoSFFloat arrowHeight
Height of the arrow.
-
arrowWidth
public final SoSFFloat arrowWidth
Width of the arrow.
-
sliceGroupActive
public final SoSFBool sliceGroupActive
Activate or Deactivate the regrouping of small values.
-
sliceGroupMinValue
public final SoSFFloat sliceGroupMinValue
Threshold underneath the slice are regrouped.
-
sliceGroupFlagMin
public final SoSFEnum<PoPieChart.PercentStatus> sliceGroupFlagMin
Indicate if the value sliceGroupMinValue is interpreted as percentage (PERCENTAGE) or not (ABSOLUTE). .
-
sliceGroupString
public final SoSFString sliceGroupString
String for the regrouping slice.
-
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. If sliceToTranslateNumber[i] is less than zero, it corresponds to the slice of regrouping small values.
-
sliceToTranslateValue
public final SoMFFloat sliceToTranslateValue
Translation values along the bisectors of the slices. sliceToTranslateValue[i] is the translate value along the bisector of the i-th slice.
-
sliceAngleStep
public final SoSFFloat sliceAngleStep
Slice are approximated by a polygon, that is a sequence of straight line segments. sliceAngleStep is the angle formed by two consecutive points of the polygon relative to the center of the slice.
-
-
Method Detail
-
getClassNodekitCatalog
public static SoNodekitCatalog getClassNodekitCatalog()
Returns theSoNodekitCatalog
for this class.
-
getMiscTextAttr
public PbMiscTextAttr getMiscTextAttr()
Gets a reference to aPbMiscTextAttr
for miscellaneous text attributes.
-
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) (cfSoSelection
node for more information about picking).- Returns:
- false, if the picked path does not correspond to a slice of the pie chart (sliceNumber is not significative),
-
setSliceToTranslate
public void setSliceToTranslate(int sliceNumber, float translateValue)
Convenience methods to set the fields sliceToTranslateNumber and sliceToTranslateValue. As regardssetSliceToTranslate()
method, if sliceNumber == sliceToTranslateNumber[i] (i=0 to sliceToTranslateNumber.getNum() - 1), sliceToTranslateNumber[i] = translationValue, else sliceToTranslateNumber[sliceToTranslateNumber.getNum()] = translationValue.
-
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 value otherwise.
-
setMiscTextAttr
public void setMiscTextAttr(PbMiscTextAttr textAttr)
Sets a reference to aPbMiscTextAttr
for miscellaneous text attributes. If this method is not called (or called passing NULL as argument), this is the miscellaneous text attributes defined in the current inherited state (defined with the property nodePoMiscTextAttr
) which are used.
-
setFormat
public void setFormat(PbNumericDisplayFormat format)
Sets a reference to aPbNumericDisplayFormat
object for the numerical display format of values of the pie chart. If this method is not called (or called passing NULL as argument), this is the numerical display format defined in the current inherited state (defined with the property nodePoNumericDisplayFormat
) which is used.
-
getFormat
public PbNumericDisplayFormat getFormat()
Gets a reference to aPbNumericDisplayFormat
object for the numerical display format of values of the pie chart.
-
-