#include </home/scilab/compilation_chain/sci_checkOut/scilab/modules/renderer/src/cpp/subwinDrawing/AutoLogTicksComputer.hxx>


Public Member Functions | |
| AutoLogTicksComputer (DrawableSubwin *subwin) | |
| virtual | ~AutoLogTicksComputer (void) |
| virtual int | getNbTicks (void) |
| virtual void | getTicksPosition (double positions[], char *labels[], char *labelsExponents[]) |
| virtual bool | isDisplayingLabelsExponents (void) |
Definition at line 22 of file AutoLogTicksComputer.hxx.
| sciGraphics::AutoLogTicksComputer::AutoLogTicksComputer | ( | DrawableSubwin * | subwin | ) |
Definition at line 33 of file AutoLogTicksComputer.cpp.
00034 : AutomaticTicksComputer(subwin) 00035 { 00036 00037 }
| sciGraphics::AutoLogTicksComputer::~AutoLogTicksComputer | ( | void | ) | [virtual] |
| int sciGraphics::AutoLogTicksComputer::getNbTicks | ( | void | ) | [virtual] |
Get the number of ticks which will be computed by the strategy.
Reimplemented from sciGraphics::AutomaticTicksComputer.
Definition at line 44 of file AutoLogTicksComputer.cpp.
References FALSE, GradLog(), sciGraphics::AutomaticTicksComputer::m_dMaxBounds, sciGraphics::AutomaticTicksComputer::m_dMinBounds, sciGraphics::AutomaticTicksComputer::m_iNbTicks, and ticks.
Referenced by getTicksPosition().
00045 { 00046 00047 if (m_iNbTicks < 0) 00048 { 00049 double ticks[20]; 00050 GradLog(m_dMinBounds, m_dMaxBounds, ticks, &m_iNbTicks, FALSE); 00051 } 00052 return m_iNbTicks; 00053 }


| void sciGraphics::AutoLogTicksComputer::getTicksPosition | ( | double | positions[], | |
| char * | labels[], | |||
| char * | labelsExponents[] | |||
| ) | [virtual] |
Fill positions parameters with the ticks abscissas, ordinate, ...
Reimplemented from sciGraphics::AutomaticTicksComputer.
Definition at line 55 of file AutoLogTicksComputer.cpp.
References buffer, sciGraphics::BUFFER_LENGTH, ChoixFormatE(), getNbTicks(), GradLog(), i, sciGraphics::LOG_BASE, sciGraphics::AutomaticTicksComputer::m_dMaxBounds, sciGraphics::AutomaticTicksComputer::m_dMinBounds, sciGraphics::AutomaticTicksComputer::m_iNbTicks, Max, NULL, and TRUE.
00056 { 00057 if (m_iNbTicks < 0) 00058 { 00059 getNbTicks(); 00060 } 00061 00062 // Number of ticks has already been computed. 00063 GradLog(m_dMinBounds, m_dMaxBounds, positions, &m_iNbTicks, TRUE); 00064 00065 // ticks labels are 10^i 00066 // i is computed by grad log 00067 char labelsExponentFormat[5]; 00068 int lastIndex = Max( m_iNbTicks - 1, 0 ) ; 00069 00070 ChoixFormatE( labelsExponentFormat, 00071 positions[0], 00072 positions[lastIndex], 00073 (positions[lastIndex] - positions[0]) / lastIndex ); /* Adding F.Leray 06.05.04 */ 00074 00075 // copy exponents 00076 char buffer[BUFFER_LENGTH]; 00077 for (int i = 0; i < m_iNbTicks; i++) 00078 { 00079 // convert current position into a string 00080 sprintf(buffer, labelsExponentFormat, positions[i]); 00081 00082 // add the string to labels 00083 if (labelsExponents[i] != NULL) {delete labelsExponents[i];} 00084 00085 labelsExponents[i] = new char[strlen(buffer) + 1]; 00086 strcpy(labelsExponents[i], buffer); 00087 00088 // copy "10" in each labem 00089 if (labels[i] != NULL) {delete labels[i];} 00090 00091 labels[i] = new char[strlen(LOG_BASE) + 1]; 00092 strcpy(labels[i], LOG_BASE); 00093 } 00094 00095 00096 00097 00098 }

| virtual bool sciGraphics::AutoLogTicksComputer::isDisplayingLabelsExponents | ( | void | ) | [inline, virtual] |
To know if we need to get ticks exposants or not.
Reimplemented from sciGraphics::AutomaticTicksComputer.
Definition at line 44 of file AutoLogTicksComputer.hxx.
1.5.5