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

Public Member Functions | |
| AxisPositioner (void) | |
| virtual | ~AxisPositioner (void) |
| virtual void | getAxisBounds (double startBound[3], double endBound[3])=0 |
| virtual void | getGridEdges (double startBound1[3], double startBound2[3], double middleBound1[3], double middleBound2[3], double endBound1[3], double endBound2[3]) |
| virtual void | getTicksDirection (double ticksDir[3])=0 |
| virtual int | getRelativeTicksPosition (double ticksPos[], int nbTicks)=0 |
Protected Member Functions | |
| virtual void | setTicksDirectionLength (double ticksDir[3], sciPointObj *pSubwin) |
Definition at line 28 of file AxisPositioner.hxx.
| sciGraphics::AxisPositioner::AxisPositioner | ( | void | ) | [inline] |
| virtual sciGraphics::AxisPositioner::~AxisPositioner | ( | void | ) | [inline, virtual] |
| virtual void sciGraphics::AxisPositioner::getAxisBounds | ( | double | startBound[3], | |
| double | endBound[3] | |||
| ) | [pure virtual] |
Get the two bounds of this axis.
Implemented in sciGraphics::AxesPositioner, sciGraphics::BottomXAxisPositioner, sciGraphics::LeftYAxisPositioner, sciGraphics::MiddleXAxisPositioner, sciGraphics::MiddleYAxisPositioner, sciGraphics::RightYAxisPositioner, sciGraphics::TopXAxisPositioner, and sciGraphics::ZAxisPositioner.
Referenced by sciGraphics::TicksDrawer::drawTicks(), sciGraphics::TicksDrawer::getAxisPosition(), and sciGraphics::SubwinAxisPositioner::getTicksDirection().

| virtual void sciGraphics::AxisPositioner::getGridEdges | ( | double | startBound1[3], | |
| double | startBound2[3], | |||
| double | middleBound1[3], | |||
| double | middleBound2[3], | |||
| double | endBound1[3], | |||
| double | endBound2[3] | |||
| ) | [inline, virtual] |
Find the edges on which the grid will be displayed from the axes. Box. Grid is drawn on 2 facets, then 3 edges are necessary. This function is not useful for all axes drawer and drawer which need it must redefine it.
Reimplemented in sciGraphics::XAxisPositioner, sciGraphics::YAxisPositioner, and sciGraphics::ZAxisPositioner.
Definition at line 47 of file AxisPositioner.hxx.
Referenced by sciGraphics::TicksDrawer::drawTicks().

| virtual void sciGraphics::AxisPositioner::getTicksDirection | ( | double | ticksDir[3] | ) | [pure virtual] |
Compute the direction and length of ticks
Implemented in sciGraphics::AxesPositioner, and sciGraphics::SubwinAxisPositioner.
Referenced by sciGraphics::TicksDrawer::drawTicks(), and sciGraphics::TicksDrawer::getAxisPosition().

| virtual int sciGraphics::AxisPositioner::getRelativeTicksPosition | ( | double | ticksPos[], | |
| int | nbTicks | |||
| ) | [pure virtual] |
Convert ticks abscissas, into relative coordinates between the two axis bounds
| ticksPos | abscissas of ticks along their axis as input in output, get the relative coordinates between the axes bounds. 0 stands fot the start bound, 1 for the last one. | |
| nbTicks | number of ticks abascissas as input |
Implemented in sciGraphics::AxesPositioner, sciGraphics::XAxisPositioner, sciGraphics::YAxisPositioner, and sciGraphics::ZAxisPositioner.
Referenced by sciGraphics::TicksDrawer::drawTicks().

| void sciGraphics::AxisPositioner::setTicksDirectionLength | ( | double | ticksDir[3], | |
| sciPointObj * | pSubwin | |||
| ) | [protected, virtual] |
Modify the length of ticks dir depending on the size of the parent subwin.
Definition at line 29 of file AxisPositioner.cpp.
References Abs, fact(), sciGraphics::DrawableSubwin::getCamera(), sciGraphics::Camera::getPixelCoordinatesRaw(), sciGraphics::Camera::getSceneCoordinatesRaw(), sciGraphics::getSubwinDrawer(), sciGraphics::Camera::getViewingArea(), M_PI, Max, normalize3D(), scalarMult3D(), TICKS_PIXEL_LENGTH, vectSubstract3D(), and width.
Referenced by sciGraphics::SubwinAxisPositioner::getTicksDirection(), and sciGraphics::AxesPositioner::getTicksDirection().
00030 { 00031 Camera * camera = getSubwinDrawer(pSubwin)->getCamera(); 00032 double origin[3] = {0.0, 0.0, 0.0}; 00033 camera->getPixelCoordinatesRaw(origin, origin); 00034 00035 double pixDir[3]; 00036 camera->getPixelCoordinatesRaw(ticksDir, pixDir); 00037 // get length in pixels 00038 vectSubstract3D(pixDir, origin, pixDir); 00039 normalize3D(pixDir); 00040 00041 // get the viewport associated with the subwindow 00042 int xPos; 00043 int yPos; 00044 int width; 00045 int height; 00046 camera->getViewingArea(&xPos, &yPos, &width, &height); 00047 00048 // compute sizes wich would apply if axes where along X or Y axis 00049 // and use at least 2 pixels 00050 double xSize = Max(width * TICKS_PIXEL_LENGTH, 2); 00051 double ySize = Max(height * TICKS_PIXEL_LENGTH, 2); 00052 00053 // compute angle between ticks direction and x axis in pixel coordinates, pixDir[0] 00054 double angle = acos(Abs(pixDir[0])); 00055 00056 // push it between 0 and 1. 00057 double fact = angle * 2.0 / M_PI; 00058 00059 // apply number of pixels 00060 scalarMult3D(pixDir, ((1.0 - fact) * xSize + fact * ySize), pixDir); 00061 00062 // convert pix direction in 3D 00063 origin[0] = 0.0; 00064 origin[1] = 0.0; 00065 origin[2] = 0.0; 00066 camera->getSceneCoordinatesRaw(origin, origin); 00067 camera->getSceneCoordinatesRaw(pixDir, ticksDir); 00068 vectSubstract3D(ticksDir, origin, ticksDir); 00069 }


1.5.5