Class to build a 3D pie chart. More...
#include <MeshViz/graph/PoPieChartRep.h>
Classes | |
struct | SliceAttr |
Public Member Functions | |
virtual SoType | getTypeId () const |
virtual const SoNodekitCatalog * | getNodekitCatalog () const |
PoPieChartRep () | |
SbBool | getPickedSliceNumber (const SoPath *path, int &sliceNumber) const |
void | setSliceToTranslate (int sliceNumber, float radius) |
float | getSliceToTranslate (int sliceNumber) const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static const SoNodekitCatalog * | getClassNodekitCatalog () |
Public Attributes | |
SoSFInt32 | stringsIndex |
SoSFFloat | radiusMin |
SoSFFloat | radiusMax |
SoMFShort | sliceToTranslateNumber |
SoMFFloat | sliceToTranslateRadius |
SoSFFloat | height |
SoSFBool | isNameVisible |
SoSFBool | isValueVisible |
SoSFBool | isPercentageVisible |
SoSFFloat | annoDistToCenter |
SoSFFloat | annoHeightFromSlice |
SoSFFloat | annoFontSize |
SoSFBool | isAnnoSliceColor |
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 :
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 |
PoPieChartRep {
Separator alternateRep (from PoBase) {
AppearanceKit appearance (from PoBase)
Specifies the appearance of all the kit. By default lightModel.model=PHONG.
MatrixTransform domainTransform (from PoBase)
Corresponds to the domain transformation.
Separator sliceSep {
Contains properties and shapes to draw the slices.
AppearanceKit sliceApp
Specifies the appearance of the slices.
Group slice
Contains a list of couple SoMaterial and SoIndexedFaceSet shapes to draw the slices.
}
Separator annotationSep {
Contains properties and shapes to draw the annotations.
AppearanceKit annotationApp
Specifies the appearance of the annotations. font.size and font.name are set when the kit is rebuilt.
Group annotation
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.
}
Separator annotationLineSep {
Contains properties and shapes to draw lines from the annotations to the slices.
AppearanceKit annotationLineApp
Specifies the appearance of the lines.
Group annotationLine
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.
}
}
}
PoPieChartRep::PoPieChartRep | ( | ) |
Constructor.
static const SoNodekitCatalog* PoPieChartRep::getClassNodekitCatalog | ( | ) | [static] |
Returns the SoNodekitCatalog for this class.
Reimplemented from PoChart.
static SoType PoPieChartRep::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from PoChart.
virtual const SoNodekitCatalog* PoPieChartRep::getNodekitCatalog | ( | ) | const [virtual] |
Returns the SoNodekitCatalog for this instance.
Reimplemented from PoChart.
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.
float PoPieChartRep::getSliceToTranslate | ( | int | sliceNumber | ) | const |
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.
virtual SoType PoPieChartRep::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from PoChart.
void PoPieChartRep::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;
Defines the distance from the pie chart center of the displayed annotations (name/value/percentage).
Define the font size of the annotation.
Defines the height of the displayed annotations (name/value/percentage) from the top of each slice.
Defines the height of the pie chart if the field yValuesIndex is different from -1.
Determines if the color of for annotation is the same as slices.
Defines if the name of each slice is visible.
Slice names are given by the set of strings defined by the field stringsIndex.
Defines if the percentage of each slice is visible.
Defines if the value of each slice is visible.
Defines the maximum radius of the pie chart.
Defines the mininum radius of the pie chart.
If this value is equal to zero, then we obtain sectors otherwise we obtain rings.
Numbers (slice numbers begin at 0) of the slices to translate.
sliceToTranslateNumber[i] is the number of the i-th slice to translate.
Translation values along the bisectors of the slices.
sliceToTranslateRadius[i] is the translate value along the bisector of the i-th slice.
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.