PoTimeAxis Class Reference
[Axis]

MeshViz Class to build a time axis. More...

#include <MeshViz/graph/PoTimeAxis.h>

Inheritance diagram for PoTimeAxis:
PoAxis PoBaseAxis PoGraphMaster PoBase SoBaseKit SoNode SoGetView SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Classes

struct  Tdate_axis_level_rep
struct  Tdate_axis_rep
struct  Tdate_elem
struct  Tdate_interv
struct  Tdate_list
struct  TimeAxisAttr

Public Types

enum  Language {
  ENGLISH,
  FRANCAIS,
  DEUTSCH,
  ESPANOL
}
enum  GradFit {
  GRAD_FIT,
  GRAD_UNFIT
}
enum  Type {
  X,
  Y
}

Public Member Functions

virtual SoType getTypeId () const
virtual const SoNodekitCataloggetNodekitCatalog () const
 PoTimeAxis ()
 PoTimeAxis (const char *_startDate, const char *_endDate, float _coord, Type _type=X)
virtual void rebuild ()
void setDateFormatMapping (PbDateFormatMapping *formatMapping)
const PbDateFormatMappinggetDateFormatMapping () const

Static Public Member Functions

static SoType getClassTypeId ()
static const SoNodekitCataloggetClassNodekitCatalog ()

Public Attributes

SoSFString startDate
SoSFString endDate
SoSFFloat coord
SoSFEnum type
SoSFEnum language
SoSFEnum gradFit
SoMFString gradRep
SoSFString timesPeriod

Friends

int tpdlparse (void)
int tpdllex (void)
int tpaxparse (void)
int tpaxlex (void)

Detailed Description

MeshViz Class to build a time axis.

This class builds a time axis in the plane XY. A time axis is an axis with date graduations.

The abscissa or ordinate (following "type" field) of the start point of the axis is startDate. The abscissa or ordinate (following "type" field) of the end point of the axis is endDate. Both these abscissas and ordinates are computed according to the association between a dates range and a coordinates range defined by the the current date mapping.

Both startDate and endDate are described by character strings. The syntax must fit the current date format, otherwise the axis is not built.

The current date format and the current date mapping are defined as follows : If the method setDateFormatMapping(formatMapping) is called, the current date format and the current date mapping are defined by "formatMapping". Otherwise the current date format and the current date mapping are specified in the current inherited state (cf property node PoDateFormatMapping).

Axis graduations are displayed depending on date representation given by the fields gradRep and timesPeriod. gradRep is a list of representations and timesPeriod is a list of possible duration.

Let D be the duration between startDate and endDate (date at the start and the end of the axis), and let Di (0 <= i < gradRep.getNum()) be the set of duration defined by the parameter timesPeriod. The choice of a representation is done as follows:

     if  D < D0                   the axis is built using representation gradRep[0]
     if  Di <= D < Di+1           the axis is built using representation gradRep[i+1]
     if  DgradRep.getNum()-2 < D  the axis is built using representation
                                  gradRep[gradRep.getNum() -1]
  

If the duration list is not provided (empty string), the representation is not chosen depending on D. It is chosen depending on calendar threads given with each representation.

Syntax of the string timesPeriod which defines the set of duration. This is a rational language defined as follows:

     timesPeriod = ([r]U)*
     where (U) is the time units selected from SEC, MIN, HOU, DAY, YEA
     where ([r]) optional positive real value defining the number of units (=1 id r is
     not defined)
     ([r]U)* means that [r]U sequence may be repeated 0 or several times
     The 'space' characters are ignored
     examples:
     timesPeriod = "10SEC  20MIN  HOU"
       defines 3 duration: 10 seconds, 20 minutes et 1 hour
     timesPeriod = "0.2SEC  30MIN  10DAY  2YEA"
       defines 4 duration: 0.2 seconds, 30 minutes, 10 day et 2 years
  

remark: For all units but SEC, only the integer part of (r) is used. Specifying a decimal part is then useless.

A date graduation representation allows the application:

A graduation representation is defined by:

All levels of graduation are displayed underneath each other for horizontal axes and side by side for vertical axes. The first level is the closest to the main line of the axis, the last one is the furthest. Date components are seconds, minutes, hours, days, months and years.

Syntax of the string gradRep[i] which defines the date representation number i. This is a rational language defined as follows:

     gradRep[i] = R(/R)*
     where (/) stands for the current new line character (attribute of the current
     miscellaneous attributes - cf PoAxis description) (it appears before definition of new level)
     where (R) is the representation of dates for one level. This rational language is
     also defined by:
     R = [[r]U]  ['string']  ([n]C['string'])*
     where [[r]U] (optional) defines the thread between 2 following calendar
     graduations of a level
     where ['string'] (optional) is any character strings between quotes
     where [n]C defines the appearance of one of the date calendar components
      [n]C = (s) to display the number of seconds (0 to 59.999...)
          = (m) to display the number of minutes (0 to 59)
          = (H) to display the number of hours (0 to 23)
          = (D) to display the day number in the month (1 to 31)
          = (nD) to display n first characters of the name of the day of the week
          = (M) to display number of the month (1 to 12)
          = (nM) to display n first characters of the name of the month of the year
          = (Y) or (2Y)to display 2 last digits of the year
          = (4Y)to display all digits of the year
  

Characters for the day of the month or month of the year are displayed using current language defined by the field language. n is an integer value greater than 0.

Warning: To insert the quote (') character in the string ['string'], it must be repeated twice. If the string must only contain (') character then the string must be defined as ''''. To insert a (") in the string a back-slash character (\) must be added before it.

Example 1:

     gradRep[i] = "20 SEC 'at'm''''s'sec'  /  1MIN  D 3M Y' ' H'h' m''''  "
  

defines two levels of graduations:

Possible appearance of graduation may be for instance:

     at11'50sec   at12'10sec  at12'30sec  at12'50sec  at13'10sec  at13'30sec
                       3MAR94 18h12'   3MAR94 18h13'
  

Example 2:

     gradRep[i] = "5 MIN H'h'm'''' /  DAY D'-'3M  /  YEA 4Y"
  

defines three levels of graduation:

Possible appearance of graduation may be for instance:

     11h15'   11h20'   11h25'   11h30'   11h35'   11h40'
                               3-MAR
                                 1995
  

FILE FORMAT/DEFAULT


Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/