Move SoDatumLabel from Sketcher to Core so that it can be reused anywhere.
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "PropertyConstraintListItem.h"
|
||||
#include "SketcherSettings.h"
|
||||
#include "SoDatumLabel.h"
|
||||
#include "SoZoomTranslation.h"
|
||||
#include "ViewProviderPython.h"
|
||||
#include "ViewProviderSketch.h"
|
||||
@@ -125,7 +124,6 @@ PyMOD_INIT_FUNC(SketcherGui)
|
||||
SketcherGui::ViewProviderPython ::init();
|
||||
SketcherGui::ViewProviderCustom ::init();
|
||||
SketcherGui::ViewProviderCustomPython ::init();
|
||||
SketcherGui::SoDatumLabel ::initClass();
|
||||
SketcherGui::SoZoomTranslation ::initClass();
|
||||
SketcherGui::PropertyConstraintListItem ::init();
|
||||
SketcherGui::ViewProviderSketchGeometryExtension ::init();
|
||||
|
||||
@@ -87,8 +87,6 @@ SET(SketcherGui_SRCS
|
||||
PreCompiled.h
|
||||
SoZoomTranslation.cpp
|
||||
SoZoomTranslation.h
|
||||
SoDatumLabel.cpp
|
||||
SoDatumLabel.h
|
||||
PropertyConstraintListItem.h
|
||||
PropertyConstraintListItem.cpp
|
||||
TaskSketcherConstraints.ui
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <Gui/Tools.h>
|
||||
#include <Gui/Utilities.h>
|
||||
#include <Gui/Inventor/SmSwitchboard.h>
|
||||
#include <Gui/SoDatumLabel.h>
|
||||
#include <Mod/Part/App/Geometry.h>
|
||||
#include <Mod/Sketcher/App/GeometryFacade.h>
|
||||
#include <Mod/Sketcher/App/SolverGeometryExtension.h>
|
||||
@@ -58,13 +59,13 @@
|
||||
#include <Mod/Sketcher/App/GeoList.h>
|
||||
|
||||
#include "EditModeConstraintCoinManager.h"
|
||||
#include "SoDatumLabel.h"
|
||||
#include "SoZoomTranslation.h"
|
||||
#include "ViewProviderSketch.h"
|
||||
#include "ViewProviderSketchCoinAttorney.h"
|
||||
#include "Utils.h"
|
||||
|
||||
|
||||
using namespace Gui;
|
||||
using namespace SketcherGui;
|
||||
using namespace Sketcher;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,102 +0,0 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011-2012 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SKETCHERGUI_SODATUMLABEL_H
|
||||
#define SKETCHERGUI_SODATUMLABEL_H
|
||||
|
||||
#include <Inventor/SbBox3f.h>
|
||||
#include <Inventor/fields/SoSFColor.h>
|
||||
#include <Inventor/fields/SoSFEnum.h>
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFImage.h>
|
||||
#include <Inventor/fields/SoSFInt32.h>
|
||||
#include <Inventor/fields/SoSFName.h>
|
||||
#include <Inventor/fields/SoSFVec3f.h>
|
||||
#include <Inventor/fields/SoMFString.h>
|
||||
#include <Inventor/fields/SoMFVec3f.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
#include <Mod/Sketcher/SketcherGlobal.h>
|
||||
|
||||
|
||||
namespace SketcherGui {
|
||||
|
||||
class SketcherGuiExport SoDatumLabel : public SoShape {
|
||||
using inherited = SoShape;
|
||||
|
||||
SO_NODE_HEADER(SoDatumLabel);
|
||||
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
ANGLE,
|
||||
DISTANCE,
|
||||
DISTANCEX,
|
||||
DISTANCEY,
|
||||
RADIUS,
|
||||
DIAMETER,
|
||||
SYMMETRIC
|
||||
};
|
||||
|
||||
static void initClass();
|
||||
SoDatumLabel();
|
||||
|
||||
SoMFString string;
|
||||
SoSFColor textColor;
|
||||
SoSFEnum datumtype;
|
||||
SoSFName name;
|
||||
SoSFInt32 size;
|
||||
SoSFFloat param1;
|
||||
SoSFFloat param2;
|
||||
SoSFFloat param3;
|
||||
SoMFVec3f pnts;
|
||||
SoSFVec3f norm;
|
||||
SoSFImage image;
|
||||
SoSFFloat lineWidth;
|
||||
bool useAntialiasing;
|
||||
|
||||
protected:
|
||||
~SoDatumLabel() override {}
|
||||
void GLRender(SoGLRenderAction *action) override;
|
||||
void computeBBox(SoAction *, SbBox3f &box, SbVec3f ¢er) override;
|
||||
void generatePrimitives(SoAction * action) override;
|
||||
void notify(SoNotList * l) override;
|
||||
|
||||
private:
|
||||
float getScaleFactor(SoState*) const;
|
||||
void generateDistancePrimitives(SoAction * action, const SbVec3f&, const SbVec3f&);
|
||||
void generateDiameterPrimitives(SoAction * action, const SbVec3f&, const SbVec3f&);
|
||||
void generateAnglePrimitives(SoAction * action, const SbVec3f&);
|
||||
void generateSymmetricPrimitives(SoAction * action, const SbVec3f&, const SbVec3f&);
|
||||
|
||||
private:
|
||||
void drawImage();
|
||||
SbBox3f bbox;
|
||||
float imgWidth;
|
||||
float imgHeight;
|
||||
bool glimagevalid;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // SKETCHERGUI_SODATUMLABEL_H
|
||||
Reference in New Issue
Block a user