Class to build contour lines on a 2D mesh. More...
#include <MeshViz/3Ddata/PoMeshContouring.h>
Classes | |
struct | Parallelogram3 |
struct | StoreAnnotSpace |
Public Types | |
enum | AnnotPath { TANGENTIAL_PATH, HORIZONTAL_PATH, VERTICAL_PATH } |
enum | AnnotCrossStatus { CROSS_CONTOUR, CROSS_MINOR_CONTOUR, DONT_CROSS_CONTOUR } |
Public Member Functions | |
virtual SoType | getTypeId () const |
virtual const SoNodekitCatalog * | getNodekitCatalog () const |
PoMeshContouring () | |
virtual void | rebuild () |
void | setFormat (PbNumericDisplayFormat *format) |
const PbNumericDisplayFormat * | getFormat () const |
void | setMiscTextAttr (PbMiscTextAttr *textAttr) |
const PbMiscTextAttr * | getMiscTextAttr () const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static const SoNodekitCatalog * | getClassNodekitCatalog () |
Public Attributes | |
SoSFUShort | majorPeriod |
SoSFUShort | firstMajor |
SoSFBool | annotIsVisible |
SoSFEnum | annotPath |
SoSFEnum | annotCrossStatus |
SoSFBool | annotIsBackground |
SoSFBool | annotIsContourClip |
SoSFFloat | annotGap |
SoMFVec2f | annotClippingPolygon |
SoSFFloat | annotFontSize |
SoSFFloat | annotFontFactor |
Builds contour lines on a 2D mesh. These contour lines are computed from a level values list and the nodes scalar values of the mesh. The level value list is defined by the PoMesh::setIsovaluesList() method or by the current PoIsovaluesList node during the traversal.
All contour lines can have the same color (PoMesh::coloringType = COLOR_INHERITED) or can have a color depending on the values of the contouring lines (PoMesh::coloringType != COLOR_INHERITED).
Contour lines are separated into 2 groups: major contour lines which can be annotated by their value, and minor contour lines which cannot be annotated. Major contour line are defined by the value of fields majorPeriod and firstMajor. They are annotated only if the field annotIsVisible is TRUE. The way of putting annotations along contour lines is defined by the value of the fields annotPath, annotCrossStatus, annotGap and annotClippingPolygon.
When the annotation are visible, the way of drawing the text of the level values depends on the current numeric display format and also on the current miscellaneous text attributes. 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). If the method setMiscTextAttr(textAttr) is called, the current miscellaneous text attributes are defined by "textAttr". Otherwise the current miscellaneous text attributes are specified in the current inherited state (cf property node PoMiscTextAttr).
Note: Contour line annotations are not displayed if the mesh is not defined in the XY plane. For example, if a 2D mesh is defined as follows: X coordinates are constant, Y coordinates vary, and Z coordinates vary, (and zValuesIndex set with a value different from -1), the contour lines will be not annotated. In order to annotate contour lines for a mesh not defined in the XY plane, define it in the XY plane and apply a rotation.
valuesIndex | -1 |
coloringType | COLOR_INHERITED |
zValuesIndex | -1 |
vecsIndex | -1 |
valuesIndexForCellFilter | -1 |
moduleDataMapping | NULL |
majorPeriod | 3 |
firstMajor | 1 |
annotIsVisible | FALSE |
annotPath | TANGENTIAL_PATH |
annotCrossStatus | CROSS_CONTOUR |
annotIsBackground | FALSE |
annotIsContourClip | FALSE |
annotGap | 1 |
annotClippingPolygon | 0 0 |
annotFontSize | 0 |
PoMeshContouring::PoMeshContouring | ( | ) |
Constructor.
static const SoNodekitCatalog* PoMeshContouring::getClassNodekitCatalog | ( | ) | [static] |
Returns the SoNodekitCatalog for this class.
Reimplemented from PoMesh2D.
static SoType PoMeshContouring::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from PoMesh2D.
const PbNumericDisplayFormat* PoMeshContouring::getFormat | ( | ) | const |
Gets the reference to a PbNumericDisplayFormat.
See setFormat.
const PbMiscTextAttr* PoMeshContouring::getMiscTextAttr | ( | ) | const |
Gets a reference to PbMiscTextAttr object.
See setMiscTextAttr.
virtual const SoNodekitCatalog* PoMeshContouring::getNodekitCatalog | ( | ) | const [virtual] |
Returns the SoNodekitCatalog for this instance.
Reimplemented from PoMesh2D.
virtual SoType PoMeshContouring::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from PoMesh2D.
virtual void PoMeshContouring::rebuild | ( | ) | [virtual] |
void PoMeshContouring::setFormat | ( | PbNumericDisplayFormat * | format | ) |
Sets a reference to a PbNumericDisplayFormat object for the numerical display format for annotations of contour lines.
If this method is not called the format used is the one of the default constructor of PbNumericDisplayFormat.
void PoMeshContouring::setMiscTextAttr | ( | PbMiscTextAttr * | textAttr | ) |
Sets a reference to PbMiscTextAttr object for miscellaneous text attributes of annotations of contour lines.
If this method is not called the text attributes used are those of the default constructor of PbMiscTextAttr.
This is a polygon where no annotations are present outside it.
If the point list is empty, the mesh limits will be used instead. By default, annotClippingPolygon = (0,0)
Controls the annotations and contour lines crossing.
By default, annotCrossStatus = CROSS_CONTOUR.
Note that annotations may always cross the annotated contour line, however this field prevents annotations from crossing other contour lines.
Font size factor of annotations of contour lines.
This field is only interpreted when an SoProjection node is applicable to contouring. By default, annotFontFactor = 1.
Font size of annotations of contour lines.
This value is a multiplicative factor of the domain size or of the clipping polygon size (if it is defined). The font size used is equal to annotFontSize * Ds, where Ds is the max of the width and the height of the domain or of the clipping polygon. If this value is <= 0, the annotations font size is fixed at 0.04. By default, annotFontSize = 0.
Curvilinear distance between two annotations of a same contour line.
It is a multiplicative factor of the domain size or of the clipping polygon size (if it is defined). The distance used is equal to annotGap * Ds, where Ds is the max of the width and the height of the domain or of the polygon. By default, annotGap = 1.
Defines if the annotations are framed by a background.
By default, annotIsBackground = FALSE
Defines if the contour lines are clipped by the annotations.
By default, annotIsContourClip = FALSE
Contour lines annotations visibility.
By default, annotIsVisible = FALSE
Annotations path.
By default, annotPath = TANGENTIAL_PATH.
Defines the first major contour lines.
See also majorPeriod. By default, firstMajor = 1.
Defines the major and the minor contour lines.
majorPeriod is the period of major contour lines. Only major contour lines can be annotated. See also firstMajor. By default, majorPeriod = 3.