#include <pColorBar.h>
Public Member Functions | |
pColorBar (wxWindow *parent, int _w, int _h, bool _bar_orientation) | |
~pColorBar () | |
void | OnSize (wxSizeEvent &WXUNUSED(event)) |
void | onMouseMove (wxMouseEvent &event) |
void | onPaint (wxPaintEvent &WXUNUSED(event)) |
void | onAddColorPoint (wxCommandEvent &anEvent) |
void | onDeleteColorPoint (wxCommandEvent &anEvent) |
void | onChangeColourSelectedPoint (wxCommandEvent &anEvent) |
void | onTrianglesUp_Figure (wxCommandEvent &anEvent) |
void | onTrianglesDown_Figure (wxCommandEvent &anEvent) |
void | onTrianglesLeft_Figure (wxCommandEvent &anEvent) |
void | onTrianglesRight_Figure (wxCommandEvent &anEvent) |
void | onRectangles_Figure (wxCommandEvent &anEvent) |
void | onDegradeControl (wxCommandEvent &anEvent) |
void | onLeftButtonDClick (wxMouseEvent &event) |
void | onShowPopupMenu (wxMouseEvent &event) |
void | setActiveStateTo (bool activeNow) |
bool | isActive () |
int | getRealX_vertical_line () |
void | setRealX_vertical_line (int newReal_x) |
void | reinitiateColorBar (double minRealValue, double maxRealValue) |
void | reinitiateColorBarTo (std::vector< pColorPoint * > pointsVector) |
void | getPointsListWithTemps (std::vector< pColorPoint * > &pointsVector) |
void | getAddedColorsPointsList (std::vector< pColorPoint * > &pointsVector) |
bool | addColorPoint (double xRealValue, wxColour theColour) |
bool | deleteColorPoint (double xRealValue) |
bool | changeColor (int clickedValue) |
void | repaintView () |
void | RefreshForce () |
void | Refresh (bool eraseBackground=true, const wxRect *rect=NULL) |
void | drawColorBar (bool recentlyChangedOrientation) |
void | changeFigure (int theFigure) |
void | changePointsFigure_Edges (int figEdges) |
int | getPointsFigure_Edges () |
void | setHeight (int _h) |
int | getHeight () |
void | setWidth (int _w) |
int | getWidth () |
void | setBarHeight (int _h) |
int | getBarHeight () |
void | setBarWidth (int _w) |
int | getBarWidth () |
void | setOrientation (bool _orientation) |
bool | getOrientation () |
void | setPoints (std::vector< pColorPoint * > _points) |
int | getClickedX () |
void | setClickedX (int xCoordPixel) |
int | getClickedY () |
void | setClickedY (int yCoordPixel) |
double | convertToRealValue (int x_Pixel) |
int | convertToPixelValue (double x_real) |
wxColour | getSelectedColour () |
void | setRepresentedValues (double minRealValue, double maxRealValue) |
pColorPoint * | getLastMovedColorPoint () |
void | setGapValues (int gap_x, int gap_y) |
void | setDegradeState (bool newState) |
void | setVisibleRange (int minToShow, int maxToShow) |
bool | getDegradeState () |
void | setStaticLimitsTo (bool areStatic) |
bool | getStaticLimits () |
void | setDeviceBlitStart (wxCoord deviceStart_x, wxCoord deviceStart_y) |
void | clearTemporalColors () |
int | getDeviceEndX () |
void | setDeviceEndX (int newDeviceEnd_pixels) |
void | setDeviceEndMargin (int newDeviceEnd_pixels) |
void | createAndSendEvent (WXTYPE theEventType) |
int | getColorPointsSize () |
void | getDataAt (int index, double &x, int &red, int &green, int &blue) |
void | setGuideLineColour (wxColour theNwGuideLineColor) |
wxColour | getGuideLineColour () |
void | setBackGroundColour (wxColour theNwBackColor) |
wxColour | getBackGroundColour () |
double | getMinValue () |
double | getMaxValue () |
void | updateExtremeColors () |
void | onLeftClicDown (wxMouseEvent &event) |
void | onLeftClickUp (wxMouseEvent &event) |
void | updatePointsToDraw () |
Private Attributes | |
bool | acceptedClick |
LogicalColorBar * | _logicalBar |
int | gapX |
int | gapY |
int | height |
int | width |
int | bar_height |
int | bar_width |
std::deque< pColorPoint * > | showedColorPoints |
int | points_orientation |
int | minX_represented_Tshow |
int | maxX_represented_Tshow |
int | temporalMinXToShow |
int | temporalMaxXToShow |
pColorPoint * | startNode_show |
pColorPoint * | lastNode_show |
int | accumTemporalPoints |
bool | viewingRange |
pFigure * | figure |
int | clickedX |
int | clickedY |
int | movingPointIndex |
bool | okSelectedColor |
bool | staticLimits |
pColorPoint * | movingNodePoint |
wxBitmap * | colorBar_Bitmap |
wxBitmap * | information_Bitmap |
bool | doingDegrade |
bool | minFound |
bool | maxFound |
wxCoord | deviceStart_x |
wxCoord | deviceStart_y |
wxCoord | deviceEndMargin |
wxCoord | deviceEnd_y |
bool | activeState |
int | avaliablePointToMove |
int | realX_vertical_line |
wxColour | guideLineColor |
wxColour | colourParent |
wxMenu | c_popmenu |
wxMenu * | changesMenu |
file pColorBar.h
Definition at line 68 of file pColorBar.h.
pColorBar::pColorBar | ( | wxWindow * | parent, | |
int | _w, | |||
int | _h, | |||
bool | _bar_orientation | |||
) |
Creates a colorBar instance param *parent Container event listener window param _w Width of the color bar drawing area param _h Height of the color bar drawing area param _bar_orientation VERTICAL (false) or HORIZONTAL (true) direction to set
file pColorBar.cxx
Definition at line 69 of file pColorBar.cxx.
References cntID_CHANGE_FIGURE, FIGURE_WIDTH, and RECTANGLE.
00070 :wxScrolledWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) 00071 { 00072 _logicalBar = new LogicalColorBar(); 00073 colourParent = GetParent()->GetBackgroundColour(); 00074 deviceEndMargin = 0; 00075 acceptedClick = true; 00076 setGapValues (0,6); 00077 setWidth(_w); 00078 setHeight(_h); 00079 00080 // Setting the default represented values 00081 setDegradeState(true); 00082 setStaticLimitsTo(false); 00083 viewingRange = false; 00084 accumTemporalPoints = 0; 00085 deviceEndMargin = 0; 00086 activeState = false; 00087 avaliablePointToMove = -1; 00088 00089 movingPointIndex = -1; 00090 movingNodePoint = NULL; 00091 realX_vertical_line = -1; 00092 guideLineColor = wxColour(255,0,0); 00093 00094 //TRIANGLES UP 00095 figure = new pFigure( RECTANGLE, FIGURE_WIDTH, bar_height, -2, _bar_orientation ); 00096 setOrientation ( _bar_orientation ); 00097 00098 // Appending menu items to the pop-menu 00099 c_popmenu.Append( cntID_ADD_COLOR_POINT, _T("Add color point"), _T("Adds a color point in the clicked point")); 00100 c_popmenu.Append( cntID_DEL_COLOR_POINT, _T("Delete color point"), _T("Deletes the color point at the clicked point")); 00101 c_popmenu.Append( cntID_CHANGE_COLOR_POINT, _T("Change color"), _T("Changes the color at the clicked point")); 00102 c_popmenu.Append ( cntID_DEGRADE_CONTROL, _T("Turn off degrade"), _T("Turns on/off the degrade"),wxITEM_SEPARATOR); 00103 00104 changesMenu = new wxMenu; 00105 changesMenu->AppendCheckItem ( cntID_TRIANGLES_UP, _T("Triangles up"),_T("Sets triangles up figure")); 00106 changesMenu->AppendCheckItem ( cntID_TRIANGLES_DOWN, _T("Triangles down"),_T("Sets triangles down figure")); 00107 changesMenu->AppendCheckItem ( cntID_TRIANGLES_LEFT, _T("Triangles left"),_T("Sets triangles left figure")); 00108 changesMenu->AppendCheckItem ( cntID_TRIANGLES_RIGHT, _T("Triangles right"),_T("Sets triangles right figure")); 00109 changesMenu->AppendCheckItem ( cntID_RECTANGLES, _T("Rectangles"),_T("Sets rectangle figure")); 00110 c_popmenu.Append(cntID_CHANGE_FIGURE, _T("Change figure"),changesMenu, _T("Changes the figure of the color points")); 00111 changesMenu->Check (cntID_TRIANGLES_UP, true); 00112 }
pColorBar::~pColorBar | ( | ) |
Definition at line 114 of file pColorBar.cxx.
bool pColorBar::addColorPoint | ( | double | xRealValue, | |
wxColour | theColour | |||
) |
Adds a color degrade point to the color bar. param xRealValue The real xValue of the point param theColour The assigned color for the point param temporalStart Indicates if the inserted point is the temporal startShowing point param temporalEnd Indicates if the inserted point is the temporal startShowing point return Returns true if the point was succesfully inserted.
Definition at line 686 of file pColorBar.cxx.
References _logicalBar, LogicalColorBar::addColorPoint(), and RefreshForce().
Referenced by pPlotter::addColorPoint(), onAddColorPoint(), and onLeftButtonDClick().
00687 { 00688 bool addedPoint = false; 00689 addedPoint = _logicalBar->addColorPoint(xRealValue,theColour); 00690 if (addedPoint) 00691 RefreshForce(); 00692 return addedPoint; 00693 }
bool pColorBar::changeColor | ( | int | clickedValue | ) |
Changes the color degrade point color value. Informs the result of the handled event like a wxCommandEvent wxEVT_CHANGED_COLOR_POINT if the point changed its colour. param clickedValue The x-coord pixel value of the point to which the color change interests return Returns true if the color point was succesfully updated.
Definition at line 727 of file pColorBar.cxx.
References convertToPixelValue(), convertToRealValue(), figure, getSelectedColour(), okSelectedColor, RefreshForce(), and showedColorPoints.
Referenced by onChangeColourSelectedPoint().
00728 { 00729 bool colourUpdated = false; 00730 double xRealValue = convertToRealValue( clickedValue ); 00731 pColorPoint* actualPoint; 00732 for (int a =0; a<showedColorPoints.size() && !colourUpdated; a++) 00733 { 00734 actualPoint = showedColorPoints[a]; 00735 int actualX = (int)actualPoint -> getRealX(); 00736 bool isInsideActual = figure -> isPointInside (convertToPixelValue(actualX), clickedValue); 00737 if( actualX == xRealValue || isInsideActual) 00738 { 00739 wxColour newColour = getSelectedColour(); 00740 if (okSelectedColor) 00741 { 00742 actualPoint -> setColor(newColour); 00743 colourUpdated = true; 00744 } 00745 } 00746 } 00747 if(colourUpdated) 00748 RefreshForce(); 00749 return colourUpdated; 00750 }
void pColorBar::changeFigure | ( | int | theFigure | ) |
Changes the figure of the color points according to the parameter param theFigure Is the corresponding number for identifying the figure RECTANGLE = 4,TRIANGLE LEFT = -4, TRIANGLE RIGHT = -6, TRIANGLE UP = -8, TRIANGLE DOWN = -2
Definition at line 942 of file pColorBar.cxx.
References changePointsFigure_Edges(), figure, and RefreshForce().
Referenced by onRectangles_Figure(), onTrianglesDown_Figure(), onTrianglesLeft_Figure(), onTrianglesRight_Figure(), and onTrianglesUp_Figure().
00943 { 00944 if ( figureOrientation<1 ) //The figure is a a rotated triangle 00945 { 00946 changePointsFigure_Edges(3); 00947 figure -> setFigureOrientation ( figureOrientation ); 00948 00949 } 00950 else //The figure is a rectangle 00951 { 00952 changePointsFigure_Edges(4); 00953 } 00954 RefreshForce(); 00955 }
void pColorBar::changePointsFigure_Edges | ( | int | figEdges | ) |
Changes the figure number of edges used for the degreade color points to the indicated one by parameter param figEdges Is the constant that represents the figure number of edges (TRIANGLE | RECTANGLE)
Changes the figure used for the degreade color points to the indicated one by parameter param figEdges Is the constant that represents the figure number of edges (TRIANGLE | RECTANGLE)
Definition at line 961 of file pColorBar.cxx.
References figure, and pFigure::setNumberEdges().
Referenced by changeFigure().
00962 { 00963 figure->setNumberEdges( figEdges); 00964 }
void pColorBar::clearTemporalColors | ( | ) |
Clears the temporal color points of the list
Definition at line 1269 of file pColorBar.cxx.
int pColorBar::convertToPixelValue | ( | double | x_real | ) |
Gets the x-pixel value for a given x_real value using the rule x_pixel = (x_real * bar_width)/(maxX_represented_Tshow - minX_represented_Tshow) param x_Pixel The pixel value to convert into real value with respect to the x scale return realX The real-x value corresponding to the xPixel
Gets the x-pixel value for a given x_real value using the rule x_pixel = ((x_real - minX_represented_Tshow) * bar_width)/(maxX_represented_Tshow - minX_represented_Tshow) param x_Pixel The pixel value to convert into real value with respect to the x scale return realX The real-x value corresponding to the xPixel
Definition at line 1135 of file pColorBar.cxx.
References bar_width, deviceEndMargin, maxX_represented_Tshow, and minX_represented_Tshow.
Referenced by changeColor(), deleteColorPoint(), onMouseMove(), repaintView(), and updatePointsToDraw().
01136 { 01137 return (int)( ((x_real - minX_represented_Tshow) * (bar_width-deviceEndMargin))/(maxX_represented_Tshow - minX_represented_Tshow) ); 01138 }
double pColorBar::convertToRealValue | ( | int | x_Pixel | ) |
Gets the real x value for a givex x-pixel value using the rule real_x = (x_pixel * (maxX_represented_Tshow - minXRepresented) ) / bar_width param x_Pixel The pixel value to convert into real value with respect to the x scale return realX The real-x value corresponding to the xPixel
Gets the real x value for a given x-pixel value using the rule real_x = minX_represented_Tshow + ((x_Pixel * (maxX_represented_Tshow - minX_represented_Tshow) ) / bar_width) param x_Pixel The pixel value to convert into real value with respect to the x scale return realX The real-x value corresponding to the xPixel
int newPixel = x_Pixel*(bar_width - deviceEndMargin - deviceStart_x)/(bar_width) ; return newPixel*(maxX_represented_Tshow - minX_represented_Tshow)/(bar_width);
Definition at line 1121 of file pColorBar.cxx.
References bar_width, deviceEndMargin, deviceStart_x, maxX_represented_Tshow, and minX_represented_Tshow.
Referenced by changeColor(), onAddColorPoint(), onDeleteColorPoint(), onLeftButtonDClick(), and onMouseMove().
01122 { 01127 return minX_represented_Tshow + ((x_Pixel-deviceStart_x) * (maxX_represented_Tshow - minX_represented_Tshow) ) /( bar_width-deviceEndMargin); 01128 }
void pColorBar::createAndSendEvent | ( | WXTYPE | theEventType | ) |
Method that creates and send the given id-event to the event handler param theEventType Is the event id type identification for generating the event
Definition at line 1319 of file pColorBar.cxx.
Referenced by onAddColorPoint(), onChangeColourSelectedPoint(), onDeleteColorPoint(), onLeftButtonDClick(), and onMouseMove().
01320 { 01321 wxCommandEvent cevent( theEventType, GetId() ); 01322 cevent.SetEventObject( this ); 01323 GetEventHandler()->ProcessEvent( cevent ); 01324 }
bool pColorBar::deleteColorPoint | ( | double | xRealValue | ) |
Delets a color degrade point to the color bar. param xRealValue The real xValue of the point to delete return Returns true if the point was succesfully inserted.
Definition at line 701 of file pColorBar.cxx.
References _logicalBar, convertToPixelValue(), LogicalColorBar::deleteColorPoint(), figure, movingPointIndex, RefreshForce(), and showedColorPoints.
Referenced by onDeleteColorPoint().
00702 { 00703 pColorPoint* actualPoint; 00704 bool deletedPoint = false; 00705 for (int a =0; a<showedColorPoints.size() && !deletedPoint; a++) 00706 { 00707 actualPoint = showedColorPoints[a]; 00708 int actualX = (int)actualPoint -> getRealX(); 00709 bool isInsideActual = figure -> isPointInside (convertToPixelValue(actualX), convertToPixelValue(xRealValue)); 00710 if( actualX == xRealValue || isInsideActual) 00711 { 00712 movingPointIndex=-1; 00713 deletedPoint = _logicalBar->deleteColorPoint(actualPoint -> getRealX()); 00714 } 00715 } 00716 if (deletedPoint) 00717 RefreshForce(); 00718 return deletedPoint; 00719 }
void pColorBar::drawColorBar | ( | bool | recentlyChangedOrientation | ) |
Draws the color bar with its degrades param recentlyChangedOrientation indicates if the orientation has been changed before calling this method
Definition at line 907 of file pColorBar.cxx.
References bar_height, bar_width, colorBar_Bitmap, deviceEndMargin, getOrientation(), height, setWidth(), and width.
Referenced by setDeviceBlitStart().
00908 { 00909 wxRect rectTotal = GetClientRect(); 00910 if (recentlyChangedOrientation) 00911 { 00912 if ( getOrientation() ) // HORIZONTAL 00913 { 00914 //SetSize(width, height ); 00915 wxWindow::SetSize( width, height ); 00916 //SetSize( rectTotal.GetWidth(), rectTotal.GetHeight() ); 00917 setWidth(GetClientRect().GetWidth()- deviceEndMargin); 00918 //setHeight(GetClientRect().GetHeight()); 00919 00920 colorBar_Bitmap = new wxBitmap( bar_width+1280, bar_height+1280 ); 00921 //information_Bitmap = new wxBitmap( width-bar_width, height-bar_height ); 00922 } 00923 else // VERTICAL 00924 { 00925 wxWindow::SetSize( height, width ); 00926 //SetSize( rectTotal.GetHeight(), rectTotal.GetWidth() ); 00927 setWidth(GetClientRect().GetHeight()- deviceEndMargin); 00928 //setHeight(GetClientRect().GetWidth()); 00929 00930 //SetWindowStyle( wxNO_FULL_REPAINT_ON_RESIZE ); 00931 colorBar_Bitmap = new wxBitmap( bar_height+1280, bar_width+1280 ); 00932 //information_Bitmap = new wxBitmap( height-bar_height, width-bar_width ); 00933 } 00934 } 00935 }
void pColorBar::getAddedColorsPointsList | ( | std::vector< pColorPoint * > & | pointsVector | ) |
Method that sets a copy of the points of the color bar to the given pointer parameter, and sets the default values to the needeed attributes, it doesn't includes the teporal points created param pointsVector The list for getting the points
Definition at line 666 of file pColorBar.cxx.
References _logicalBar, pColorPoint::getColor(), LogicalColorBar::getCount(), LogicalColorBar::getPointAtIndex(), pColorPoint::getRealX(), and pColorPoint::isTemporalColor().
Referenced by pPlotter::GetValuesColorPointsFunction(), pPlotter::onAdded_ColorPoint(), and pPlotter::onRemoved_ColorPoint().
00667 { 00668 pColorPoint* cPoint; 00669 for (int a =0; a<_logicalBar->getCount(); a++) 00670 { 00671 cPoint = _logicalBar ->getPointAtIndex(a); 00672 pColorPoint* copyPoint = new pColorPoint(cPoint->getRealX(), cPoint->getColor( ), (cPoint->isTemporalColor())); 00673 pointsVector.push_back(copyPoint); 00674 } 00675 }
wxColour pColorBar::getBackGroundColour | ( | ) |
Gets the background color return colourParent The color of the background
Definition at line 1376 of file pColorBar.cxx.
References colourParent.
01377 { 01378 return colourParent; 01379 }
int pColorBar::getBarHeight | ( | ) |
Gets the height of the containing rectangle bar return bar_height The height to get
Definition at line 1026 of file pColorBar.cxx.
References bar_height.
01027 { 01028 return bar_height; 01029 }
int pColorBar::getBarWidth | ( | ) |
Gets the width of the containing rectangle bar return bar_width The width to get
Definition at line 1044 of file pColorBar.cxx.
References bar_width.
01045 { 01046 return bar_width; 01047 }
int pColorBar::getClickedX | ( | ) |
Gets the last clickedX pixel coord inside the bar. return clickedX The x-coord pixel value
Definition at line 1084 of file pColorBar.cxx.
References clickedX.
01085 { 01086 return clickedX; 01087 }
int pColorBar::getClickedY | ( | ) |
Gets the last clickedY pixel coord inside the bar. return clickedY The y-coord pixel value
Definition at line 1102 of file pColorBar.cxx.
References clickedY.
01103 { 01104 return clickedY; 01105 }
int pColorBar::getColorPointsSize | ( | ) |
Returns the number of points that the bar color has return
Returns the number of points that the bar color has
Definition at line 1330 of file pColorBar.cxx.
References _logicalBar, and LogicalColorBar::getCount().
Referenced by pPlotter::getColorPointsSize().
01331 { 01332 return _logicalBar->getCount(); 01333 }
void pColorBar::getDataAt | ( | int | index, | |
double & | x, | |||
int & | red, | |||
int & | green, | |||
int & | blue | |||
) |
Get the RGB values of the color point that is in the index given
Definition at line 1339 of file pColorBar.cxx.
References _logicalBar, and LogicalColorBar::getDataAt().
Referenced by pPlotter::getBarColorDataAt(), and updatePointsToDraw().
01340 { 01341 //****************************** 01342 _logicalBar->getDataAt(index, x, red, green, blue); 01343 }
bool pColorBar::getDegradeState | ( | ) |
Gets the degrade state of the color bar return doingDegrade is the actual degrade state of the bar
Definition at line 1214 of file pColorBar.cxx.
References doingDegrade.
Referenced by onDegradeControl().
01215 { 01216 return doingDegrade; 01217 }
int pColorBar::getDeviceEndX | ( | ) |
Gets the device value form the end of this panel to the end of the drawing area in the device in pixels return deviceEndMargin The value asigned to the right margin
wxColour pColorBar::getGuideLineColour | ( | ) |
Gets the guide line color return guideLineColor The color of the guideLine
Definition at line 1358 of file pColorBar.cxx.
References guideLineColor.
01359 { 01360 return guideLineColor; 01361 }
int pColorBar::getHeight | ( | ) |
Sets the height of the drawing bar area return _h The height to get
Definition at line 989 of file pColorBar.cxx.
References height.
00990 { 00991 return height; 00992 }
pColorPoint * pColorBar::getLastMovedColorPoint | ( | ) |
Gets the data of the last point moving return pointData Is a pColorPoint with the data of las moved color
Gets the data of the last point moving in a pColorPoint copy return pointData Is a pColorPoint with the data of las moved color
Definition at line 1179 of file pColorBar.cxx.
References pColorPoint::getColor(), pColorPoint::getRealX(), movingNodePoint, pColorPoint::setColor(), and pColorPoint::setRealX().
Referenced by pPlotter::onMoved_ColorPoint().
01180 { 01181 pColorPoint * dataPoint = new pColorPoint ( 0, wxColor (0,0,0), false); 01182 if (movingNodePoint) 01183 { 01184 dataPoint ->setColor(movingNodePoint->getColor()); 01185 dataPoint ->setRealX(movingNodePoint->getRealX()); 01186 } 01187 return dataPoint; 01188 }
double pColorBar::getMaxValue | ( | ) |
Gets the max value of the color bar
Definition at line 1392 of file pColorBar.cxx.
References maxX_represented_Tshow.
Referenced by pPlotter::eraseColorPoints(), and reinitiateColorBarTo().
01393 { 01394 return (double)maxX_represented_Tshow; 01395 }
double pColorBar::getMinValue | ( | ) |
Gets the min value of the color bar
Definition at line 1384 of file pColorBar.cxx.
References minX_represented_Tshow.
Referenced by pPlotter::eraseColorPoints(), and reinitiateColorBarTo().
01385 { 01386 return (double)minX_represented_Tshow; 01387 }
bool pColorBar::getOrientation | ( | ) |
Gets the orientation of the color bar return bar_orientation The bar orientation assigned
Definition at line 1063 of file pColorBar.cxx.
References _logicalBar, and LogicalColorBar::getOrientation().
Referenced by drawColorBar(), onAddColorPoint(), onChangeColourSelectedPoint(), onDeleteColorPoint(), onLeftButtonDClick(), onMouseMove(), onPaint(), onShowPopupMenu(), OnSize(), repaintView(), and setDeviceBlitStart().
01064 { 01065 return _logicalBar->getOrientation(); 01066 }
int pColorBar::getPointsFigure_Edges | ( | ) |
Gets the constant that represents the figure number of edges used for the degreade color points return figureEdges Is the constant that represents the figure number of edges (TRIANGLE | RECTANGLE)
Gets the constant that represents the figure used for the degreade color points return figureEdges Is the constant that represents the figure number of edges (TRIANGLE | RECTANGLE)
Definition at line 970 of file pColorBar.cxx.
References figure.
00971 { 00972 return (figure -> getNumberEdges()); 00973 }
void pColorBar::getPointsListWithTemps | ( | std::vector< pColorPoint * > & | pointsVector | ) |
Method that sets a copy of the points of the color bar to the given pointer parameter param pointsList The list for getting the points
Definition at line 649 of file pColorBar.cxx.
References pColorPoint::getColor(), pColorPoint::getRealX(), pColorPoint::isTemporalColor(), and showedColorPoints.
00650 { 00651 pColorPoint* cPoint; 00652 for (int a =0; a<showedColorPoints.size() ; a++) 00653 { 00654 cPoint = showedColorPoints[a]; 00655 pColorPoint* copyPoint = new pColorPoint(cPoint->getRealX(), cPoint->getColor( ), (cPoint->isTemporalColor())); 00656 pointsVector.push_back(copyPoint); 00657 } 00658 }
int pColorBar::getRealX_vertical_line | ( | ) |
Gets the real-x value to draw a vertical line return realX_vertical_line The real x value for the vertical line
Definition at line 1296 of file pColorBar.cxx.
References realX_vertical_line.
Referenced by pPlotter::onSelectionEnd().
01297 { 01298 return realX_vertical_line; 01299 }
wxColour pColorBar::getSelectedColour | ( | ) |
Gets the selected color and updates the state of the okSelectedColor return selectedColor Is the selected rbg color
Definition at line 1144 of file pColorBar.cxx.
References okSelectedColor.
Referenced by changeColor(), onAddColorPoint(), and onLeftButtonDClick().
01145 { 01146 okSelectedColor = false; 01147 wxColour col; 01148 wxColourData data; 01149 wxColourDialog dialog( GetParent(), &data); 01150 01151 if ( dialog.ShowModal() == wxID_OK ) 01152 { 01153 col = dialog.GetColourData().GetColour(); 01154 okSelectedColor = true; 01155 } 01156 return col; 01157 }
bool pColorBar::getStaticLimits | ( | ) |
Gets the state of static or not for the limit color points return staticLimits Is the state for limits
Definition at line 1245 of file pColorBar.cxx.
References staticLimits.
01246 { 01247 return staticLimits; 01248 }
int pColorBar::getWidth | ( | ) |
Gets the width of the drawing bar area param width The width to get
Definition at line 1008 of file pColorBar.cxx.
References width.
01009 { 01010 return width; 01011 }
bool pColorBar::isActive | ( | ) |
Gets the active state of the bar return activeState The actual state
Gets the active state of the bar return isActive The actual state
Definition at line 1287 of file pColorBar.cxx.
References activeState.
01288 { 01289 return activeState; 01290 }
void pColorBar::onAddColorPoint | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_ADD_COLOR_POINT wxCommandEvent and adds a color degrade point to the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_ADDED_POINT if the point was inserted succesfully. param & anEvent The wxCommandEvent actioned event
Reacts to the cntID_ADD_COLOR_POINT wxCommandEvent and adds a color degrade point to the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_ADDED_COL_POINT if the point was inserted succesfully. param & anEvent The wxCommandEvent actioned event
Definition at line 363 of file pColorBar.cxx.
References addColorPoint(), clickedX, clickedY, convertToRealValue(), createAndSendEvent(), getOrientation(), getSelectedColour(), and okSelectedColor.
00364 { 00365 bool addedPoint = false; 00366 double real_x = getOrientation() ? convertToRealValue( clickedX ) : convertToRealValue( clickedY ); 00367 wxColour selectedColor = getSelectedColour(); 00368 if (okSelectedColor) 00369 { 00370 addedPoint = addColorPoint (real_x, selectedColor); 00371 } 00372 // Inform addedPoint event 00373 if ( addedPoint ) 00374 { 00375 //RefreshForce(); 00376 createAndSendEvent( wxEVT_ADDED_POINT ); 00377 } 00378 }
void pColorBar::onChangeColourSelectedPoint | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_CHANGE_COLOR_POINT wxCommandEvent and changes the assigned color to the selected color degrade point of the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_CHANGED_POINT if the point was succesfully removed. param & anEvent The wxCommandEvent actioned event
Definition at line 403 of file pColorBar.cxx.
References changeColor(), clickedX, clickedY, createAndSendEvent(), and getOrientation().
00404 { 00405 bool changedColour = false; 00406 changedColour = getOrientation() ? changeColor( clickedX ) : changeColor( clickedY ); 00407 // Inform deletedPoint event 00408 if ( changedColour ) 00409 { 00410 //RefreshForce(); 00411 createAndSendEvent( wxEVT_CHANGED_POINT ); 00412 } 00413 }
void pColorBar::onDegradeControl | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_DEGRADE_CONTROL wxCommandEvent and turns on/off the degrade in the color bar. param & anEvent The wxCommandEvent actioned event
Definition at line 499 of file pColorBar.cxx.
References c_popmenu, cntID_DEGRADE_CONTROL, getDegradeState(), and setDegradeState().
00500 { 00501 bool degrade = getDegradeState(); 00502 wxString nextAction_text; 00503 if(degrade) 00504 { 00505 nextAction_text = _T("Turn on degrade"); 00506 setDegradeState (false); 00507 } 00508 else 00509 { 00510 nextAction_text = _T("Turn off degrade"); 00511 setDegradeState (true); 00512 } 00513 c_popmenu.SetLabel ( cntID_DEGRADE_CONTROL, nextAction_text ); 00514 }
void pColorBar::onDeleteColorPoint | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_DEL_POINT wxCommandEvent and deletes a color degrade point of the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_REMOVED_POINT if the point was succesfully removed. param & anEvent The wxCommandEvent actioned event
Reacts to the cntID_DEL_COLOR_POINT wxCommandEvent and deletes a color degrade point of the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_REMOVED_COL_POINT if the point was succesfully removed. param & anEvent The wxCommandEvent actioned event
Definition at line 385 of file pColorBar.cxx.
References clickedX, clickedY, convertToRealValue(), createAndSendEvent(), deleteColorPoint(), and getOrientation().
00386 { 00387 bool deletedPoint = false; 00388 double real_x = getOrientation() ? convertToRealValue( clickedX ) : convertToRealValue( clickedY ); 00389 deletedPoint = deleteColorPoint(real_x); 00390 // Inform deletedPoint event 00391 if ( deletedPoint ) 00392 { 00393 //RefreshForce(); 00394 createAndSendEvent( wxEVT_REMOVED_POINT ); 00395 } 00396 }
void pColorBar::onLeftButtonDClick | ( | wxMouseEvent & | event | ) |
Reacts to the wxEVT_RIGHT_DCLICK wxMouseEvent and adds a color degrade point to the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_ADDED_POINT if the point was succesfully inserted. param & event The wxMouseEvent actioned event
Reacts to the wxEVT_RIGHT_DCLICK wxMouseEvent and adds a color degrade point to the color bar. Informs the result of the handled event like a wxCommandEvent wxEVT_ADDED_COL_POINT if the point was succesfully inserted. param & event The wxMouseEvent actioned event
Definition at line 521 of file pColorBar.cxx.
References activeState, addColorPoint(), bar_height, convertToRealValue(), createAndSendEvent(), deviceStart_x, deviceStart_y, getOrientation(), getSelectedColour(), and okSelectedColor.
00522 { 00523 if (activeState) 00524 { 00525 bool addedPoint = false; 00526 wxPoint point = event.GetPosition(); 00527 bool posiblePoint = false; 00528 if( getOrientation() ) 00529 { 00530 posiblePoint = point.x>=deviceStart_x && point.y<= (bar_height + deviceStart_y); 00531 } 00532 else 00533 { 00534 posiblePoint = point.x>=deviceStart_y && point.x<= (bar_height+deviceStart_y) && point.y>deviceStart_x; 00535 } 00536 00537 if (posiblePoint) 00538 { 00539 double real_x = getOrientation() ? convertToRealValue( point.x ) : convertToRealValue( point.y ); 00540 wxColour selectedColor = getSelectedColour(); 00541 if (okSelectedColor) 00542 { 00543 addedPoint = addColorPoint (real_x, selectedColor); 00544 } 00545 // Inform addedPoint event 00546 if ( addedPoint ) 00547 { 00548 //RefreshForce(); Is all ready refreshed on the adition of the point method 00549 createAndSendEvent( wxEVT_ADDED_POINT ); 00550 } 00551 } 00552 } 00553 }
void pColorBar::onLeftClicDown | ( | wxMouseEvent & | event | ) |
Definition at line 555 of file pColorBar.cxx.
References acceptedClick.
00556 { 00557 acceptedClick = true; 00558 }
void pColorBar::onLeftClickUp | ( | wxMouseEvent & | event | ) |
Definition at line 560 of file pColorBar.cxx.
References acceptedClick, and movingPointIndex.
00561 { 00562 movingPointIndex = -1; 00563 acceptedClick = false; 00564 }
void pColorBar::onMouseMove | ( | wxMouseEvent & | event | ) |
Reacts to the mouse movement inside the color bar for moving the clicked color point in the x-axis. Informs the result of the handled event like a wxCommandEvent wxEVT_MOVED_POINT if a point was moved. param event The mouse actioned event
Reacts to the mouse movement inside the color bar for moving the clicked color point in the x-axis. Informs the result of the handled event like a wxCommandEvent wxEVT_MOVED_COL_POINT if a point was moved. param event The mouse actioned event
Definition at line 140 of file pColorBar.cxx.
References _logicalBar, acceptedClick, activeState, avaliablePointToMove, convertToPixelValue(), convertToRealValue(), createAndSendEvent(), deviceStart_x, figure, LogicalColorBar::getCount(), getOrientation(), pColorPoint::getRealX(), pFigure::isPointInside(), pColorPoint::isTemporalColor(), lastNode_show, maxX_represented_Tshow, minX_represented_Tshow, movingNodePoint, movingPointIndex, RefreshForce(), pColorPoint::setRealX(), showedColorPoints, startNode_show, staticLimits, and viewingRange.
00141 { 00142 if(!event.LeftIsDown()) 00143 avaliablePointToMove = -1; 00144 00145 if (acceptedClick && activeState && _logicalBar->getCount()>0) 00146 { 00147 bool movedPoint = false; 00148 wxPoint point = event.GetPosition(); 00149 double realClicked = getOrientation() ? convertToRealValue(point.x) : convertToRealValue(point.y); 00150 bool rangeToMove = realClicked<=maxX_represented_Tshow && realClicked>=minX_represented_Tshow;//getOrientation() ? (point.x >=deviceStart_x && point.x<=bar_width+deviceStart_x-deviceEndMargin ) : ( point.y>=deviceStart_y && point.y<=bar_width+deviceStart_x-deviceEndMargin); 00151 if ( rangeToMove && acceptedClick && showedColorPoints.size()>0 ) 00152 { 00153 if ( movingPointIndex == -1 ) 00154 { 00155 startNode_show = showedColorPoints.front(); 00156 lastNode_show = showedColorPoints.back(); 00157 00158 //int numberEdges = figure->getNumberEdges(); // JPRx 00159 //wxPoint points [4]; // JPRx 00160 //int i=0; // JPRx 00161 int a; 00162 for (a=0; a<showedColorPoints.size() && movingPointIndex==-1 ; a++ ) 00163 { 00164 pColorPoint * nodePoint = showedColorPoints[a]; 00165 int point_pixelX = convertToPixelValue(nodePoint -> getRealX()); 00166 point_pixelX+= deviceStart_x; 00167 if ( getOrientation() ) 00168 movingPointIndex = (figure ->isPointInside (point_pixelX,point.x))? a : -1; 00169 else 00170 movingPointIndex = (figure ->isPointInside (point_pixelX,point.y))? a : -1; 00171 00172 if(movingPointIndex != -1) 00173 { 00174 movingNodePoint = nodePoint; 00175 if(avaliablePointToMove ==-1) 00176 avaliablePointToMove = movingPointIndex; 00177 } 00178 } 00179 } 00180 if (event.LeftIsDown() && movingNodePoint && movingPointIndex!=-1 && avaliablePointToMove==movingPointIndex) 00181 { 00182 bool hasPrevPoint = movingPointIndex > 0; 00183 bool hasNextPoint = movingPointIndex < showedColorPoints.size()-1; 00184 00185 pColorPoint * prevPoint = hasPrevPoint? showedColorPoints[movingPointIndex-1]: NULL; 00186 pColorPoint * nextPoint = hasNextPoint ? showedColorPoints[movingPointIndex+1]: NULL; 00187 00188 if ( hasPrevPoint && prevPoint!=NULL ) 00189 { 00190 if ( hasNextPoint && nextPoint!=NULL ) 00191 { 00192 double previousValue = prevPoint->getRealX(); 00193 double nextValue = nextPoint->getRealX(); 00194 movedPoint = prevPoint->isTemporalColor() ? 00195 ( nextPoint->isTemporalColor() ? (realClicked>=previousValue)&&(realClicked<=nextValue) : (realClicked>=previousValue)&&(realClicked<nextValue)) 00196 :(realClicked>previousValue)&&(realClicked<nextValue); 00197 if(!movedPoint) 00198 avaliablePointToMove = movingPointIndex; 00199 if(!movedPoint && realClicked<previousValue) 00200 { 00201 realClicked = previousValue+1; 00202 movedPoint = true; 00203 } 00204 else if(!movedPoint && realClicked>nextValue) 00205 { 00206 realClicked = nextValue-1; 00207 movedPoint = true; 00208 } 00209 } 00210 else 00211 { 00212 if ( !staticLimits ) 00213 { 00214 // Is the last point 00215 double previousValue = prevPoint->getRealX(); 00216 movedPoint = prevPoint->isTemporalColor() ? 00217 ( realClicked>=previousValue ) && ( realClicked<= maxX_represented_Tshow ) 00218 : ( realClicked>previousValue ) && ( realClicked<= maxX_represented_Tshow ); 00219 if(!movedPoint) 00220 avaliablePointToMove = movingPointIndex; 00221 if(!movedPoint && realClicked<previousValue) 00222 { 00223 realClicked = prevPoint->isTemporalColor()? previousValue: previousValue+1; 00224 movedPoint = true; 00225 } 00226 else if (!movedPoint && realClicked>=maxX_represented_Tshow) 00227 { 00228 realClicked = maxX_represented_Tshow; 00229 movedPoint = true; 00230 } 00231 } 00232 } 00233 } 00234 else 00235 { 00236 if ( hasNextPoint && nextPoint!=NULL ) 00237 { 00238 if ( !staticLimits ) 00239 { 00240 // Is the first point 00241 double nextValue = nextPoint->getRealX(); 00242 movedPoint = ( nextPoint->isTemporalColor() ? (realClicked<=nextValue) && ( realClicked>= minX_represented_Tshow ) 00243 :( realClicked<nextValue ) && ( realClicked>= minX_represented_Tshow )); 00244 00245 if(!movedPoint) 00246 avaliablePointToMove = movingPointIndex; 00247 if(!movedPoint && realClicked>nextValue) 00248 { 00249 realClicked = nextPoint->isTemporalColor() ? nextValue : nextValue-1; 00250 movedPoint = true; 00251 } 00252 else if (!movedPoint && realClicked<=minX_represented_Tshow) 00253 { 00254 realClicked = minX_represented_Tshow; 00255 movedPoint = true; 00256 } 00257 } 00258 } 00259 else 00260 { 00261 //Is the only point in the color bar 00262 movedPoint = ( realClicked<= maxX_represented_Tshow ) && ( realClicked>= minX_represented_Tshow ); 00263 if(!movedPoint) 00264 avaliablePointToMove = movingPointIndex; 00265 if (!movedPoint && realClicked<=minX_represented_Tshow) 00266 { 00267 realClicked = minX_represented_Tshow; 00268 movedPoint = true; 00269 } 00270 else if(!movedPoint && realClicked>=maxX_represented_Tshow) 00271 { 00272 realClicked = maxX_represented_Tshow; 00273 movedPoint = true; 00274 } 00275 } 00276 } 00277 if(viewingRange) 00278 { 00279 bool movingTempStart = movingNodePoint->getRealX() == startNode_show->getRealX() && movingNodePoint->isTemporalColor(); 00280 bool movingTempEnd = movingNodePoint->getRealX()== lastNode_show->getRealX() && movingNodePoint->isTemporalColor(); 00281 if( movingTempStart || movingTempEnd ) 00282 movedPoint = false; 00283 } 00284 } 00285 // Inform movedPoint event 00286 if ( movedPoint ) 00287 { 00288 movingNodePoint->setRealX ( realClicked ); 00289 RefreshForce();//Refresh to show the point is moved 00290 createAndSendEvent(wxEVT_MOVED_POINT); 00291 } 00292 else 00293 { 00294 movingPointIndex = -1; 00295 //Creating a general event of mouse move to actualize views 00296 createAndSendEvent( wxEVT_ON_COLOR_BAR ); 00297 } 00298 } 00299 else 00300 { 00301 movingPointIndex = -1; 00302 //Creating a general event of mouse move to actualize views 00303 createAndSendEvent( wxEVT_ON_COLOR_BAR ); 00304 } 00305 if ( movingPointIndex ==-1 ) 00306 { 00307 RefreshForce();//Refresh to show the point is not selected anymore 00308 } 00309 } 00310 }
void pColorBar::onPaint | ( | wxPaintEvent & | WXUNUSEDevent | ) |
Definition at line 322 of file pColorBar.cxx.
References bar_height, bar_width, colorBar_Bitmap, deviceEndMargin, deviceStart_x, deviceStart_y, getOrientation(), and repaintView().
00323 { 00324 repaintView(); 00325 if ( getOrientation() ) // HORIZONTAL 00326 { 00327 wxMemoryDC temp_dc; 00328 temp_dc.SelectObject( * colorBar_Bitmap ); 00329 wxPaintDC dc( this ); 00330 00331 // dc.Blit(deviceStart_x, deviceStart_y, bar_width+deviceStart_x, bar_height+deviceStart_y, &temp_dc, deviceStart_x, deviceStart_y); 00332 00333 dc.Blit(deviceStart_x, deviceStart_y, bar_width/*-deviceEndMargin*/, bar_height, &temp_dc, 0, 0); 00334 00335 // Bitmap for posible needed information to be shown 00336 /* 00337 temp_dc.SelectObject( * information_Bitmap ); 00338 dc.Blit(0,bar_height, width, height, &temp_dc, 0, height); 00339 */ 00340 } 00341 else 00342 { 00343 wxMemoryDC temp_dc; 00344 temp_dc.SelectObject( * colorBar_Bitmap ); 00345 wxPaintDC dc( this ); 00346 // dc.Blit(deviceStart_y,deviceStart_x, bar_height+deviceStart_y, bar_width+deviceStart_x, &temp_dc, deviceStart_y, deviceStart_x); 00347 00348 dc.Blit(deviceStart_y,deviceStart_x, bar_height, bar_width-deviceEndMargin, &temp_dc, 0, 0); 00349 // Bitmap for posible needed information to be shown 00350 /* 00351 temp_dc.SelectObject( * information_Bitmap ); 00352 dc.Blit(0,bar_width, height, width, &temp_dc, 0, width ); 00353 */ 00354 temp_dc.SelectObject(wxNullBitmap); 00355 } 00356 }
void pColorBar::onRectangles_Figure | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_RECTANGLES wxCommandEvent and changes the assigned figure to -rectangles- for the color points of the color bar. param & anEvent The wxCommandEvent actioned event
Definition at line 482 of file pColorBar.cxx.
References changeFigure(), changesMenu, cntID_RECTANGLES, cntID_TRIANGLES_DOWN, cntID_TRIANGLES_LEFT, cntID_TRIANGLES_RIGHT, cntID_TRIANGLES_UP, and RECTANGLE.
00483 { 00484 if( !changesMenu->IsChecked(cntID_TRIANGLES_RIGHT) ) 00485 { 00486 changeFigure (RECTANGLE);// RECTANGLE = 4 00487 changesMenu->Check (cntID_TRIANGLES_UP, false); 00488 changesMenu->Check (cntID_TRIANGLES_DOWN, false); 00489 changesMenu->Check (cntID_TRIANGLES_LEFT, false); 00490 changesMenu->Check (cntID_TRIANGLES_RIGHT, false); 00491 changesMenu->Check (cntID_RECTANGLES, true); 00492 } 00493 }
void pColorBar::onShowPopupMenu | ( | wxMouseEvent & | event | ) |
Shows the popup menu
Definition at line 568 of file pColorBar.cxx.
References activeState, bar_height, c_popmenu, cntID_DEL_COLOR_POINT, deviceStart_x, deviceStart_y, getOrientation(), RefreshForce(), setClickedX(), setClickedY(), and showedColorPoints.
00569 { 00570 if (activeState) 00571 { 00572 if(showedColorPoints.empty()) 00573 { 00574 c_popmenu.Enable(cntID_DEL_COLOR_POINT, false); 00575 } 00576 else 00577 { 00578 c_popmenu.Enable(cntID_DEL_COLOR_POINT, true); 00579 } 00580 bool setClickedValues = false; 00581 if( getOrientation() ) 00582 { 00583 setClickedValues = event.GetX()>=deviceStart_x && event.GetY()<= (bar_height + deviceStart_y); 00584 } 00585 else 00586 { 00587 setClickedValues = event.GetX()>=deviceStart_y && event.GetX()<= (bar_height+deviceStart_y) && event.GetY()>deviceStart_x; 00588 } 00589 if (setClickedValues) 00590 { 00591 setClickedX ( event.GetX() ); 00592 setClickedY ( event.GetY() ); 00593 RefreshForce(); 00594 PopupMenu( &c_popmenu, event.GetX(), event.GetY()); 00595 } 00596 } 00597 }
void pColorBar::OnSize | ( | wxSizeEvent & | WXUNUSEDevent | ) |
Definition at line 122 of file pColorBar.cxx.
References deviceEndMargin, getOrientation(), Refresh(), and setWidth().
00123 { 00124 wxRect rectTotal = GetClientRect(); 00125 if(getOrientation()) 00126 { 00127 setWidth( rectTotal.GetWidth() - deviceEndMargin ); 00128 } 00129 else 00130 { 00131 setWidth( rectTotal.GetHeight() - deviceEndMargin); 00132 } 00133 Refresh(); 00134 }
void pColorBar::onTrianglesDown_Figure | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_TRIANGLES_DOWN wxCommandEvent and changes the assigned figure to -triangles down- for the color points of the color bar. param & anEvent The wxCommandEvent actioned event
Definition at line 434 of file pColorBar.cxx.
References changeFigure(), changesMenu, cntID_RECTANGLES, cntID_TRIANGLES_DOWN, cntID_TRIANGLES_LEFT, cntID_TRIANGLES_RIGHT, and cntID_TRIANGLES_UP.
00435 { 00436 if( !changesMenu->IsChecked(cntID_TRIANGLES_DOWN) ) 00437 { 00438 changeFigure (-2); 00439 changesMenu->Check (cntID_TRIANGLES_UP, false); 00440 changesMenu->Check (cntID_TRIANGLES_DOWN, true); 00441 changesMenu->Check (cntID_TRIANGLES_LEFT, false); 00442 changesMenu->Check (cntID_TRIANGLES_RIGHT, false); 00443 changesMenu->Check (cntID_RECTANGLES, false); 00444 } 00445 }
void pColorBar::onTrianglesLeft_Figure | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_TRIANGLES_LEFT wxCommandEvent and changes the assigned figure to -triangles left- for the color points of the color bar. param & anEvent The wxCommandEvent actioned event
Definition at line 450 of file pColorBar.cxx.
References changeFigure(), changesMenu, cntID_RECTANGLES, cntID_TRIANGLES_DOWN, cntID_TRIANGLES_LEFT, cntID_TRIANGLES_RIGHT, and cntID_TRIANGLES_UP.
00451 { 00452 if( !changesMenu->IsChecked(cntID_TRIANGLES_LEFT) ) 00453 { 00454 changeFigure (-4); 00455 changesMenu->Check (cntID_TRIANGLES_UP, false); 00456 changesMenu->Check (cntID_TRIANGLES_DOWN, false); 00457 changesMenu->Check (cntID_TRIANGLES_LEFT, true); 00458 changesMenu->Check (cntID_TRIANGLES_RIGHT, false); 00459 changesMenu->Check (cntID_RECTANGLES, false); 00460 } 00461 }
void pColorBar::onTrianglesRight_Figure | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_TRIANGLES_RIGHT wxCommandEvent and changes the assigned figure to -triangles right- for the color points of the color bar. param & anEvent The wxCommandEvent actioned event
Definition at line 466 of file pColorBar.cxx.
References changeFigure(), changesMenu, cntID_RECTANGLES, cntID_TRIANGLES_DOWN, cntID_TRIANGLES_LEFT, cntID_TRIANGLES_RIGHT, and cntID_TRIANGLES_UP.
00467 { 00468 if( !changesMenu->IsChecked(cntID_TRIANGLES_RIGHT) ) 00469 { 00470 changeFigure (-6); 00471 changesMenu->Check (cntID_TRIANGLES_UP, false); 00472 changesMenu->Check (cntID_TRIANGLES_DOWN, false); 00473 changesMenu->Check (cntID_TRIANGLES_LEFT, false); 00474 changesMenu->Check (cntID_TRIANGLES_RIGHT, true); 00475 changesMenu->Check (cntID_RECTANGLES, false); 00476 } 00477 }
void pColorBar::onTrianglesUp_Figure | ( | wxCommandEvent & | anEvent | ) |
Reacts to the cntID_TRIANGLES_UP wxCommandEvent and changes the assigned figure to -triangles up- for the color points of the color bar. param & anEvent The wxCommandEvent actioned event
Definition at line 418 of file pColorBar.cxx.
References changeFigure(), changesMenu, cntID_RECTANGLES, cntID_TRIANGLES_DOWN, cntID_TRIANGLES_LEFT, cntID_TRIANGLES_RIGHT, and cntID_TRIANGLES_UP.
00419 { 00420 if( !changesMenu->IsChecked(cntID_TRIANGLES_UP) ) 00421 { 00422 changeFigure (-8); 00423 changesMenu->Check (cntID_TRIANGLES_UP, true); 00424 changesMenu->Check (cntID_TRIANGLES_DOWN, false); 00425 changesMenu->Check (cntID_TRIANGLES_LEFT, false); 00426 changesMenu->Check (cntID_TRIANGLES_RIGHT, false); 00427 changesMenu->Check (cntID_RECTANGLES, false); 00428 } 00429 }
void pColorBar::Refresh | ( | bool | eraseBackground = true , |
|
const wxRect * | rect = NULL | |||
) |
Definition at line 312 of file pColorBar.cxx.
Referenced by OnSize(), and RefreshForce().
00313 { 00314 wxScrolledWindow::Refresh(false); 00315 }
void pColorBar::RefreshForce | ( | ) |
Forces the refresh view of the color bar
Definition at line 898 of file pColorBar.cxx.
References Refresh().
Referenced by addColorPoint(), changeColor(), changeFigure(), deleteColorPoint(), onMouseMove(), onShowPopupMenu(), and setVisibleRange().
00899 { 00900 Refresh(false); 00901 }
void pColorBar::reinitiateColorBar | ( | double | minRealValue, | |
double | maxRealValue | |||
) |
Method that reinitiates attributes of the color bar to the given points param minRealValue The minimum represented value (real value) param maxRealValue The maximum represented value (real value)
Definition at line 607 of file pColorBar.cxx.
References _logicalBar, accumTemporalPoints, activeState, movingPointIndex, realX_vertical_line, setDegradeState(), setRepresentedValues(), showedColorPoints, and viewingRange.
Referenced by pPlotter::eraseColorPoints().
00608 { 00609 00610 _logicalBar -> clearPoints(); 00611 showedColorPoints.clear(); 00612 00613 movingPointIndex = -1; 00614 realX_vertical_line = -1; 00615 activeState = true; 00616 accumTemporalPoints = 0; 00617 viewingRange = false; 00618 setDegradeState(true); 00619 setRepresentedValues(minRealValue, maxRealValue); 00620 }
void pColorBar::reinitiateColorBarTo | ( | std::vector< pColorPoint * > | pointsVector | ) |
Method that reinitiates attributes of the color bar and set the points given by parameter param newPointsList Pointer to the list of the new points
Definition at line 626 of file pColorBar.cxx.
References _logicalBar, accumTemporalPoints, activeState, getMaxValue(), getMinValue(), movingPointIndex, realX_vertical_line, setDegradeState(), setRepresentedValues(), showedColorPoints, and viewingRange.
Referenced by pPlotter::onChangeFunction(), and pPlotter::setAll().
00627 { 00628 _logicalBar -> clearPoints(); 00629 _logicalBar -> setColorPoints(pointsVector); 00630 showedColorPoints.clear(); 00631 00632 movingPointIndex = -1; 00633 realX_vertical_line = -1; 00634 activeState = true; 00635 accumTemporalPoints = 0; 00636 viewingRange = false; 00637 setDegradeState(true); 00638 00639 double minRealValue = _logicalBar -> getMinValue(); 00640 double maxRealvalue = _logicalBar -> getMaxValue(); 00641 00642 setRepresentedValues(minRealValue, maxRealvalue); 00643 }
void pColorBar::repaintView | ( | ) |
Repaints the color bar in direction mode of the orientation assigned param createTempPoints True for creating temporal points for start and end when a visible range changes
Definition at line 755 of file pColorBar.cxx.
References _logicalBar, bar_height, bar_width, colorBar_Bitmap, colourParent, convertToPixelValue(), deviceEndMargin, doingDegrade, figure, pFigure::getNumberEdges(), getOrientation(), pFigure::getVertexPoints(), guideLineColor, pColorPoint::isTemporalColor(), movingNodePoint, movingPointIndex, realX_vertical_line, pFigure::setVertexPoints(), showedColorPoints, and updatePointsToDraw().
Referenced by onPaint().
00756 { 00757 wxMemoryDC temp_dc; 00758 temp_dc.SelectObject( * colorBar_Bitmap ); 00759 temp_dc.SetBrush(wxBrush( colourParent ,wxSOLID )); 00760 temp_dc.SetPen(wxPen( colourParent,1,wxSOLID )); 00761 if (getOrientation()) 00762 { 00763 temp_dc.DrawRectangle(0, 0, bar_width, bar_height); 00764 temp_dc.SetPen(wxPen( wxColour(167,165,191),1,wxSOLID )); 00765 temp_dc.DrawRectangle(0, 0, bar_width-deviceEndMargin, bar_height); 00766 } 00767 else 00768 { 00769 temp_dc.DrawRectangle(0, 0, bar_height, bar_width); 00770 temp_dc.SetPen(wxPen( wxColour(167,165,191),1,wxSOLID )); 00771 temp_dc.DrawRectangle(0, 0, bar_height, bar_width-deviceEndMargin); 00772 } 00773 //wxPoint figPoints[4]; // JPRx 00774 00775 if( _logicalBar -> getCount() >0) 00776 { 00777 updatePointsToDraw(); 00778 00779 int numberEdges = figure->getNumberEdges(); 00780 wxPoint points [4]; 00781 figure->getVertexPoints(points); 00782 figure ->setVertexPoints (points); 00783 00784 int maxValue = showedColorPoints.size(); 00785 pColorPoint * iniPoint; 00786 pColorPoint * endPoint; 00787 wxColor intialColor, finalColor; 00788 for (int a=0; a<maxValue; a++) 00789 { 00790 iniPoint = showedColorPoints[a]; 00791 int ini_pixelX = convertToPixelValue(iniPoint -> getRealX()); 00792 intialColor = iniPoint -> getColor(); 00793 00794 if( a<maxValue-1 ) 00795 { 00796 if( doingDegrade ) 00797 { 00798 endPoint = showedColorPoints[a+1]; 00799 int end_pixelX = convertToPixelValue(endPoint -> getRealX()); 00800 finalColor = endPoint -> getColor(); 00801 00802 int rectangle_width = end_pixelX - ini_pixelX; 00803 00804 //************************************************************************************* 00805 int initial_r = intialColor.Red(); 00806 int final_r = finalColor.Red() ; 00807 int initial_g = intialColor.Green(); 00808 int final_g= finalColor.Green(); 00809 int initial_b = intialColor.Blue(); 00810 int final_b= finalColor.Blue(); 00811 00812 float m_scope_r = (float)(final_r-initial_r)/rectangle_width; 00813 float m_scope_g = (float)(final_g-initial_g)/rectangle_width; 00814 float m_scope_b = (float)(final_b-initial_b)/rectangle_width; 00815 00816 int next_r = initial_r; 00817 int next_g = initial_g; 00818 int next_b = initial_b; 00819 00820 float nxt_r = (float)next_r; 00821 float nxt_g = (float)next_g; 00822 float nxt_b = (float)next_b; 00823 00824 for (int Xi =ini_pixelX; Xi<= end_pixelX; Xi++) 00825 { 00826 temp_dc.SetBrush(wxBrush( wxColour(next_r, next_g, next_b),wxSOLID )); 00827 temp_dc.SetPen(wxPen( wxColour(next_r, next_g, next_b),1,wxSOLID )); 00828 if( getOrientation() ) 00829 temp_dc.DrawLine(Xi, 0, Xi, bar_height); 00830 else 00831 temp_dc.DrawLine(0, Xi, bar_height, Xi); 00832 00833 nxt_r = (m_scope_r + nxt_r); 00834 nxt_g = (m_scope_g + nxt_g); 00835 nxt_b = (m_scope_b + nxt_b); 00836 00837 next_r = (int)(nxt_r); 00838 next_g = (int)(nxt_g); 00839 next_b = (int)(nxt_b); 00840 } 00841 } 00842 } 00843 if( movingPointIndex!=-1 && movingNodePoint!=NULL ) 00844 { 00845 if ( !(movingNodePoint -> isTemporalColor()) ) 00846 { 00847 if( movingNodePoint==iniPoint && movingPointIndex!=-1 ) 00848 { 00849 temp_dc.SetBrush(wxBrush( wxColour(5,36,180), wxSOLID )); 00850 temp_dc.SetPen(wxPen( wxColour(239,239,239), 1, wxSOLID )); 00851 if (getOrientation()) 00852 temp_dc.DrawPolygon(numberEdges, points, ini_pixelX, 0); 00853 else 00854 temp_dc.DrawPolygon(numberEdges, points, 0, ini_pixelX); 00855 } 00856 else 00857 { 00858 temp_dc.SetBrush(wxBrush( intialColor, wxSOLID )); 00859 if(iniPoint->isTemporalColor()) 00860 temp_dc.SetPen(wxPen( intialColor, 1, wxSOLID )); 00861 else 00862 temp_dc.SetPen(wxPen( wxColour(0,0,0), 1, wxSOLID )); 00863 if (getOrientation()) 00864 temp_dc.DrawPolygon(numberEdges, points, ini_pixelX, 0); 00865 else 00866 temp_dc.DrawPolygon(numberEdges, points, 0, ini_pixelX); 00867 } 00868 } 00869 } 00870 else 00871 { 00872 if ( !(iniPoint -> isTemporalColor()) ) 00873 { 00874 temp_dc.SetBrush(wxBrush( intialColor, wxSOLID )); 00875 temp_dc.SetPen(wxPen( wxColour(0,0,0), 1, wxSOLID )); 00876 if (getOrientation()) 00877 temp_dc.DrawPolygon(numberEdges, points, ini_pixelX, 0); 00878 else 00879 temp_dc.DrawPolygon(numberEdges, points, 0, ini_pixelX); 00880 } 00881 } 00882 } 00883 if (realX_vertical_line!=-1) 00884 { 00885 temp_dc.SetPen(wxPen( guideLineColor,1,wxDOT )); 00886 int pixelX_guide = convertToPixelValue(realX_vertical_line); 00887 if (getOrientation()) 00888 temp_dc.DrawLine(pixelX_guide, 0, pixelX_guide, bar_height); 00889 else 00890 temp_dc.DrawLine(0, pixelX_guide, bar_height, pixelX_guide); 00891 } 00892 } 00893 }
void pColorBar::setActiveStateTo | ( | bool | activeNow | ) |
Set active state param activeNow The new state
Definition at line 1278 of file pColorBar.cxx.
References activeState.
01279 { 01280 activeState = activeNow; 01281 }
void pColorBar::setBackGroundColour | ( | wxColour | theNwBackColor | ) |
Sets the background color param theNwBackColor The color to set to the colourParent
Definition at line 1367 of file pColorBar.cxx.
References colourParent.
01368 { 01369 colourParent = theNwBackColor; 01370 }
void pColorBar::setBarHeight | ( | int | _h | ) |
Sets the height of the containing rectangle bar param _h The height to set
Definition at line 1017 of file pColorBar.cxx.
References bar_height.
01018 { 01019 bar_height = _h; 01020 }
void pColorBar::setBarWidth | ( | int | _w | ) |
Sets the width of the containing rectangle bar param _w The width to set
Definition at line 1035 of file pColorBar.cxx.
References bar_width.
01036 { 01037 bar_width = _w; 01038 }
void pColorBar::setClickedX | ( | int | xCoordPixel | ) |
Sets the last clickedX pixel coord inside the bar. param xCoordPixel The x-coord value to set
Definition at line 1093 of file pColorBar.cxx.
References clickedX.
Referenced by onShowPopupMenu().
01094 { 01095 clickedX = xCoordPixel; 01096 }
void pColorBar::setClickedY | ( | int | yCoordPixel | ) |
Sets the last clickedY pixel coord inside the bar. param yCoordPixel The y-coord pixel value to set
Definition at line 1111 of file pColorBar.cxx.
References clickedY.
Referenced by onShowPopupMenu().
01112 { 01113 clickedY = yCoordPixel; 01114 }
void pColorBar::setDegradeState | ( | bool | newState | ) |
Sets the degrade state of the color bar param newState The degrade stare to set
Definition at line 1205 of file pColorBar.cxx.
References doingDegrade.
Referenced by onDegradeControl(), reinitiateColorBar(), and reinitiateColorBarTo().
01206 { 01207 doingDegrade = newState; 01208 }
void pColorBar::setDeviceBlitStart | ( | wxCoord | devStart_x, | |
wxCoord | devStart_y | |||
) |
Sets the device start drawing left-superior (pixel) start point and draws automatically the color bar param deviceStart_x Pixel start for x-coord param deviceStart_y Pixel start for y-coord
Definition at line 1255 of file pColorBar.cxx.
References deviceStart_x, deviceStart_y, drawColorBar(), getOrientation(), height, and width.
01256 { 01257 deviceStart_x = devStart_x; 01258 deviceStart_y = devStart_y; 01259 if (getOrientation()) 01260 width += deviceStart_x; 01261 else 01262 height += deviceStart_y; 01263 drawColorBar(true); 01264 }
void pColorBar::setDeviceEndMargin | ( | int | newDeviceEnd_pixels | ) |
Sets the new device (deviceEndMargin) value form the end of this panel to the end of the drawing area in the device param newDeviceEnd_pixels The new pixel value to asign to the right(horizontal view), underneath(vertical view) margin in pixels
Definition at line 1314 of file pColorBar.cxx.
References deviceEndMargin.
01315 { 01316 deviceEndMargin = newDeviceEnd_pixels; 01317 }
void pColorBar::setDeviceEndX | ( | int | newDeviceEnd_pixels | ) |
Sets the new device (deviceEndMargin) value form the end of this panel to the end of the drawing area in the device param newDeviceEnd_pixels The new pixel value to asign to the right margin in pixels
void pColorBar::setGapValues | ( | int | gap_x, | |
int | gap_y | |||
) |
void pColorBar::setGuideLineColour | ( | wxColour | theNwGuideLineColor | ) |
Sets the guide line color param theNwGuideLineColor The color to set to the guideLineColor
Definition at line 1349 of file pColorBar.cxx.
References guideLineColor.
01350 { 01351 guideLineColor = theNwGuideLineColor; 01352 }
void pColorBar::setHeight | ( | int | _h | ) |
Sets the height of the drawing bar area param _h The height to set
Definition at line 979 of file pColorBar.cxx.
References bar_height, gapY, and height.
00980 { 00981 height = _h; 00982 bar_height = height-gapY; 00983 }
void pColorBar::setOrientation | ( | bool | _orientation | ) |
Sets the orientation of the color bar param _orientation The orientation to set VERTICAL = false, HORIZONTAL = true
Definition at line 1053 of file pColorBar.cxx.
References _logicalBar, and figure.
01054 { 01055 _logicalBar -> setOrientation(_orientation); 01056 figure -> setBarOrientation (_orientation); 01057 }
void pColorBar::setPoints | ( | std::vector< pColorPoint * > | _points | ) |
Sets the collection of color points param _points The new points to set, each one of data type pColorPoint ( xValue, wxColour_assigned)
Definition at line 1072 of file pColorBar.cxx.
References _logicalBar, LogicalColorBar::clearPoints(), LogicalColorBar::setColorPoints(), and showedColorPoints.
01073 { 01074 _logicalBar->clearPoints(); 01075 showedColorPoints.clear(); 01076 _logicalBar->setColorPoints(_points); 01077 //posible needed to update 01078 }
void pColorBar::setRealX_vertical_line | ( | int | newReal_x | ) |
Sets the real-x value to draw a vertical line param realX_vertical_line The new real x value for the vertical line
Definition at line 1305 of file pColorBar.cxx.
References realX_vertical_line.
Referenced by pPlotter::onActualChange_Bar(), and pPlotter::onSelectionEnd().
01306 { 01307 realX_vertical_line = newReal_x; 01308 }
void pColorBar::setRepresentedValues | ( | double | minRealValue, | |
double | maxRealValue | |||
) |
Sets the represented minimum and maximunm values param minRealValue The minimum represented value (real value) param maxRealValue The maximum represented value (real value)
Definition at line 1164 of file pColorBar.cxx.
References _logicalBar, maxX_represented_Tshow, minX_represented_Tshow, LogicalColorBar::setMaxValue(), LogicalColorBar::setMinValue(), temporalMaxXToShow, and temporalMinXToShow.
Referenced by reinitiateColorBar(), and reinitiateColorBarTo().
01165 { 01166 temporalMinXToShow = (int)minRealValue; 01167 temporalMaxXToShow = (int)maxRealValue; 01168 01169 minX_represented_Tshow = (int)minRealValue; 01170 maxX_represented_Tshow = (int)maxRealValue; 01171 _logicalBar->setMinValue(minX_represented_Tshow); 01172 _logicalBar->setMaxValue(maxX_represented_Tshow); 01173 }
void pColorBar::setStaticLimitsTo | ( | bool | areStatic | ) |
Sets the state of static or not for the limit color points pamar areStatic Is the state to set for the limits
Definition at line 1236 of file pColorBar.cxx.
References staticLimits.
01237 { 01238 staticLimits = areStatic; 01239 }
void pColorBar::setVisibleRange | ( | int | minToShow, | |
int | maxToShow | |||
) |
Sets the visible range of the bar and repaints the bar according to it, the min value must be less than the max value. param minToShow Is the minimum value to show in the colorbar param maxToShow Is the maximum value to show in the colorbar
Definition at line 1224 of file pColorBar.cxx.
References maxX_represented_Tshow, minX_represented_Tshow, RefreshForce(), and viewingRange.
01225 { 01226 minX_represented_Tshow = minToShow; 01227 maxX_represented_Tshow = maxToShow; 01228 viewingRange = true; 01229 RefreshForce(); 01230 }
void pColorBar::setWidth | ( | int | _w | ) |
Sets the width of the drawing bar area param _w The width to set
Definition at line 998 of file pColorBar.cxx.
References bar_width, gapX, and width.
Referenced by drawColorBar(), and OnSize().
void pColorBar::updateExtremeColors | ( | ) |
Updates the colors of the first nonTemporal point in the list and the last nonTemporal point That logically corresponds always to the the first and last nodes of the color bar
void pColorBar::updatePointsToDraw | ( | ) |
Definition at line 1398 of file pColorBar.cxx.
References _logicalBar, accumTemporalPoints, convertToPixelValue(), LogicalColorBar::getCount(), getDataAt(), LogicalColorBar::getMaxAddedValue(), lastNode_show, maxX_represented_Tshow, minX_represented_Tshow, showedColorPoints, and startNode_show.
Referenced by repaintView().
01399 { 01400 accumTemporalPoints = 0; 01401 if (_logicalBar->getCount()>0) 01402 { 01403 showedColorPoints.clear(); 01404 01405 int startIndex, endIndex; 01406 _logicalBar -> getPointersToRangeLimits( showedColorPoints, startIndex, endIndex, minX_represented_Tshow, maxX_represented_Tshow ); 01407 01408 int internalCount = _logicalBar->getCount(); 01409 std::deque <pColorPoint*>::iterator iterStart = showedColorPoints.begin( ); 01410 std::deque <pColorPoint*>::iterator iterEnd = showedColorPoints.end( ); 01411 01412 int pixelTmpStart = convertToPixelValue (minX_represented_Tshow); 01413 int pixelTmpEnd = convertToPixelValue (maxX_represented_Tshow); 01414 int initial_r, final_r, initial_g, final_g, initial_b, final_b, rectangle_width; 01415 double realINI, realEND; 01416 01417 bool includeTempStart = false; 01418 bool includeTempEnd = false; 01419 //-----------------Adding the first visible point of the list 01420 if(showedColorPoints.size()>0) 01421 { 01422 includeTempStart = (int)(showedColorPoints.front()->getRealX())>minX_represented_Tshow ; 01423 includeTempEnd = (int)(showedColorPoints.back()->getRealX())<maxX_represented_Tshow ; 01424 if( startIndex >= 0 ) 01425 { 01426 if( startIndex == 0 ) 01427 { 01428 //The temporal showing point for the start should have the same color of the initial point in range at startIndex 01429 _logicalBar -> getDataAt( startIndex, realINI, initial_r, initial_g, initial_b ); 01430 realINI = minX_represented_Tshow; 01431 _logicalBar -> getDataAt( startIndex, realEND, final_r, final_g, final_b ); 01432 } 01433 else if( startIndex > 0 ) 01434 { 01435 _logicalBar -> getDataAt( startIndex-1, realINI, initial_r, initial_g, initial_b ); 01436 _logicalBar -> getDataAt( startIndex, realEND, final_r, final_g, final_b ); 01437 } 01438 01439 if( includeTempStart ) 01440 { 01441 int ini_pixelX = convertToPixelValue( realINI ); 01442 int end_pixelX = convertToPixelValue( realEND ); 01443 01444 rectangle_width = end_pixelX - ini_pixelX; 01445 01446 float m_scope_r = (float)(final_r-initial_r)/rectangle_width; 01447 float m_scope_g = (float)(final_g-initial_g)/rectangle_width; 01448 float m_scope_b = (float)(final_b-initial_b)/rectangle_width; 01449 01450 01451 float bRed = initial_r - m_scope_r*pixelTmpStart; 01452 float bGreen = initial_g - m_scope_g*pixelTmpStart; 01453 float bBlue = initial_b - m_scope_b*pixelTmpStart; 01454 01455 showedColorPoints.push_front( new pColorPoint ( minX_represented_Tshow, wxColour( (m_scope_r*pixelTmpStart)+bRed, (m_scope_g*pixelTmpStart)+bGreen, (m_scope_b*pixelTmpStart)+bBlue ), true)); 01456 01457 accumTemporalPoints ++; 01458 } 01459 } 01460 if( includeTempEnd && minX_represented_Tshow < maxX_represented_Tshow ) 01461 { 01462 if( internalCount>0 ) 01463 { 01464 if( endIndex == internalCount-1 ) 01465 { 01466 _logicalBar -> getDataAt( endIndex, realINI, initial_r, initial_g, initial_b ); 01467 _logicalBar -> getDataAt( endIndex, realEND, final_r, final_g, final_b ); 01468 realEND = maxX_represented_Tshow; 01469 } 01470 else 01471 { 01472 _logicalBar -> getDataAt( endIndex, realINI, initial_r, initial_g, initial_b ); 01473 _logicalBar -> getDataAt( endIndex+1, realEND, final_r, final_g, final_b ); 01474 } 01475 01476 int ini_pixelX = convertToPixelValue( realINI ); 01477 int end_pixelX = convertToPixelValue( realEND ); 01478 01479 rectangle_width = end_pixelX - ini_pixelX; 01480 01481 float m_scope_r = (float)(final_r-initial_r)/rectangle_width; 01482 float m_scope_g = (float)(final_g-initial_g)/rectangle_width; 01483 float m_scope_b = (float)(final_b-initial_b)/rectangle_width; 01484 01485 float bRed = initial_r - m_scope_r*pixelTmpEnd; 01486 float bGreen = initial_g - m_scope_g*pixelTmpEnd; 01487 float bBlue = initial_b - m_scope_b*pixelTmpEnd; 01488 showedColorPoints.push_back( new pColorPoint ( maxX_represented_Tshow, wxColour( ( m_scope_r*pixelTmpEnd)+bRed, (m_scope_g*pixelTmpEnd)+bGreen, (m_scope_b*pixelTmpEnd)+bBlue ), true)); 01489 accumTemporalPoints ++; 01490 } 01491 } 01492 } 01493 else 01494 { 01495 if(_logicalBar->getCount()>0) 01496 { 01497 if ( minX_represented_Tshow > _logicalBar->getMaxAddedValue() ) 01498 { 01499 endIndex = _logicalBar->getCount()-1; 01500 } 01501 else if ( maxX_represented_Tshow < _logicalBar->getMinAddedValue() ) 01502 { 01503 endIndex = 0; 01504 } 01505 01506 _logicalBar -> getDataAt( endIndex, realINI, initial_r, initial_g, initial_b ); 01507 _logicalBar -> getDataAt( endIndex, realEND, final_r, final_g, final_b ); 01508 01509 realINI = minX_represented_Tshow; 01510 realEND = maxX_represented_Tshow; 01511 01512 showedColorPoints.push_back( new pColorPoint ( realINI, wxColour( initial_r, initial_g, initial_b ), true)); 01513 accumTemporalPoints ++; 01514 showedColorPoints.push_back( new pColorPoint ( realEND, wxColour( initial_r, initial_g, initial_b ), true)); 01515 accumTemporalPoints ++; 01516 } 01517 } 01518 } 01519 01520 if ( !showedColorPoints.empty() ) 01521 { 01522 startNode_show = showedColorPoints.front(); 01523 lastNode_show = showedColorPoints.back(); 01524 } 01525 }
LogicalColorBar* pColorBar::_logicalBar [private] |
Definition at line 559 of file pColorBar.h.
Referenced by addColorPoint(), deleteColorPoint(), getAddedColorsPointsList(), getColorPointsSize(), getDataAt(), getOrientation(), onMouseMove(), reinitiateColorBar(), reinitiateColorBarTo(), repaintView(), setOrientation(), setPoints(), setRepresentedValues(), and updatePointsToDraw().
bool pColorBar::acceptedClick [private] |
Definition at line 554 of file pColorBar.h.
Referenced by onLeftClicDown(), onLeftClickUp(), and onMouseMove().
int pColorBar::accumTemporalPoints [private] |
Indicates the amount of temporal initial color points
Definition at line 637 of file pColorBar.h.
Referenced by reinitiateColorBar(), reinitiateColorBarTo(), and updatePointsToDraw().
bool pColorBar::activeState [private] |
Represents the active state of the bar
Definition at line 725 of file pColorBar.h.
Referenced by isActive(), onLeftButtonDClick(), onMouseMove(), onShowPopupMenu(), reinitiateColorBar(), reinitiateColorBarTo(), and setActiveStateTo().
int pColorBar::avaliablePointToMove [private] |
Definition at line 727 of file pColorBar.h.
Referenced by onMouseMove().
int pColorBar::bar_height [private] |
Definition at line 582 of file pColorBar.h.
Referenced by drawColorBar(), getBarHeight(), onLeftButtonDClick(), onPaint(), onShowPopupMenu(), repaintView(), setBarHeight(), and setHeight().
int pColorBar::bar_width [private] |
Definition at line 587 of file pColorBar.h.
Referenced by convertToPixelValue(), convertToRealValue(), drawColorBar(), getBarWidth(), onPaint(), repaintView(), setBarWidth(), and setWidth().
wxMenu pColorBar::c_popmenu [private] |
Definition at line 747 of file pColorBar.h.
Referenced by onDegradeControl(), and onShowPopupMenu().
wxMenu* pColorBar::changesMenu [private] |
Definition at line 751 of file pColorBar.h.
Referenced by onRectangles_Figure(), onTrianglesDown_Figure(), onTrianglesLeft_Figure(), onTrianglesRight_Figure(), and onTrianglesUp_Figure().
int pColorBar::clickedX [private] |
Represents the last clickedX coord inside the bar.
Definition at line 651 of file pColorBar.h.
Referenced by getClickedX(), onAddColorPoint(), onChangeColourSelectedPoint(), onDeleteColorPoint(), and setClickedX().
int pColorBar::clickedY [private] |
Definition at line 656 of file pColorBar.h.
Referenced by getClickedY(), onAddColorPoint(), onChangeColourSelectedPoint(), onDeleteColorPoint(), and setClickedY().
wxBitmap* pColorBar::colorBar_Bitmap [private] |
Is the bitmap for the bar color
Definition at line 683 of file pColorBar.h.
Referenced by drawColorBar(), onPaint(), and repaintView().
wxColour pColorBar::colourParent [private] |
Definition at line 742 of file pColorBar.h.
Referenced by getBackGroundColour(), repaintView(), and setBackGroundColour().
wxCoord pColorBar::deviceEnd_y [private] |
Y-Coord for left-superior device margin, important for vertical view
Definition at line 721 of file pColorBar.h.
wxCoord pColorBar::deviceEndMargin [private] |
Definition at line 716 of file pColorBar.h.
Referenced by convertToPixelValue(), convertToRealValue(), drawColorBar(), onPaint(), OnSize(), repaintView(), and setDeviceEndMargin().
wxCoord pColorBar::deviceStart_x [private] |
X-Coord for left-superior device visible drawing
Definition at line 706 of file pColorBar.h.
Referenced by convertToRealValue(), onLeftButtonDClick(), onMouseMove(), onPaint(), onShowPopupMenu(), and setDeviceBlitStart().
wxCoord pColorBar::deviceStart_y [private] |
Y-Coord for left-superior device visible drawing
Definition at line 711 of file pColorBar.h.
Referenced by onLeftButtonDClick(), onPaint(), onShowPopupMenu(), and setDeviceBlitStart().
bool pColorBar::doingDegrade [private] |
Represents the state of doing or not the degrade in the bar (default value true for doing degrade)
Definition at line 691 of file pColorBar.h.
Referenced by getDegradeState(), repaintView(), and setDegradeState().
pFigure* pColorBar::figure [private] |
Is the constant that represents the figure number of edges (TRIANGLE | RECTANGLE)
Definition at line 647 of file pColorBar.h.
Referenced by changeColor(), changeFigure(), changePointsFigure_Edges(), deleteColorPoint(), getPointsFigure_Edges(), onMouseMove(), repaintView(), and setOrientation().
int pColorBar::gapX [private] |
Definition at line 564 of file pColorBar.h.
Referenced by setGapValues(), and setWidth().
int pColorBar::gapY [private] |
Definition at line 569 of file pColorBar.h.
Referenced by setGapValues(), and setHeight().
wxColour pColorBar::guideLineColor [private] |
Represents the color of the dot-line use as guides. The default color is RED.
Definition at line 737 of file pColorBar.h.
Referenced by getGuideLineColour(), repaintView(), and setGuideLineColour().
int pColorBar::height [private] |
Definition at line 573 of file pColorBar.h.
Referenced by drawColorBar(), getHeight(), setDeviceBlitStart(), and setHeight().
wxBitmap* pColorBar::information_Bitmap [private] |
Is the bitmap of the information associated to the bar color
Definition at line 687 of file pColorBar.h.
pColorPoint* pColorBar::lastNode_show [private] |
Indicates the last node to show
Definition at line 632 of file pColorBar.h.
Referenced by onMouseMove(), and updatePointsToDraw().
bool pColorBar::maxFound [private] |
Represents that the maximum value for the visible range has been found in the original color points
Definition at line 701 of file pColorBar.h.
int pColorBar::maxX_represented_Tshow [private] |
The maximum represented real value used for calculating the scaling for point by the rule real_x = (x_pixel * (maxX_represented_Tshow_Tshow - minXRepresented_Tshow) ) / bar_width
Definition at line 612 of file pColorBar.h.
Referenced by convertToPixelValue(), convertToRealValue(), getMaxValue(), onMouseMove(), setRepresentedValues(), setVisibleRange(), and updatePointsToDraw().
bool pColorBar::minFound [private] |
Represents that the minimum value for the visible range has been found in the original color points
Definition at line 696 of file pColorBar.h.
int pColorBar::minX_represented_Tshow [private] |
Definition at line 607 of file pColorBar.h.
Referenced by convertToPixelValue(), convertToRealValue(), getMinValue(), onMouseMove(), setRepresentedValues(), setVisibleRange(), and updatePointsToDraw().
pColorPoint* pColorBar::movingNodePoint [private] |
Indicates the last node moving in the coloPoints list
Definition at line 676 of file pColorBar.h.
Referenced by getLastMovedColorPoint(), onMouseMove(), and repaintView().
int pColorBar::movingPointIndex [private] |
Represents the movind index of the last moving point in the colorPoints list
Definition at line 661 of file pColorBar.h.
Referenced by deleteColorPoint(), onLeftClickUp(), onMouseMove(), reinitiateColorBar(), reinitiateColorBarTo(), and repaintView().
bool pColorBar::okSelectedColor [private] |
Indicates if in the last colour selection the ok button was clicked
Definition at line 666 of file pColorBar.h.
Referenced by changeColor(), getSelectedColour(), onAddColorPoint(), and onLeftButtonDClick().
int pColorBar::points_orientation [private] |
Definition at line 602 of file pColorBar.h.
int pColorBar::realX_vertical_line [private] |
Represents the real-x value to draw a vertical line
Definition at line 732 of file pColorBar.h.
Referenced by getRealX_vertical_line(), reinitiateColorBar(), reinitiateColorBarTo(), repaintView(), and setRealX_vertical_line().
std::deque<pColorPoint *> pColorBar::showedColorPoints [private] |
Definition at line 592 of file pColorBar.h.
Referenced by changeColor(), deleteColorPoint(), getPointsListWithTemps(), onMouseMove(), onShowPopupMenu(), reinitiateColorBar(), reinitiateColorBarTo(), repaintView(), setPoints(), and updatePointsToDraw().
pColorPoint* pColorBar::startNode_show [private] |
Indicates the first node to show
Definition at line 627 of file pColorBar.h.
Referenced by onMouseMove(), and updatePointsToDraw().
bool pColorBar::staticLimits [private] |
Represents the statc or movable state of limit start and end color points, default value true for static
Definition at line 671 of file pColorBar.h.
Referenced by getStaticLimits(), onMouseMove(), and setStaticLimitsTo().
int pColorBar::temporalMaxXToShow [private] |
Definition at line 622 of file pColorBar.h.
Referenced by setRepresentedValues().
int pColorBar::temporalMinXToShow [private] |
The minimum represented real value used for calculating the scaling for point by the rule real_x = (x_pixel * (maxX_represented_Tshow_Tshow - minX_represented_Tshow) ) / bar_width
Definition at line 617 of file pColorBar.h.
Referenced by setRepresentedValues().
bool pColorBar::viewingRange [private] |
Represents the state of viewing a range
Definition at line 642 of file pColorBar.h.
Referenced by onMouseMove(), reinitiateColorBar(), reinitiateColorBarTo(), and setVisibleRange().
int pColorBar::width [private] |
Definition at line 577 of file pColorBar.h.
Referenced by drawColorBar(), getWidth(), setDeviceBlitStart(), and setWidth().