| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2015 Alexander Golubev (Fat-Zer) <[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 VIEWPROVIDEDATUM_H_BYJRZNDL |
| 24 |
#define VIEWPROVIDEDATUM_H_BYJRZNDL |
| 25 |
|
| 26 |
#include "ViewProviderGeometryObject.h" |
| 27 |
|
| 28 |
class SoScale; |
| 29 |
|
| 30 |
namespace Gui |
| 31 |
{ |
| 32 |
|
| 33 |
class SoShapeScale; |
| 34 |
|
| 35 |
/** |
| 36 |
* View provider associated with an App::DatumElement. |
| 37 |
*/ |
| 38 |
class GuiExport ViewProviderDatum: public ViewProviderGeometryObject |
| 39 |
{ |
| 40 |
PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderDatum); |
| 41 |
|
| 42 |
public: |
| 43 |
ViewProviderDatum(); |
| 44 |
~ViewProviderDatum() override; |
| 45 |
|
| 46 |
/// Get point derived classes will add their specific stuff |
| 47 |
SoSeparator* getDatumRoot() const |
| 48 |
{ |
| 49 |
return pRoot; |
| 50 |
} |
| 51 |
|
| 52 |
void attach(App::DocumentObject*) override; |
| 53 |
std::vector<std::string> getDisplayModes() const override; |
| 54 |
void setDisplayMode(const char* ModeName) override; |
| 55 |
|
| 56 |
/// @name Suppress ViewProviderGeometryObject's behaviour |
| 57 |
///@{ |
| 58 |
bool setEdit(int) override |
| 59 |
{ |
| 60 |
return false; |
| 61 |
} |
| 62 |
void unsetEdit(int) override |
| 63 |
{} |
| 64 |
///@} |
| 65 |
|
| 66 |
void setTemporaryScale(double factor); |
| 67 |
void resetTemporarySize(); |
| 68 |
|
| 69 |
protected: |
| 70 |
void onChanged(const App::Property* prop) override; |
| 71 |
bool onDelete(const std::vector<std::string>&) override; |
| 72 |
|
| 73 |
protected: |
| 74 |
SoSeparator* pRoot; |
| 75 |
SoShapeScale* soScale; |
| 76 |
double lineThickness; |
| 77 |
}; |
| 78 |
|
| 79 |
} // namespace Gui |
| 80 |
|
| 81 |
#endif /* end of include guard: VIEWPROVIDEDATUM_H_BYJRZNDL */ |