| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2017 Kustaa Nyholm <[email protected]> * |
| 3 |
* * |
| 4 |
* This file is part of the FreeCAD CAx development system. * |
| 5 |
* * |
| 6 |
* This library is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Library General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 |
* GNU Library General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Library General Public * |
| 17 |
* License along with this library; see the file COPYING.LIB. If not, * |
| 18 |
* write to the Free Software Foundation, Inc., 59 Temple Place, * |
| 19 |
* Suite 330, Boston, MA 02111-1307, USA * |
| 20 |
* * |
| 21 |
***************************************************************************/ |
| 22 |
|
| 23 |
#ifndef SRC_GUI_NAVICUBE_H_ |
| 24 |
#define SRC_GUI_NAVICUBE_H_ |
| 25 |
|
| 26 |
#include <CXX/Extensions.hxx> |
| 27 |
#include <QColor> |
| 28 |
#include <FCGlobal.h> |
| 29 |
|
| 30 |
class SoEvent; |
| 31 |
|
| 32 |
namespace Gui |
| 33 |
{ |
| 34 |
class View3DInventorViewer; |
| 35 |
} |
| 36 |
|
| 37 |
class NaviCubeImplementation; |
| 38 |
|
| 39 |
class GuiExport NaviCube |
| 40 |
{ |
| 41 |
public: |
| 42 |
enum Corner |
| 43 |
{ |
| 44 |
TopLeftCorner, |
| 45 |
TopRightCorner, |
| 46 |
BottomLeftCorner, |
| 47 |
BottomRightCorner |
| 48 |
}; |
| 49 |
NaviCube(Gui::View3DInventorViewer* viewer); |
| 50 |
virtual ~NaviCube(); |
| 51 |
void drawNaviCube(); |
| 52 |
void createContextMenu(const std::vector<std::string>& cmd); |
| 53 |
bool processSoEvent(const SoEvent* ev); |
| 54 |
void setCorner(Corner); |
| 55 |
void setOffset(int x, int y); |
| 56 |
bool isDraggable(); |
| 57 |
void updateColors(); |
| 58 |
void setDraggable(bool draggable); |
| 59 |
void setSize(int size); |
| 60 |
void setChamfer(float size); |
| 61 |
void setNaviRotateToNearest(bool toNearest); |
| 62 |
void setNaviStepByTurn(int steps); |
| 63 |
void setFont(std::string font); |
| 64 |
void setFontWeight(int weight); |
| 65 |
void setFontStretch(int stretch); |
| 66 |
void setFontZoom(float zoom); |
| 67 |
void setBaseColor(QColor TextColor); |
| 68 |
void setEmphaseColor(QColor ButtonColor); |
| 69 |
void setHiliteColor(QColor HiliteColor); |
| 70 |
void setBorderWidth(double BorderWidth); |
| 71 |
void setShowCS(bool showCS); |
| 72 |
void setInactiveOpacity(float opacity); |
| 73 |
// Label order: front, top, right, rear, bottom, left |
| 74 |
void setNaviCubeLabels(const std::vector<std::string>& labels); |
| 75 |
static void setNaviCubeCommands(const std::vector<std::string>& cmd); |
| 76 |
static int getNaviCubeSize(); |
| 77 |
|
| 78 |
private: |
| 79 |
NaviCubeImplementation* m_NaviCubeImplementation; |
| 80 |
}; |
| 81 |
|
| 82 |
#endif /* SRC_GUI_NAVICUBE_H_ */ |