Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
PbDateFormatMapping.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _PB_DATE_FORMAT_MAPPING_
25#define _PB_DATE_FORMAT_MAPPING_
26
28#include <Inventor/SbString.h>
29#include <MeshViz/graph/PiDate.h>
30
89
90
91 public:
92
97
102
106 PbDateFormatMapping(const char *date1, const char *date2,
107 float coord1, float coord2, const char *format = NULL) ;
108
112 PbDateFormatMapping(const SbString& date1, const SbString& date2,
113 float coord1, float coord2, const SbString& format = "" ) ;
114
119
128 SoNONUNICODE int setFormat(const char *format) ;
129
136 int setFormat(const SbString& format) ;
137
142 { return m_dateFormat; }
143
158 SoNONUNICODE int setDateMapping(const char *date1, const char *date2,
159 float coord1, float coord2) ;
160
173 int setDateMapping(const SbString& date1, const SbString& date2,
174 float coord1, float coord2) ;
175
179 void getDateMapping(SbString &date1, SbString &date2,
180 float &coord1, float &coord2) const ;
181
188 SbBool getCoordinate(const char *date, float &c) const ;
189
195 SbBool getCoordinate(const SbString& date, float &c) const ;
196
197 /*----------------------------------------------------------------------------*/
198
199
200 private:
201 float getCoordinateP(const PiDate &date) const ;
202 PiDate getDateP(float coord) ;
203
204 private:
205 // Used by constructor per copy and affectation operator
206 void copy(const PbDateFormatMapping &dateFormatMap, SbBool isConstructorPerCopy) ;
207
208 // Check date format - 0 is return if the
209 // format is correct - The error character number is return
210 // otherwise.
211 int checkDateFormat() const ;
212
213 // True is return if the interval is correct
214 // False otherwise
215 void setDateMappingP(const PiDate &date1, const PiDate &date2,
216 float coord1, float coord2) ;
217 PiDate m_date1 ;
218 float m_coordinate1, m_coordinate2, m_dateIntervalSecond ;
219 SbString m_dateFormat, m_date1Str, m_date2Str ;
220
221} ;
222/*----------------------------------------------------------------------------*/
223
224#endif /* _PB_DATE_FORMAT_MAPPING_ */
225
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract class for all b...
Definition PbBase.h:49
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines the date format ...
PbDateFormatMapping & operator=(const PbDateFormatMapping &dateFormatMap)
Assignment operator.
int setDateMapping(const SbString &date1, const SbString &date2, float coord1, float coord2)
Defines an association between dates and coordinates (date mapping).
SbBool getCoordinate(const char *date, float &c) const
Returns the coordinate associated to a date according to date mapping.
PbDateFormatMapping(const SbString &date1, const SbString &date2, float coord1, float coord2, const SbString &format="")
Constructor.
PbDateFormatMapping(const char *date1, const char *date2, float coord1, float coord2, const char *format=NULL)
Constructor.
PbDateFormatMapping()
Default constructor.
SoNONUNICODE int setDateMapping(const char *date1, const char *date2, float coord1, float coord2)
Defines an association between dates and coordinates (date mapping).
SoNONUNICODE int setFormat(const char *format)
Set the format for dates.
SbBool getCoordinate(const SbString &date, float &c) const
Returns the coordinate associated to a date according to date mapping.
void getDateMapping(SbString &date1, SbString &date2, float &coord1, float &coord2) const
Gets the date mapping.
SbString getFormat() const
Gets the format for dates.
int setFormat(const SbString &format)
Set the format for dates.
PbDateFormatMapping(const PbDateFormatMapping &dateFormatMap)
Copy constructor.
Class for smart character strings.
Definition SbString.h:202
int SbBool
Boolean type.
Definition SbBase.h:87