Forráskód Böngészése

bugfix:删除草绘功能

wzj 11 hónapja
szülő
commit
37c6ced991

+ 0 - 61
src/Geometry/geometryData.cpp

@@ -85,11 +85,6 @@ namespace Geometry
 		return ishas;
 	}
 
-	// 	void GeometryData::removeDatumPlaneByIndex(int index)
-	// 	{
-	// 		_geomtretryDatumList.removeAt(index);
-	// 	}
-
 	void GeometryData::removeGeometryDatum(GeometryDatum *plane)
 	{
 		if (_geomtretryDatumList.contains(plane))
@@ -98,7 +93,6 @@ namespace Geometry
 
 	void GeometryData::setVisable(int index, bool visable)
 	{
-		// assert(index >= 0 && index < _geometryList.size());
 		if (index >= 0 && index < _geometryList.size())
 		{
 			_geometryList[index]->setVisible(visable);
@@ -263,19 +257,6 @@ namespace Geometry
 		return b;
 	}
 
-	void GeometryData::setSketchPlane(double *loc, double *dir)
-	{
-		if (_sketchPlan == nullptr)
-			_sketchPlan = new gp_Ax3;
-		_sketchPlan->SetAxis(gp_Ax1(gp_Pnt(loc[0], loc[1], loc[2]), gp_Dir(1.00001, 0.00001, 0))); //向量修改有崩溃风险  OCC bug
-		_sketchPlan->SetDirection(gp_Dir(dir[0], dir[1], dir[2]));
-	}
-
-	gp_Ax3 *GeometryData::getSketchPlane()
-	{
-		return _sketchPlan;
-	}
-
 	void GeometryData::replaceSet(GeometrySet *newset, GeometrySet *oldset)
 	{
 		const int index = _geometryList.indexOf(oldset);
@@ -329,48 +310,6 @@ namespace Geometry
 		return _geoCpList.removeOne(gc);
 	}
 
-	/*void GeometryData::generateMeshAndWriteToXML(QDomDocument& doc, QDomElement& parent)
-	{
-		QMultiHash<int, int> Surface, Body;
-		for (GeoComponent* gc : _geoCpList)
-		{
-			QMultiHash<Geometry::GeometrySet*, int> items = gc->getSelectedItems();
-			QHashIterator<GeometrySet*, int> it(items);
-			while (it.hasNext())
-			{
-				it.next();
-				int ID = it.key()->getID();
-				int index = it.value();
-				if (gc->getGCType() == GeoComponentType::Surface)
-					Surface.insert(ID, index);
-				else if (gc->getGCType() == GeoComponentType::Body)
-					Body.insert(ID, index);
-			}
-		}
-
-		Gmsh::GMshPara* para = new Gmsh::GMshPara;
-		para->_solidHash = Body;
-		para->_surfaceHash = Surface;
-		para->_elementType = "Tet";
-		para->_method = 1;
-		para->_dim = 3;
-		para->_elementOrder = 1;
-		para->_sizeFactor = 1.00;
-		para->_maxSize = 100.00;
-		para->_minSize = 0.00;
-		para->_isGridCoplanar = true;
-		para->_geoclean = true;
-
-		Setting::BusAPI::instance();
-
-		Gmsh::GmshModule* gModule = Gmsh::GmshModule::getInstance(mw);
-		Gmsh::GmshThread* thread = gModule->iniGmshThread(para);
-		thread->setSolveFileInfo(&doc, &parent, path);
-		auto processBar = new ModuleBase::ProcessBar(mw, QObject::tr("Gmsh Working..."));
-		Gmsh::GmshThreadManager* manager = gModule->getGmshThreadManager();
-		manager->insertThread(processBar, thread);
-	}*/
-
 	bool compareSet(DataProperty::DataBase *s1, DataProperty::DataBase *s2)
 	{
 		int id1 = s1->getID();

+ 0 - 15
src/Geometry/geometryData.h

@@ -156,19 +156,6 @@ namespace Geometry
 		QDomElement &writeToProjectFile(QDomDocument *doc, QDomElement *element, bool isdiso = false);
 		//从工程文件读入数据
 		void readFromProjectFile(QDomNodeList *nodelist, bool isdiso = false);
-		/**
-		 * @brief 设置草绘平面
-		 * @param loc 草绘平面的坐标原点
-		 * @param dir 草绘平面的方向向量
-		 * @since 2.5.0
-		 */
-		void setSketchPlane(double *loc, double *dir);
-		/**
-		 * @brief 获取草绘平面
-		 * @return gp_Ax3* 返回草绘平面
-		 * @since 2.5.0
-		 */
-		gp_Ax3 *getSketchPlane();
 		/**
 		 * @brief 添加几何组件
 		 * @since 2.5.0
@@ -204,8 +191,6 @@ namespace Geometry
 		 * @since 2.5.0
 		 */
 		bool removeGeoComponent(GeoComponent *);
-		//对所有几何组件进行剖分,然后生成网格并写入XML中
-		// void generateMeshAndWriteToXML(QDomDocument& doc, QDomElement& parent);
 
 	private:
 		/**

+ 0 - 72
src/GeometryCommand/GeoCommandSketchArc.cpp

@@ -1,72 +0,0 @@
-#include "GeoCommandSketchArc.h"
-#include <gp_Pnt.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakePolygon.hxx>
-#include <TopoDS_Edge.hxx>
-#include "Geometry/geometrySet.h"
-#include "Geometry/geometryData.h"
-#include <GC_MakeArcOfCircle.hxx>
-#include <Geom_Circle.hxx>
-#include <GC_MakeCircle.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
-#include <gp_Lin.hxx>
-
-namespace Command
-{
-	GeoCommanSketchArc::GeoCommanSketchArc(MainWidget::SketchViewProvider *v, GUI::MainWindow *m, MainWidget::PreWindow *p)
-		: GeocommandSketchBase(v, p, m)
-	{
-	}
-
-	bool GeoCommanSketchArc::execute()
-	{
-		if (_pointList.size() != 3)
-			return false;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _pointList[1];
-		gp_Pnt pt3 = _pointList[2];
-		gp_Lin lin(pt1, gp_Dir(pt2.X() - pt1.X(), pt2.Y() - pt1.Y(), pt2.Z() - pt1.Z()));
-		if (lin.Distance(pt3) == 0)
-			return false;
-
-		for (int i = 0; i <= _pointList.size() - 1; ++i)
-		{
-			for (int j = 0; j < i; ++j)
-				if (_pointList[i].Distance(_pointList[j]) < 1e-6)
-					return false;
-		}
-
-		Handle(Geom_TrimmedCurve) tc = GC_MakeArcOfCircle(pt1, pt2, pt3);
-		TopoDS_Edge makeArc = BRepBuilderAPI_MakeEdge(tc);
-
-		Handle(Geom_Circle) c = GC_MakeCircle(pt1, pt2, pt3);
-		gp_Pnt center = c->Location();
-		TopoDS_Vertex centerVer = BRepBuilderAPI_MakeVertex(center);
-
-		TopoDS_Compound aRes;
-		BRep_Builder aBuilder;
-		aBuilder.MakeCompound(aRes);
-		aBuilder.Add(aRes, makeArc);
-		aBuilder.Add(aRes, centerVer);
-
-		if (makeArc.IsNull())
-			return false;
-		_resShape = new TopoDS_Shape;
-		*_resShape = aRes;
-		emit showSketch(_resShape);
-		return GeoCommandBase::execute();
-	}
-
-	void GeoCommanSketchArc::undo()
-	{
-		emit removeSketch(_resShape);
-	}
-
-	void GeoCommanSketchArc::redo()
-	{
-		emit showSketch(_resShape);
-	}
-}

+ 0 - 27
src/GeometryCommand/GeoCommandSketchArc.h

@@ -1,27 +0,0 @@
-#ifndef GEOCOMMANDSKETCHARC_H_
-#define GEOCOMMANDSKETCHARC_H_
-
-#include "GeoCommandSketchBase.h"
-
-class gp_Pnt;
-//class gp_Dir;
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommanSketchArc : public GeocommandSketchBase
-	{
-	public:
-		GeoCommanSketchArc(MainWidget::SketchViewProvider* view, GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommanSketchArc() = default;
-
-		bool execute()override;
-		void undo() override;
-		void redo() override;
-	
-	private:
-
-	};
-
-
-}
-
-#endif

+ 0 - 35
src/GeometryCommand/GeoCommandSketchBase.cpp

@@ -1,35 +0,0 @@
-#include "GeoCommandSketchBase.h"
-#include "MainWidgets/sketchViewProvider.h"
-#include <TopoDS_Shape.hxx>
-
-namespace Command
-{
-
-GeocommandSketchBase::GeocommandSketchBase(MainWidget::SketchViewProvider* p, MainWidget::PreWindow* pre, GUI::MainWindow* m)
-    : _sketchView(p), GeoCommandBase(m, pre)
-{
-    _type = Sketch;
-
-    connect(this, SIGNAL(showSketch(TopoDS_Shape*)), p, SIGNAL(showSketch(TopoDS_Shape*)));
-    connect(this, SIGNAL(removeSketch(TopoDS_Shape*)), p, SIGNAL(hideSketch(TopoDS_Shape*)));
-}
-
-GeocommandSketchBase::~GeocommandSketchBase()
-{
-
-}
-
-void GeocommandSketchBase::setPoints(QList<gp_Pnt> ptlist)
-{
-    _pointList = ptlist;
-}
-
-void GeocommandSketchBase::releaseResult()
-{
-    if (_resShape != nullptr) delete _resShape;
-    _resShape = nullptr;
-}
-
-
-
-}

+ 0 - 40
src/GeometryCommand/GeoCommandSketchBase.h

@@ -1,40 +0,0 @@
-#ifndef GEOCOMMANDSKETCHBASE_H_
-#define GEOCOMMANDSKETCHBASE_H_
-
-#include "GeoCommandBase.h"
-#include <gp_Pnt.hxx>
-#include <QList>
-
-namespace MainWidget
-{
-	class SketchViewProvider;
-}
-
-namespace Command
-{
-
-	class GeocommandSketchBase : public GeoCommandBase
-	{
-		Q_OBJECT
-	public:
-		GeocommandSketchBase(MainWidget::SketchViewProvider* p, MainWidget::PreWindow* pre, GUI::MainWindow* m);
-		~GeocommandSketchBase();
-
-		void setPoints(QList<gp_Pnt> ptlist);
-		void releaseResult() override;
-
-	signals:
-		void showSketch(TopoDS_Shape*);
-		void removeSketch(TopoDS_Shape*);
-	
-	protected:
-		MainWidget::SketchViewProvider* _sketchView{};
-		QList<gp_Pnt> _pointList{};
-
-	};
-
-}
-
-
-
-#endif

+ 0 - 61
src/GeometryCommand/GeoCommandSketchCircle.cpp

@@ -1,61 +0,0 @@
-#include "GeoCommandSketchCircle.h"
-#include <gp_Pnt.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include "Geometry/geometryData.h"
-#include <gp_Ax2.hxx>
-#include <gp_Ax3.hxx>
-#include <gp_Circ.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include "Geometry/geometryData.h"
-
-namespace Command
-{
-	GeoCommanSketchCircle::GeoCommanSketchCircle(MainWidget::SketchViewProvider *v, GUI::MainWindow *m, MainWidget::PreWindow *p)
-		: GeocommandSketchBase(v, p, m)
-	{
-	}
-
-	bool GeoCommanSketchCircle::execute()
-	{
-		if (_pointList.size() != 2)
-			return false;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _pointList[1];
-		double d = pt1.Distance(pt2);
-		if (d < 1e-6)
-			return false;
-
-		auto geodata = Geometry::GeometryData::getInstance();
-		gp_Ax3 *ax = geodata->getSketchPlane();
-
-		gp_Circ circle(gp_Ax2(pt1, ax->Direction()), d);
-		BRepBuilderAPI_MakeEdge makeCircle(circle);
-
-		TopoDS_Vertex ver = BRepBuilderAPI_MakeVertex(pt1);
-		TopoDS_Compound aRes;
-		BRep_Builder aBuilder;
-		aBuilder.MakeCompound(aRes);
-		aBuilder.Add(aRes, makeCircle.Shape());
-		aBuilder.Add(aRes, ver);
-
-		if (makeCircle.Shape().IsNull())
-			return false;
-		_resShape = new TopoDS_Shape;
-		*_resShape = aRes;
-		emit showSketch(_resShape);
-		return GeoCommandBase::execute();
-	}
-
-	void GeoCommanSketchCircle::undo()
-	{
-		emit removeSketch(_resShape);
-	}
-
-	void GeoCommanSketchCircle::redo()
-	{
-		emit showSketch(_resShape);
-	}
-}

+ 0 - 25
src/GeometryCommand/GeoCommandSketchCircle.h

@@ -1,25 +0,0 @@
-#ifndef GEOCOMMANDSKETCHCIRCLE_H_
-#define GEOCOMMANDSKETCHCIRCLE_H_
-
-#include "GeoCommandSketchBase.h"
-
-class gp_Pnt;
-//class gp_Dir;
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommanSketchCircle : public GeocommandSketchBase
-	{
-	public:
-		GeoCommanSketchCircle(MainWidget::SketchViewProvider* view, GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommanSketchCircle() = default;
-
-		bool execute()override;
-		void undo() override;
-		void redo() override;
-
-	};
-
-
-}
-
-#endif

+ 0 - 75
src/GeometryCommand/GeoCommandSketchComplete.cpp

@@ -1,75 +0,0 @@
-#include "GeoCommandSketchComplete.h"
-#include "GeoCommandList.h"
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
-#include <TopoDS_Shape.hxx>
-#include <QString>
-#include "Geometry/geometryData.h"
-#include "Geometry/geometrySet.h"
-
-namespace Command
-{
-	GeoCommandSketchComplete::GeoCommandSketchComplete(GUI::MainWindow *m, MainWidget::PreWindow *p)
-		: GeoCommandBase(m, p)
-	{
-	}
-
-	bool GeoCommandSketchComplete::execute()
-	{
-		QList<GeoCommandBase *> clist = _commandList->getSketchUndoList();
-		const int n = clist.size();
-		if (n < 1)
-			return false;
-
-		TopoDS_Compound comp;
-		BRep_Builder builder;
-		builder.MakeCompound(comp);
-
-		for (int i = 0; i < n; ++i)
-		{
-			auto c = clist.at(i);
-			TopoDS_Shape *s = c->getResultShape();
-			if (s == nullptr)
-				continue;
-			builder.Add(comp, *s);
-		}
-
-		TopoDS_Shape *shape = new TopoDS_Shape;
-		*shape = comp;
-
-		const int id = Geometry::GeometrySet::getMaxID() + 1;
-		QString name = QString("Sketch_%1").arg(id);
-		Geometry::GeometrySet *set = new Geometry::GeometrySet;
-		set->setShape(shape);
-		set->setName(name);
-		_geoData->appendGeometrySet(set);
-		_result = set;
-
-		emit showSet(set);
-		emit updateGeoTree();
-		_commandList->clearSketchUndoCommands();
-
-		return GeoCommandBase::execute();
-	}
-
-	void GeoCommandSketchComplete::undo()
-	{
-		_geoData->removeTopGeometrySet(_result);
-		emit removeDisplayActor(_result);
-		emit updateGeoTree();
-	}
-
-	void GeoCommandSketchComplete::redo()
-	{
-		_geoData->appendGeometrySet(_result);
-		emit showSet(_result);
-		emit updateGeoTree();
-	}
-
-	void GeoCommandSketchComplete::releaseResult()
-	{
-		if (_result != nullptr)
-			delete _result;
-	}
-
-}

+ 0 - 33
src/GeometryCommand/GeoCommandSketchComplete.h

@@ -1,33 +0,0 @@
-#ifndef GEOCOMMANDSKETCHCOMPLATE_H_
-#define GEOCOMMANDSKETCHCOMPLATE_H_
-
-#include "GeoCommandBase.h"
-
-namespace Geometry
-{
-	class GeometrySet;
-}
-
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommandSketchComplete : public GeoCommandBase
-	{
-		Q_OBJECT
-	public:
-		GeoCommandSketchComplete(GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommandSketchComplete() = default;
-
-		bool execute() override;
-		void undo() override;
-		void redo() override;
-		void releaseResult() override;
-
-	private:
-		Geometry::GeometrySet* _result{};
-	};
-
-
-}
-
-
-#endif

+ 0 - 44
src/GeometryCommand/GeoCommandSketchLine.cpp

@@ -1,44 +0,0 @@
-#include "GeoCommandSketchLine.h"
-#include <gp_Pnt.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <TopoDS_Edge.hxx>
-#include "Geometry/geometryData.h"
-
-namespace Command
-{
-	GeoCommanSketchLine::GeoCommanSketchLine(MainWidget::SketchViewProvider *v, GUI::MainWindow *m, MainWidget::PreWindow *p)
-		: GeocommandSketchBase(v, p, m)
-	{
-	}
-
-	bool GeoCommanSketchLine::execute()
-	{
-		if (_pointList.size() != 2)
-			return false;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _pointList[1];
-		if (pt1.Distance(pt2) < 1e-6)
-			return false;
-
-		const TopoDS_Edge &aedge = BRepBuilderAPI_MakeEdge(pt1, pt2);
-		if (aedge.IsNull())
-			return false;
-		_resShape = new TopoDS_Shape;
-		*_resShape = aedge;
-
-		emit showSketch(_resShape);
-		return GeoCommandBase::execute();
-	}
-
-	void GeoCommanSketchLine::undo()
-	{
-		emit removeSketch(_resShape);
-	}
-
-	void GeoCommanSketchLine::redo()
-	{
-		emit showSketch(_resShape);
-	}
-
-}

+ 0 - 25
src/GeometryCommand/GeoCommandSketchLine.h

@@ -1,25 +0,0 @@
-#ifndef GEOCOMMANDSKETCHLINE_H_
-#define GEOCOMMANDSKETCHLINE_H_
-
-#include "GeoCommandSketchBase.h"
-
-class gp_Pnt;
-
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommanSketchLine : public GeocommandSketchBase
-	{
-	public:
-		GeoCommanSketchLine(MainWidget::SketchViewProvider* view, GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommanSketchLine() = default;
-
-		bool execute()override;
-		void undo() override;
-		void redo() override;
-
-	};
-
-
-}
-
-#endif

+ 0 - 57
src/GeometryCommand/GeoCommandSketchPolyline.cpp

@@ -1,57 +0,0 @@
-#include "GeoCommandSketchPolyline.h"
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include "Geometry/geometrySet.h"
-#include "Geometry/geometryData.h"
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
-namespace Command
-{
-	GeoCommanSketchPolyline::GeoCommanSketchPolyline(MainWidget::SketchViewProvider *v, GUI::MainWindow *m, MainWidget::PreWindow *p)
-		: GeocommandSketchBase(v, p, m)
-	{
-	}
-
-	bool GeoCommanSketchPolyline::execute()
-	{
-		if (_pointList.size() < 2)
-			return false;
-
-		TopoDS_Compound aRes;
-		BRep_Builder aBuilder;
-		aBuilder.MakeCompound(aRes);
-		for (int i = 0; i < _pointList.size() - 1; ++i)
-		{
-			BRepBuilderAPI_MakeEdge edge(_pointList[i], _pointList[i + 1]);
-			aBuilder.Add(aRes, edge);
-		}
-
-		if (_isClose && _pointList.size() > 2)
-		{
-			BRepBuilderAPI_MakeEdge edge(_pointList.last(), _pointList.first());
-			aBuilder.Add(aRes, edge);
-		}
-
-		if (aRes.IsNull())
-			return false;
-		_resShape = new TopoDS_Shape;
-		*_resShape = aRes;
-		emit showSketch(_resShape);
-		return true;
-	}
-
-	void GeoCommanSketchPolyline::undo()
-	{
-		emit removeSketch(_resShape);
-	}
-
-	void GeoCommanSketchPolyline::redo()
-	{
-		emit showSketch(_resShape);
-	}
-
-	void GeoCommanSketchPolyline::isClose(bool c)
-	{
-		_isClose = c;
-	}
-
-}

+ 0 - 29
src/GeometryCommand/GeoCommandSketchPolyline.h

@@ -1,29 +0,0 @@
-#ifndef GEOCOMMANDSKETCHPOLYLINE_H_
-#define GEOCOMMANDSKETCHPOLYLINE_H_
-
-#include "GeoCommandSketchBase.h"
-
-class gp_Pnt;
-//class gp_Dir;
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommanSketchPolyline : public GeocommandSketchBase
-	{
-	public:
-		GeoCommanSketchPolyline(MainWidget::SketchViewProvider* view, GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommanSketchPolyline() = default;
-
-		bool execute()override;
-		void undo() override;
-		void redo() override;
-		void isClose(bool c);
-
-	private:
-		bool _isClose{ false }; 
-	
-	};
-
-
-}
-
-#endif

+ 0 - 80
src/GeometryCommand/GeoCommandSketchRect.cpp

@@ -1,80 +0,0 @@
-#include "GeoCommandSketchRect.h"
-#include <gp_Pnt.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakePolygon.hxx>
-#include <TopoDS_Edge.hxx>
-#include "Geometry/geometrySet.h"
-#include "Geometry/geometryData.h"
-#include <TopoDS.hxx>
-#include <gp_Ax3.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <BRep_Tool.hxx>
-#include <gp_Lin.hxx>
-namespace Command
-{
-	GeoCommanSketchRect::GeoCommanSketchRect(MainWidget::SketchViewProvider *v, GUI::MainWindow *m, MainWidget::PreWindow *p)
-		: GeocommandSketchBase(v, p, m)
-	{
-	}
-
-	bool GeoCommanSketchRect::execute()
-	{
-		if (_pointList.size() != 2)
-			return false;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _pointList[1];
-		if (pt1.Distance(pt2) < 1e-6)
-			return false;
-
-		gp_Ax3 *ax3 = _geoData->getSketchPlane();
-		gp_Lin yLine(ax3->Location(), ax3->YDirection());
-		BRepBuilderAPI_MakeEdge yEdge(yLine);
-		gp_Lin xLine(ax3->Location(), ax3->XDirection());
-		BRepBuilderAPI_MakeEdge xEdge(xLine);
-
-		Standard_Real vfirst, vlast;
-		Handle(Geom_Curve) yCurve = BRep_Tool::Curve(yEdge, vfirst, vlast);
-		GeomAPI_ProjectPointOnCurve projector1(pt1, yCurve);
-		gp_Pnt nearyPt1 = projector1.NearestPoint();
-		GeomAPI_ProjectPointOnCurve projector2(pt2, yCurve);
-		gp_Pnt nearyPt2 = projector2.NearestPoint();
-
-		Standard_Real xfirst, xlast;
-		Handle(Geom_Curve) xCurve = BRep_Tool::Curve(xEdge, xfirst, xlast);
-		GeomAPI_ProjectPointOnCurve projectorx1(pt1, xCurve);
-		gp_Pnt nearxPt1 = projectorx1.NearestPoint();
-		GeomAPI_ProjectPointOnCurve projectorx2(pt2, xCurve);
-		gp_Pnt nearxPt2 = projectorx2.NearestPoint();
-
-		gp_Trsf yTrsf;
-		gp_Vec pt1Vec((nearyPt2.X() - nearyPt1.X()), (nearyPt2.Y() - nearyPt1.Y()), (nearyPt2.Z() - nearyPt1.Z()));
-		yTrsf.SetTranslation(pt1Vec);
-		gp_Pnt pt3 = pt1.Transformed(yTrsf);
-
-		gp_Trsf xTrsf;
-		gp_Vec pt1xVec((nearxPt2.X() - nearxPt1.X()), (nearxPt2.Y() - nearxPt1.Y()), (nearxPt2.Z() - nearxPt1.Z()));
-		xTrsf.SetTranslation(pt1xVec);
-		gp_Pnt pt4 = pt1.Transformed(xTrsf);
-
-		BRepBuilderAPI_MakePolygon makePoly(pt1, pt3, pt2, pt4);
-		makePoly.Close();
-		if (makePoly.Shape().IsNull())
-			return false;
-		_resShape = new TopoDS_Shape;
-		*_resShape = makePoly.Shape();
-		emit showSketch(_resShape);
-		return GeoCommandBase::execute();
-	}
-	void GeoCommanSketchRect::undo()
-	{
-		emit removeSketch(_resShape);
-	}
-
-	void GeoCommanSketchRect::redo()
-	{
-		emit showSketch(_resShape);
-	}
-
-}

+ 0 - 26
src/GeometryCommand/GeoCommandSketchRect.h

@@ -1,26 +0,0 @@
-#ifndef GEOCOMMANDSKETCHRECT_H_
-#define GEOCOMMANDSKETCHRECT_H_
-
-#include "GeoCommandSketchBase.h"
-
-class gp_Pnt;
-
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommanSketchRect : public GeocommandSketchBase
-	{
-	public:
-		GeoCommanSketchRect(MainWidget::SketchViewProvider* view, GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommanSketchRect() = default;
-
-		bool execute()override;
-		void undo()override;
-		void redo() override;
-	private:
-		//Geometry::GeometryData* _geoData{};
-	};
-
-
-}
-
-#endif

+ 0 - 56
src/GeometryCommand/GeoCommandSketchSpline.cpp

@@ -1,56 +0,0 @@
-#include "GeoCommandSketchSpline.h"
-#include <TColgp_Array1OfPnt.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <GeomAPI_Interpolate.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <TopoDS_Edge.hxx>
-#include <Precision.hxx>
-
-
-namespace Command
-{
-	GeoCommanSketchSpline::GeoCommanSketchSpline(MainWidget::SketchViewProvider* v, GUI::MainWindow* m, MainWidget::PreWindow* p)
-		:GeocommandSketchBase(v, p, m)
-	{
-	}
-
-	bool GeoCommanSketchSpline::execute()
-	{
-		const int nPt = _pointList.size();
-		if (nPt <= 2) return false;
-		Handle_TColgp_HArray1OfPnt aPoints = new TColgp_HArray1OfPnt(1, nPt);
-		for (int i = 0; i < nPt; ++i)
-		{
-			gp_Pnt point = _pointList.at(i);
-			aPoints->SetValue(i+1, point);
-		}
-
-		GeomAPI_Interpolate aInterpolater(aPoints, Standard_False, Precision::Approximation());
-
-		aInterpolater.Perform();
-		if (!aInterpolater.IsDone()) return false;
- 		TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(aInterpolater.Curve());
-		if (edge.IsNull()) return false;
-	
-		_resShape = new TopoDS_Shape;
-		*_resShape = edge;
-		emit showSketch(_resShape);
-
-		return GeoCommandBase::execute();
-	}
-
-	void GeoCommanSketchSpline::undo()
-	{
-		emit removeSketch(_resShape);
-	}
-
-	void GeoCommanSketchSpline::redo()
-	{
-		emit showSketch(_resShape);
-	}
-
-
-
-}

+ 0 - 31
src/GeometryCommand/GeoCommandSketchSpline.h

@@ -1,31 +0,0 @@
-#ifndef GEOCOMMANDSKETCHSPLINE_H_
-#define GEOCOMMANDSKETCHSPLINE_H_
-
-#include "GeoCommandSketchBase.h"
-
-class gp_Pnt;
-
-namespace Command
-{
-	class GEOMETRYCOMMANDAPI GeoCommanSketchSpline : public GeocommandSketchBase
-	{
-	public:
-		GeoCommanSketchSpline(MainWidget::SketchViewProvider* view, GUI::MainWindow* m, MainWidget::PreWindow* p);
-		~GeoCommanSketchSpline() = default;
-
-		bool execute()override;
-		void undo() override;
-		void redo() override;
-// 		void isClose(bool c);
-// 
-// 	private:
-// 		bool _isClose{ false };
-
-	};
-
-
-}
-
-
-
-#endif

+ 0 - 404
src/GeometryCommand/GeoSketchCreater.cpp

@@ -1,404 +0,0 @@
-#include "GeoSketchCreater.h"
-#include "MainWidgets/sketchViewProvider.h"
-#include "MainWidgets/preWindow.h"
-#include "Geometry/geometryData.h"
-#include "GeoCommandList.h"
-#include <Geom_Plane.hxx>
-#include <GeomAPI_ProjectPointOnSurf.hxx>
-#include "GeoCommandSketchComplete.h"
-#include "GeoCommandSketchLine.h"
-#include "GeoCommandSketchRect.h"
-#include <GeoCommandSketchCircle.h>
-#include <GeoCommandSketchArc.h>
-#include <GeoCommandSketchPolyline.h>
-#include <GeoCommandSketchSpline.h>
-#include <vtkActor.h>
-#include <IVtkOCC_Shape.hxx>
-#include <IVtkTools_ShapeDataSource.hxx>
-#include <vtkPolyDataMapper.h>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <TopoDS_Edge.hxx>
-#include <gp_Pnt.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakePolygon.hxx>
-#include <gp_Circ.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
-#include <GC_MakeArcOfCircle.hxx>
-#include <GC_MakeCircle.hxx>
-#include <QDebug>
-
-namespace Command
-{
-	SketchCreater::SketchCreater(MainWidget::SketchViewProvider *p, MainWidget::PreWindow *pre, GUI::MainWindow *m, vtkActor *actor)
-		: _view(p), _preWindow(pre), _mainWindow(m), _tempActor(actor)
-	{
-		_geoData = Geometry::GeometryData::getInstance();
-		_commandList = GeoComandList::getInstance();
-		connect(this, SIGNAL(reRender()), _preWindow, SIGNAL(reRenderSig()));
-	}
-
-	SketchCreater::~SketchCreater()
-	{
-	}
-
-	void SketchCreater::setSketchType(ModuleBase::SketchType t)
-	{
-		_sketchType = t;
-		if (_sketchType == ModuleBase::SketchPolyline)
-			_pointList.clear();
-		_commandList->startSketchMode(t != ModuleBase::SketchNone);
-		if (t == ModuleBase::SketchNone)
-		{
-			auto c = new GeoCommandSketchComplete(_mainWindow, _preWindow);
-			_commandList->executeCommand(c);
-		}
-	}
-
-	void SketchCreater::appendPoint(gp_Pnt &pt)
-	{
-		if (_sketchType == ModuleBase::SketchNone)
-			return;
-		gp_Ax3 *p = _geoData->getSketchPlane();
-		Handle(Geom_Plane) gplane = new Geom_Plane(*p);
-		GeomAPI_ProjectPointOnSurf projector1(pt, gplane);
-		gp_Pnt point = projector1.NearestPoint();
-
-		bool append = true;
-		if (!_pointList.isEmpty())
-		{
-			gp_Pnt last = _pointList.last();
-			if (last.Distance(point) < 1e-5)
-				append = false;
-		}
-		if (append)
-		{
-			_pointList.append(point);
-			this->exec();
-		}
-	}
-
-	void SketchCreater::setTempPoint(gp_Pnt &pt)
-	{
-
-		_tempPnt = pt;
-		this->generateTempShape();
-	}
-
-	void SketchCreater::exec()
-	{
-		bool ok = false;
-		switch (_sketchType)
-		{
-		case ModuleBase::SketchLine:
-			ok = createLine();
-			break;
-		case ModuleBase::SketchRect:
-			ok = createRect();
-			break;
-		case ModuleBase::SketchCircle:
-			ok = creatCircle();
-			break;
-		case ModuleBase::SketchArc:
-			ok = createArc();
-			break;
-
-		default:
-			break;
-		}
-		if (ok)
-		{
-			_pointList.clear();
-			_tempActor->SetVisibility(false);
-			emit reRender();
-		}
-	}
-
-	void SketchCreater::onMouseRightRelease()
-	{
-		bool ok = false;
-		switch (_sketchType)
-		{
-		case ModuleBase::SketchPolyline:
-			ok = createPolyline();
-			break;
-		case ModuleBase::SketchSpline:
-			ok = creatSpline();
-			break;
-		default:
-			break;
-		}
-
-		if (ok)
-		{
-			_pointList.clear();
-			_tempActor->SetVisibility(false);
-			emit reRender();
-		}
-	}
-
-	void SketchCreater::onMouseMiddleRelease()
-	{
-		bool ok = false;
-		switch (_sketchType)
-		{
-		case ModuleBase::SketchPolyline:
-			ok = createPolyline(true);
-			break;
-		default:
-			break;
-		}
-
-		if (ok)
-		{
-			_pointList.clear();
-			_tempActor->SetVisibility(false);
-			emit reRender();
-		}
-	}
-
-	bool SketchCreater::createLine()
-	{
-		if (_pointList.size() != 2)
-			return false;
-		auto command = new GeoCommanSketchLine(_view, _mainWindow, _preWindow);
-		command->setPoints(_pointList);
-		return _commandList->executeCommand(command);
-	}
-
-	bool SketchCreater::createRect()
-	{
-		if (_pointList.size() != 2)
-			return false;
-		auto command = new GeoCommanSketchRect(_view, _mainWindow, _preWindow);
-		command->setPoints(_pointList);
-		gp_Ax3 *ax3 = _geoData->getSketchPlane();
-		gp_Dir y = ax3->YDirection();
-		return _commandList->executeCommand(command);
-	}
-
-	bool SketchCreater::creatCircle()
-	{
-		if (_pointList.size() != 2)
-			return false;
-		auto command = new GeoCommanSketchCircle(_view, _mainWindow, _preWindow);
-		command->setPoints(_pointList);
-		return _commandList->executeCommand(command);
-	}
-
-	bool SketchCreater::createArc()
-	{
-		if (_pointList.size() != 3)
-			return false;
-		auto command = new GeoCommanSketchArc(_view, _mainWindow, _preWindow);
-		command->setPoints(_pointList);
-		return _commandList->executeCommand(command);
-	}
-
-	bool SketchCreater::createPolyline(bool close)
-	{
-		//		_polyPtList.append(_pointList);
-		auto command = new GeoCommanSketchPolyline(_view, _mainWindow, _preWindow);
-		command->setPoints(_pointList);
-		command->isClose(close);
-		return _commandList->executeCommand(command);
-	}
-
-	bool SketchCreater::creatSpline()
-	{
-		auto command = new GeoCommanSketchSpline(_view, _mainWindow, _preWindow);
-		command->setPoints(_pointList);
-		//		command->isClose(close);
-		return _commandList->executeCommand(command);
-	}
-
-	void SketchCreater::generateTempShape()
-	{
-		TopoDS_Shape *shape = nullptr;
-		switch (_sketchType)
-		{
-		case ModuleBase::SketchLine:
-			shape = this->generateLine();
-			break;
-		case ModuleBase::SketchRect:
-			shape = this->generateRect();
-			break;
-		case ModuleBase::SketchCircle:
-			shape = this->generateCircle();
-			break;
-		case ModuleBase::SketchArc:
-			shape = this->generateArc();
-			break;
-		case ModuleBase::SketchPolyline:
-		case ModuleBase::SketchSpline:
-			shape = this->generatePolyLine();
-			break;
-		default:
-			break;
-		}
-		if (shape == nullptr)
-			return;
-
-		IVtkOCC_Shape::Handle aShapeImpl = new IVtkOCC_Shape(*shape);
-		vtkSmartPointer<IVtkTools_ShapeDataSource> DS = vtkSmartPointer<IVtkTools_ShapeDataSource>::New();
-		DS->SetShape(aShapeImpl);
-
-		vtkSmartPointer<vtkPolyDataMapper> Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
-		Mapper->SetInputConnection(DS->GetOutputPort());
-		_tempActor->SetMapper(Mapper);
-		Mapper->Update();
-
-		_tempActor->SetVisibility(true);
-		emit reRender();
-		delete shape;
-	}
-
-	TopoDS_Shape *SketchCreater::generateLine()
-	{
-		if (_pointList.size() != 1)
-			return nullptr;
-
-		gp_Pnt pt1 = _pointList[0];
-		if (pt1.Distance(_tempPnt) < 1e-3)
-			return nullptr;
-
-		const TopoDS_Edge &aedge = BRepBuilderAPI_MakeEdge(pt1, _tempPnt);
-		TopoDS_Shape *shape = new TopoDS_Shape;
-		*shape = aedge;
-		return shape;
-	}
-
-	TopoDS_Shape *SketchCreater::generateRect()
-	{
-		if (_pointList.size() != 1)
-			return nullptr;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _tempPnt;
-		if (pt1.Distance(pt2) < 1e-6)
-			return nullptr;
-
-		gp_Ax3 *ax3 = _geoData->getSketchPlane();
-		gp_Lin yLine(ax3->Location(), ax3->YDirection());
-		BRepBuilderAPI_MakeEdge yEdge(yLine);
-		gp_Lin xLine(ax3->Location(), ax3->XDirection());
-		BRepBuilderAPI_MakeEdge xEdge(xLine);
-
-		Standard_Real vfirst, vlast;
-		Handle(Geom_Curve) yCurve = BRep_Tool::Curve(yEdge, vfirst, vlast);
-		GeomAPI_ProjectPointOnCurve projector1(pt1, yCurve);
-		gp_Pnt nearyPt1 = projector1.NearestPoint();
-		GeomAPI_ProjectPointOnCurve projector2(pt2, yCurve);
-		gp_Pnt nearyPt2 = projector2.NearestPoint();
-
-		Standard_Real xfirst, xlast;
-		Handle(Geom_Curve) xCurve = BRep_Tool::Curve(xEdge, xfirst, xlast);
-		GeomAPI_ProjectPointOnCurve projectorx1(pt1, xCurve);
-		gp_Pnt nearxPt1 = projectorx1.NearestPoint();
-		GeomAPI_ProjectPointOnCurve projectorx2(pt2, xCurve);
-		gp_Pnt nearxPt2 = projectorx2.NearestPoint();
-
-		gp_Trsf yTrsf;
-		gp_Vec pt1Vec((nearyPt2.X() - nearyPt1.X()), (nearyPt2.Y() - nearyPt1.Y()), (nearyPt2.Z() - nearyPt1.Z()));
-		yTrsf.SetTranslation(pt1Vec);
-		gp_Pnt pt3 = pt1.Transformed(yTrsf);
-
-		gp_Trsf xTrsf;
-		gp_Vec pt1xVec((nearxPt2.X() - nearxPt1.X()), (nearxPt2.Y() - nearxPt1.Y()), (nearxPt2.Z() - nearxPt1.Z()));
-		xTrsf.SetTranslation(pt1xVec);
-		gp_Pnt pt4 = pt1.Transformed(xTrsf);
-
-		BRepBuilderAPI_MakePolygon makePoly(pt1, pt3, pt2, pt4);
-		makePoly.Close();
-		if (makePoly.Shape().IsNull())
-			return nullptr;
-		TopoDS_Shape *shape = new TopoDS_Shape;
-		*shape = makePoly.Shape();
-		return shape;
-	}
-
-	TopoDS_Shape *SketchCreater::generateCircle()
-	{
-		if (_pointList.size() != 1)
-			return nullptr;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _tempPnt;
-		double d = pt1.Distance(pt2);
-		if (d < 1e-6)
-			return nullptr;
-		gp_Ax3 *ax = _geoData->getSketchPlane();
-
-		gp_Circ circle(gp_Ax2(pt1, ax->Direction()), d);
-		BRepBuilderAPI_MakeEdge makeCircle(circle);
-
-		if (!makeCircle.IsDone())
-			return nullptr;
-		TopoDS_Shape *shape = new TopoDS_Shape;
-		*shape = makeCircle.Shape();
-		return shape;
-	}
-
-	TopoDS_Shape *SketchCreater::generateArc()
-	{
-		if (_pointList.size() == 1)
-			return this->generateLine();
-		else if (_pointList.size() != 2)
-			return nullptr;
-
-		gp_Pnt pt1 = _pointList[0];
-		gp_Pnt pt2 = _pointList[1];
-		gp_Pnt pt3 = _tempPnt;
-		gp_Lin lin(pt1, gp_Dir(pt2.X() - pt1.X(), pt2.Y() - pt1.Y(), pt2.Z() - pt1.Z()));
-		if (lin.Distance(pt3) == 0)
-			return nullptr;
-		for (int i = 0; i <= _pointList.size() - 1; ++i)
-		{
-			for (int j = 0; j < i; ++j)
-				if (_pointList[i].Distance(_pointList[j]) < 1e-3)
-					return nullptr;
-		}
-
-		const TopoDS_Edge &edge1 = BRepBuilderAPI_MakeEdge(pt1, pt2);
-		const TopoDS_Edge &edge2 = BRepBuilderAPI_MakeEdge(pt2, _tempPnt);
-		// BRep_Builder builder;
-
-		TopoDS_Compound aRes;
-		BRep_Builder aBuilder;
-		aBuilder.MakeCompound(aRes);
-		aBuilder.Add(aRes, edge1);
-		aBuilder.Add(aRes, edge2);
-
-		TopoDS_Shape *shape = new TopoDS_Shape;
-		*shape = aRes;
-		return shape;
-	}
-
-	TopoDS_Shape *SketchCreater::generatePolyLine()
-	{
-		QList<gp_Pnt> pts = _pointList;
-		pts.append(_tempPnt);
-
-		if (pts.size() < 2)
-			return nullptr;
-
-		TopoDS_Compound aRes;
-		BRep_Builder aBuilder;
-		aBuilder.MakeCompound(aRes);
-		for (int i = 0; i < pts.size() - 1; ++i)
-		{
-			BRepBuilderAPI_MakeEdge edge(pts[i], pts[i + 1]);
-			aBuilder.Add(aRes, edge);
-		}
-
-		if (aRes.IsNull())
-			return nullptr;
-		TopoDS_Shape *shape = new TopoDS_Shape;
-		*shape = aRes;
-		return shape;
-	}
-
-}

+ 0 - 81
src/GeometryCommand/GeoSketchCreater.h

@@ -1,81 +0,0 @@
-#ifndef SKETCHCREATER_H_
-#define SKETCHCREATER_H_
-
-#include "geometryCommandAPI.h"
-#include <QObject>
-#include "ModuleBase/ModuleType.h"
-#include <QList>
-#include <gp_Pnt.hxx>
-
-class vtkActor;
-class TopoDS_Shape;
-
-namespace MainWidget
-{
-	class SketchViewProvider;
-	class PreWindow;
-}
-
-namespace GUI
-{
-	class MainWindow;
-}
-
-namespace Geometry
-{
-	class GeometryData;
-}
-
-namespace Command
-{
-	class GeoComandList;
-
-	class GEOMETRYCOMMANDAPI SketchCreater : public QObject
-	{
-		Q_OBJECT
-	public:
-		SketchCreater(MainWidget::SketchViewProvider *p, MainWidget::PreWindow *pre, GUI::MainWindow *m, vtkActor *actor);
-		~SketchCreater();
-
-		void setSketchType(ModuleBase::SketchType t);
-		void appendPoint(gp_Pnt &pt);
-		void setTempPoint(gp_Pnt &pt);
-		void onMouseRightRelease();
-		void onMouseMiddleRelease();
-
-	signals:
-		void reRender();
-
-	private:
-		void exec();
-		bool createLine();
-		bool createRect();
-		bool creatCircle();
-		bool createArc();
-		bool createPolyline(bool close = false);
-		bool creatSpline();
-
-		void generateTempShape();
-		TopoDS_Shape *generateLine();
-		TopoDS_Shape *generateRect();
-		TopoDS_Shape *generateCircle();
-		TopoDS_Shape *generateArc();
-		TopoDS_Shape *generatePolyLine();
-
-	private:
-		MainWidget::SketchViewProvider *_view{};
-		MainWidget::PreWindow *_preWindow{};
-		GUI::MainWindow *_mainWindow{};
-		GeoComandList *_commandList{};
-
-		Geometry::GeometryData *_geoData{};
-		ModuleBase::SketchType _sketchType{ModuleBase::SketchNone};
-		QList<gp_Pnt> _pointList{};
-		//		QList<gp_Pnt>_polyPtList{};
-		gp_Pnt _tempPnt{};
-		vtkActor *_tempActor{};
-	};
-
-}
-
-#endif

+ 0 - 52
src/GeometryWidgets/SketchPointWidget.cpp

@@ -1,52 +0,0 @@
-//草绘模式点输入对话框类的源文件
-
-#include "SketchPointWidget.h"
-#include "ui_SketchPointWidget.h"
-#include "MainWindow/MainWindow.h"
-#include "Geometry/geometryData.h"
-#include <gp_Ax3.hxx>
-#include "GeometryCommand/GeoSketchCreater.h"
-
-namespace GeometryWidget
-{
-	SketchPointWidget::SketchPointWidget(GUI::MainWindow *m, MainWidget::PreWindow *pre, Command::SketchCreater *c)
-		: GeoDialogBase(m, pre), _creater(c)
-	{
-		_ui = new Ui::SketchPointWidget;
-		_ui->setupUi(this);
-		this->setWindowFlags(windowFlags() & ~Qt::WindowCloseButtonHint);
-		_geoData = Geometry::GeometryData::getInstance();
-	}
-
-	SketchPointWidget::~SketchPointWidget()
-	{
-		if (_ui != nullptr)
-			delete _ui;
-	}
-
-	void SketchPointWidget::on_addButton_clicked()
-	{
-		bool ok = false;
-		QString text = _ui->lineEditX->text();
-		double x = text.toDouble(&ok);
-		if (!ok)
-			return;
-		text = _ui->lineEditY->text();
-		double y = text.toDouble(&ok);
-		if (!ok)
-			return;
-
-		gp_Ax3 *sp = _geoData->getSketchPlane();
-		gp_Pnt o = sp->Location();
-		gp_Dir xa = sp->XDirection();
-		gp_Dir ya = sp->YDirection();
-
-		gp_Pnt pt;
-		pt.SetX(o.X() + x * xa.X() + y * ya.X());
-		pt.SetY(o.Y() + x * xa.Y() + y * ya.Y());
-		pt.SetZ(o.Z() + x * xa.Z() + y * ya.Z());
-
-		_creater->appendPoint(pt);
-	}
-
-}

+ 0 - 75
src/GeometryWidgets/SketchPointWidget.h

@@ -1,75 +0,0 @@
-//草绘模式点输入对话框类的头文件
-
-#ifndef SKETCHWIDGETPOINT_H_
-#define SKETCHWIDGETPOINT_H_
-
-#include "geoDialogBase.h"
-#include "geometryWidgetsAPI.h"
-
-namespace Command
-{
-	class SketchCreater;
-}
-
-namespace Ui
-{
-	class SketchPointWidget;
-}
-
-namespace Geometry
-{
-	class GeometryData;
-}
-
-namespace GeometryWidget
-{
-	/**
-	 * @brief 草绘模式点输入对话框类
-	 * @since 2.5.0
-	 */
-	class GEOMETRYWIDGETSAPI SketchPointWidget : public GeoDialogBase
-	{
-		Q_OBJECT
-	public:
-		/**
-		 * @brief 构造函数
-		 * @param m 主窗口对象
-		 * @param pre 前处理窗口对象
-		 * @param c 草绘对象
-		 * @since 2.5.0
-		 */
-		SketchPointWidget(GUI::MainWindow *m, MainWidget::PreWindow *pre, Command::SketchCreater *c);
-		/**
-		 * @brief 析构函数
-		 * @since 2.5.0
-		 */
-		~SketchPointWidget();
-
-	private slots:
-		/**
-		 * @brief 添加点按钮的响应槽函数
-		 * @since 2.5.0
-		 */
-		void on_addButton_clicked();
-
-	private:
-		/**
-		 * @brief 草绘对象
-		 * @since 2.5.0
-		 */
-		Command::SketchCreater *_creater{};
-		/**
-		 * @brief ui
-		 * @since 2.5.0
-		 */
-		Ui::SketchPointWidget *_ui{};
-		/**
-		 * @brief 几何数据
-		 * @since 2.5.0
-		 */
-		Geometry::GeometryData *_geoData{};
-	};
-
-}
-
-#endif // !SKETCHWIDGETPOINT_H_

+ 0 - 100
src/GeometryWidgets/SketchPointWidget.ui

@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SketchPointWidget</class>
- <widget class="QDialog" name="SketchPointWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>205</width>
-    <height>129</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Input Sketch Point</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout_2">
-   <item row="0" column="0" colspan="2">
-    <widget class="QGroupBox" name="groupBox_2">
-     <property name="title">
-      <string>Coordinate</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>X:</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QLineEdit" name="lineEditX">
-          <property name="text">
-           <string>0.00</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_5">
-          <property name="text">
-           <string>mm</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>Y:</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLineEdit" name="lineEditY">
-          <property name="text">
-           <string>0.00</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_7">
-          <property name="text">
-           <string>mm</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <spacer name="horizontalSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>125</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="1">
-    <widget class="QPushButton" name="addButton">
-     <property name="text">
-      <string>Add</string>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 12 - 32
src/MainWidgets/TreeWidget.cpp

@@ -117,8 +117,6 @@ namespace MainWidget
 		_MeshData = MeshData::MeshData::getInstance();
 		_gridRoot= new QTreeWidgetItem(this);
 		_gridRoot->setText(0,"网格生成");
-		// _gridRoot->setIcon(0, QIcon(":/QUI/icon/mesh.png"));
-		// _gridRoot->setBackground(0, QBrush(QColor(238, 238, 238)));
 		this->addTopLevelItem(_gridRoot);
 		_gridRoot->setExpanded(true);
 			_meshRoot = new QTreeWidgetItem(_gridRoot, TreeItemType::MeshRoot);
@@ -134,8 +132,6 @@ namespace MainWidget
 		//CFD计算
 		_cfdItem = new QTreeWidgetItem(this);
 		_cfdItem->setText(0,"CFD计算");
-		// _cfdItem->setIcon(0,QIcon(":/QUI/icon/cfdItem.svg"));
-		// _cfdItem->setBackground(0, QBrush(QColor(238, 238, 238)));
 		this->addTopLevelItem(_cfdItem);
 		_cfdItem->setExpanded(true);
 
@@ -192,8 +188,6 @@ namespace MainWidget
 		//IR计算
 		_irItem = new QTreeWidgetItem(this,TreeItemType::IRRoot);
 		_irItem->setText(0,"IR计算");
-		// _irItem->setIcon(0,QIcon(":/QUI/icon/irItem.svg"));
-		// _irItem->setBackground(0, QBrush(QColor(238, 238, 238)));
 
 		this->addTopLevelItem(_irItem);
 		_irItem->setExpanded(true);
@@ -217,18 +211,18 @@ namespace MainWidget
 		_irResultItem = new QTreeWidgetItem(_irItem);
 		_irResultItem->setText(0,"结果");
 		_irResultItem->setIcon(0,QIcon(":/QUI/icons/pqLineChart16.png"));
-			_irFusheqiangdu = new QTreeWidgetItem(_irResultItem);
-			_irFusheqiangdu->setText(0,"角度分布辐射强度");
-			_irMianji = new QTreeWidgetItem(_irResultItem);
-			_irMianji->setText(0,"面积");
-			_irFusheLiangdu = new QTreeWidgetItem(_irResultItem);
-			_irFusheLiangdu->setText(0,"辐射亮度效果图");
-			_irSanweiFushe = new QTreeWidgetItem(_irResultItem);
-			_irSanweiFushe->setText(0,"三维分布辐射效果");
-			_irGuangpuQiangdu = new QTreeWidgetItem(_irResultItem);
-			_irGuangpuQiangdu->setText(0,"光谱强度效果图");
-			_irFusheWendu = new QTreeWidgetItem(_irResultItem);
-			_irFusheWendu->setText(0,"辐射温度图");
+			// _irFusheqiangdu = new QTreeWidgetItem(_irResultItem);
+			// _irFusheqiangdu->setText(0,"角度分布辐射强度");
+			// _irMianji = new QTreeWidgetItem(_irResultItem);
+			// _irMianji->setText(0,"面积");
+			// _irFusheLiangdu = new QTreeWidgetItem(_irResultItem);
+			// _irFusheLiangdu->setText(0,"辐射亮度效果图");
+			// _irSanweiFushe = new QTreeWidgetItem(_irResultItem);
+			// _irSanweiFushe->setText(0,"三维分布辐射效果");
+			// _irGuangpuQiangdu = new QTreeWidgetItem(_irResultItem);
+			// _irGuangpuQiangdu->setText(0,"光谱强度效果图");
+			// _irFusheWendu = new QTreeWidgetItem(_irResultItem);
+			// _irFusheWendu->setText(0,"辐射温度图");
 
 		setStyleSheet("QTreeWidget::item{height:20px;}");
 	}
@@ -244,12 +238,6 @@ namespace MainWidget
 	{
 		_modelRoot->takeChildren();
 
-		// removeItemWidget(_modelRoot, 0);
-		// delete _modelRoot;
-		// _modelRoot = new QTreeWidgetItem(this, TreeItemType::GeometryRoot);
-		// _modelRoot->setText(0, tr("几何模型"));
-		// _modelRoot->setExpanded(true);
-
 		_geoData->sort();
 		blockSignals(true);
 		const int n = _geoData->getGeometrySetCount();
@@ -279,7 +267,6 @@ namespace MainWidget
 					child->setIcon(0, QIcon(":/QUI/icon/geometry.png"));
 					child->setData(0, Qt::UserRole + 1, id);
 					item->setExpanded(true);
-					// qDebug() << "component id:" << id;
 				}
 			}
 		}
@@ -316,8 +303,6 @@ namespace MainWidget
 	void TreeWidget::updateMeshTree()
 	{
 		_meshRoot->takeChildren();
-
-		// _meshRoot->setText(0, "网格");
 		const int n = _MeshData->getKernalCount();
 		blockSignals(true);
 		for (int i = 0; i < n; ++i)
@@ -463,11 +448,6 @@ namespace MainWidget
 			{
 				emit importModel();
 			}
-			// case IRcalc:
-			// {
-			// 	IR::IRCalcDialog dlg ;
-			// 	dlg.exec();
-			// }
 			default:
 				break;
 		}

+ 1 - 29
src/MainWidgets/preWindow.cpp

@@ -7,7 +7,6 @@
 #include "MainWindow/MainWindow.h"
 #include "geometryViewProvider.h"
 #include "meshViewProvider.h"
-#include "sketchViewProvider.h"
 #include "ModuleBase/PreWindowInteractorStyle.h"
 #include <IVtkTools_ShapeDataSource.hxx>
 #include <vtkCamera.h>
@@ -27,7 +26,6 @@ namespace MainWidget
 		_modelData = ModelData::ModelDataSingleton::getinstance();
 		_geoProvider = new GeometryViewProvider(mw, this);
 		_meshProvider = new MeshViewProvider(mw, this);
-		_sketchProvider = new SketchViewProvider(mw, this);
 //		this->setWindowTitle(tr("Pre-Window"));
 //		this->setWindowTitle("三维展示窗口");
 //		this->setWindowFlags()
@@ -62,8 +60,6 @@ namespace MainWidget
 	{
 		if (_geoProvider != nullptr)
 			delete _geoProvider;
-		if (_sketchProvider != nullptr)
-			delete _sketchProvider;
 		if (_meshProvider != nullptr)
 			delete _meshProvider;
 		emit closed();
@@ -173,30 +169,11 @@ namespace MainWidget
 
 	void PreWindow::startSketch(bool start, double *loc, double *dir)
 	{
-		Q_UNUSED(loc)
-		if (start)
-		{
-			vtkCamera *camera = _render->GetActiveCamera();
-			gp_Ax3 *ax3 = Geometry::GeometryData::getInstance()->getSketchPlane();
-			gp_Dir y = ax3->YDirection();
-			camera->SetViewUp(y.X(), y.Y(), y.Z());
-			camera->SetPosition(dir[0], dir[1], dir[2]);
-			camera->SetFocalPoint(0, 0, 0);
-			_interactionStyle->setSelectModel((int)ModuleBase::DrawSketch);
-			this->resetCamera();
-		}
-		else
-		{
-			_interactionStyle->setSelectModel((int)ModuleBase::None);
-			_sketchProvider->setSketchType(ModuleBase::SketchNone);
-		}
-		_sketchProvider->showSketchPlane(start);
-		this->resetCamera();
+
 	}
 
 	void PreWindow::setSketchType(ModuleBase::SketchType t)
 	{
-		_sketchProvider->setSketchType(t);
 	}
 
 	QMultiHash<Geometry::GeometrySet *, int> PreWindow::getGeoSelectItems()
@@ -204,11 +181,6 @@ namespace MainWidget
 		return _geoProvider->getGeoSelectItems();
 	}
 
-	// 	void PreWindow::setGeoSelectItems(QMultiHash<Geometry::GeometrySet*, int> items)
-	// 	{
-	// 		_geoProvider->setGeoSelectItems(items);
-	// 	}
-
 	void PreWindow::highLightGeoComponentSlot(Geometry::GeoComponent *aGC)
 	{
 		auto selectedItems = aGC->getSelectedItems();

+ 0 - 2
src/MainWidgets/preWindow.h

@@ -32,7 +32,6 @@ class TopoDS_Shape;
 namespace MainWidget
 {
 	class GeometryViewProvider;
-	class SketchViewProvider;
 	class MeshViewProvider;
 
 	class MAINWIDGETSAPI PreWindow : public ModuleBase::Graph3DWindow
@@ -126,7 +125,6 @@ namespace MainWidget
 
 		GeometryViewProvider *_geoProvider{};
 		MeshViewProvider *_meshProvider{};
-		SketchViewProvider *_sketchProvider{};
 	};
 }
 

+ 0 - 265
src/MainWidgets/sketchViewProvider.cpp

@@ -1,265 +0,0 @@
-#include "sketchViewProvider.h"
-#include "preWindow.h"
-#include "ModuleBase/PreWindowInteractorStyle.h"
-#include "Geometry/geometryData.h"
-#include "GeometryCommand/GeoSketchCreater.h"
-#include "GeometryWidgets/SketchPointWidget.h"
-#include "MainWindow/MainWindow.h"
-#include <gp_Ax3.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Lin.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <TopoDS_Face.hxx>
-#include <IVtkOCC_Shape.hxx>
-#include <IVtkTools_ShapeDataSource.hxx>
-#include <IVtkTools_DisplayModeFilter.hxx>
-#include <vtkSmartPointer.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkProperty.h>
-#include <vtkActor.h>
-#include <vtkPolyLine.h>
-#include <vtkPolyData.h>
-#include <vtkCellArray.h>
-#include <vtkFloatArray.h>
-#include <vtkCellData.h>
-#include <vtkLookupTable.h>
-#include <Geom_Plane.hxx>
-#include <GeomAPI_ProjectPointOnSurf.hxx>
-#include <QDebug>
-
-namespace MainWidget
-{
-	SketchViewProvider::SketchViewProvider(GUI::MainWindow *mainwindow, PreWindow *preWin)
-		: _mainWindow(mainwindow), _preWindow(preWin)
-	{
-		_interactionStyle = _preWindow->getInteractionStyle();
-		connect(_interactionStyle, SIGNAL(mouseReleasePoint(double *)), this, SLOT(onMouseRelease(double *)));
-		connect(_interactionStyle, SIGNAL(mouseMovePoint(double *)), this, SLOT(onMouseMove(double *)));
-		connect(_interactionStyle, SIGNAL(mouseRightUp()), this, SLOT(onRightMoustRelease()));
-		connect(_interactionStyle, SIGNAL(mouseMiddleUp()), this, SLOT(onMiddleMouseUp()));
-		connect(this, SIGNAL(showSketch(TopoDS_Shape *)), this, SLOT(showSketchSlot(TopoDS_Shape *)));
-		connect(this, SIGNAL(hideSketch(TopoDS_Shape *)), this, SLOT(removeSketchSlot(TopoDS_Shape *)));
-		connect(this, SIGNAL(showMessage(QString)), _mainWindow, SIGNAL(sendInfoToStatesBar(QString)));
-		connect(this, SIGNAL(showDialog(QDialog *)), _mainWindow, SIGNAL(showDialogSig(QDialog *)));
-
-		_geoData = Geometry::GeometryData::getInstance();
-		_tempActor = vtkActor::New();
-		_tempActor->SetVisibility(false);
-		_tempActor->GetProperty()->SetRepresentationToWireframe();
-		_tempActor->GetProperty()->SetColor(1, 1, 1);
-		_tempActor->GetProperty()->SetLineWidth(3);
-
-		_preWindow->AppendActor(_tempActor, ModuleBase::D3, false, false);
-		_creater = new Command::SketchCreater(this, _preWindow, _mainWindow, _tempActor);
-	}
-
-	SketchViewProvider::~SketchViewProvider()
-	{
-		if (_axisXActor != nullptr)
-			_axisXActor->Delete();
-		if (_axisYActor != nullptr)
-			_axisYActor->Delete();
-		if (_tempActor != nullptr)
-			_tempActor->Delete();
-		removeSketchActors();
-		if (_pointWidget != nullptr)
-			delete _pointWidget;
-	}
-
-	void SketchViewProvider::setSketchType(ModuleBase::SketchType t)
-	{
-		_sketchType = t;
-		_creater->setSketchType(t);
-		if (_sketchType == ModuleBase::SketchNone)
-			removeSketchActors();
-	}
-
-	void SketchViewProvider::showSketchPlane(bool show)
-	{
-		if (!show)
-		{
-			if (_axisXActor != nullptr)
-			{
-				_preWindow->RemoveActor(_axisXActor);
-				_axisXActor->Delete();
-				_axisXActor = nullptr;
-			}
-			if (_axisYActor != nullptr)
-			{
-				_preWindow->RemoveActor(_axisYActor);
-				_axisYActor->Delete();
-				_axisYActor = nullptr;
-			}
-			if (_pointWidget != nullptr)
-			{
-				delete _pointWidget;
-				_pointWidget = nullptr;
-			}
-			_tempActor->SetVisibility(false);
-			return;
-		}
-		gp_Ax3 *ax3 = _geoData->getSketchPlane();
-		if (ax3 == nullptr)
-			return;
-		gp_Pnt o = ax3->Location();
-		gp_Dir x = ax3->XDirection();
-		gp_Dir y = ax3->YDirection();
-		double length = _preWindow->getWorldHight();
-		if (length < 10.0)
-			length = 10.0;
-		length /= 4.0;
-		double p0[3] = {o.X(), o.Y(), o.Z()};
-		double p1[3] = {o.X() + x.X() * length, o.Y() + x.Y() * length, o.Z() + x.Z() * length};
-		double p2[3] = {o.X() - x.X() * length, o.Y() - x.Y() * length, o.Z() - x.Z() * length};
-		double p3[3] = {o.X() + y.X() * length, o.Y() + y.Y() * length, o.Z() + y.Z() * length};
-		double p4[3] = {o.X() - y.X() * length, o.Y() - y.Y() * length, o.Z() - y.Z() * length};
-
-		vtkSmartPointer<vtkPoints> pts = vtkSmartPointer<vtkPoints>::New();
-		pts->InsertNextPoint(p1);
-		pts->InsertNextPoint(p2);
-		pts->InsertNextPoint(p3);
-		pts->InsertNextPoint(p4);
-
-		vtkSmartPointer<vtkPolyData> polyx = vtkSmartPointer<vtkPolyData>::New();
-		vtkSmartPointer<vtkPolyData> polyy = vtkSmartPointer<vtkPolyData>::New();
-		polyx->SetPoints(pts);
-		polyy->SetPoints(pts);
-		vtkSmartPointer<vtkPolyLine> polyLine1 = vtkSmartPointer<vtkPolyLine>::New();
-		polyLine1->GetPointIds()->SetNumberOfIds(2);
-		polyLine1->GetPointIds()->SetId(0, 0);
-		polyLine1->GetPointIds()->SetId(1, 1);
-		vtkSmartPointer<vtkPolyLine> polyLine2 = vtkSmartPointer<vtkPolyLine>::New();
-		polyLine2->GetPointIds()->SetNumberOfIds(2);
-		polyLine2->GetPointIds()->SetId(0, 2);
-		polyLine2->GetPointIds()->SetId(1, 3);
-		vtkSmartPointer<vtkCellArray> cell1 = vtkSmartPointer<vtkCellArray>::New();
-		vtkSmartPointer<vtkCellArray> cell2 = vtkSmartPointer<vtkCellArray>::New();
-		cell1->InsertNextCell(polyLine1);
-		cell2->InsertNextCell(polyLine2);
-		polyx->SetLines(cell1);
-		polyy->SetLines(cell2);
-		vtkSmartPointer<vtkPolyDataMapper> mapperx = vtkSmartPointer<vtkPolyDataMapper>::New();
-		mapperx->SetInputData(polyx);
-		_axisXActor = vtkActor::New();
-		_axisXActor->SetMapper(mapperx);
-		_axisXActor->GetProperty()->SetLineWidth(3);
-		_axisXActor->GetProperty()->SetColor(1, 0, 0);
-		vtkSmartPointer<vtkPolyDataMapper> mappery = vtkSmartPointer<vtkPolyDataMapper>::New();
-		mappery->SetInputData(polyy);
-		_axisYActor = vtkActor::New();
-		_axisYActor->SetMapper(mappery);
-		_axisYActor->GetProperty()->SetLineWidth(3);
-		_axisYActor->GetProperty()->SetColor(0, 1, 0);
-		_preWindow->AppendActor(_axisXActor, ModuleBase::D3, false);
-		_preWindow->AppendActor(_axisYActor, ModuleBase::D3, false);
-
-		_pointWidget = new GeometryWidget::SketchPointWidget(_mainWindow, _preWindow, _creater);
-		emit showDialog(_pointWidget);
-	}
-
-	void SketchViewProvider::onMouseRelease(double *pt)
-	{
-		if (_sketchType == ModuleBase::SketchNone)
-			return;
-		gp_Pnt gPt(pt[0], pt[1], pt[2]);
-		_creater->appendPoint(gPt);
-	}
-
-	void SketchViewProvider::onMouseMove(double *pt)
-	{
-		if (_sketchType == ModuleBase::SketchNone)
-			return;
-		gp_Pnt gPt(pt[0], pt[1], pt[2]);
-		gp_Ax3 *p = _geoData->getSketchPlane();
-		Handle(Geom_Plane) gplane = new Geom_Plane(*p);
-		GeomAPI_ProjectPointOnSurf projector1(gPt, gplane);
-		gp_Pnt point = projector1.NearestPoint();
-		_creater->setTempPoint(point);
-		this->pointTo2D(&point);
-	}
-
-	void SketchViewProvider::showSketchSlot(TopoDS_Shape *shape)
-	{
-		IVtkOCC_Shape::Handle aShapeImpl = new IVtkOCC_Shape(*shape);
-		vtkSmartPointer<IVtkTools_ShapeDataSource> DS = vtkSmartPointer<IVtkTools_ShapeDataSource>::New();
-		DS->SetShape(aShapeImpl);
-
-		vtkSmartPointer<vtkPolyDataMapper> Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
-		Mapper->SetInputConnection(DS->GetOutputPort());
-		vtkSmartPointer<vtkActor> Actor = vtkSmartPointer<vtkActor>::New();
-		Actor->SetMapper(Mapper);
-
-		Actor->GetProperty()->SetColor(0, 0, 0);
-		Actor->GetProperty()->SetRepresentationToWireframe();
-		Actor->GetProperty()->SetLineWidth(3);
-		// 		_edgeActors.append(Actor);
-		// 		_actotShapeHash.insert(Actor, index);
-		// 		_setActors.insert(set, Actor);
-		//		Actor->SetVisibility(set->isVisible());
-		Actor->SetPickable(false);
-		_sketchActorHash.insert(shape, Actor);
-		_preWindow->AppendActor(Actor, ModuleBase::D3, true, false);
-	}
-
-	void SketchViewProvider::removeSketchSlot(TopoDS_Shape *shape)
-	{
-		vtkActor *actor = _sketchActorHash.value(shape);
-		_preWindow->RemoveActor(actor);
-		_preWindow->reRender();
-		_sketchActorHash.remove(shape);
-	}
-
-	void SketchViewProvider::removeSketchActors()
-	{
-		QList<vtkActor *> actors = _sketchActorHash.values();
-		const int n = actors.size();
-		for (int i = 0; i < n; ++i)
-		{
-			vtkActor *ac = actors.at(i);
-			_preWindow->RemoveActor(ac);
-		}
-		_sketchActorHash.clear();
-		_preWindow->reRender();
-	}
-
-	void SketchViewProvider::pointTo2D(gp_Pnt *pt)
-	{
-		gp_Ax3 *ax3 = _geoData->getSketchPlane();
-		if (ax3 == nullptr)
-			return;
-		gp_Pnt o = ax3->Location();
-		gp_Dir x = ax3->XDirection();
-		gp_Dir y = ax3->YDirection();
-
-		gp_Lin xAxis(o, x);
-		gp_Lin yAxis(o, y);
-
-		gp_Dir dir(pt->X() - o.X(), pt->Y() - o.Y(), pt->Z() - o.Z());
-		gp_Lin line(o, dir);
-
-		double xcoor = yAxis.Distance(*pt);
-		double ycoor = xAxis.Distance(*pt);
-
-		double anglex = x.Angle(dir);
-		double angley = y.Angle(dir);
-
-		if (anglex > 3.141592653589793238 / 2.0)
-			xcoor *= -1;
-		if (angley > 3.141592653589793238 / 2.0)
-			ycoor *= -1;
-
-		QString text = QString(tr("Location: %1, %2")).arg(xcoor).arg(ycoor);
-		emit showMessage(text);
-	}
-
-	void SketchViewProvider::onRightMoustRelease()
-	{
-		_creater->onMouseRightRelease();
-	}
-
-	void SketchViewProvider::onMiddleMouseUp()
-	{
-		_creater->onMouseMiddleRelease();
-	}
-
-}

+ 0 - 88
src/MainWidgets/sketchViewProvider.h

@@ -1,88 +0,0 @@
-#ifndef SKETCHVIEWPROVIDER_H_
-#define SKETCHVIEWPROVIDER_H_
-
-#include <QObject>
-#include "ModuleBase/ModuleType.h"
-#include <QHash>
-
-class vtkActor;
-class TopoDS_Shape;
-class gp_Pnt;
-class QDialog;
-
-namespace Geometry
-{
-	class GeometryData;
-}
-
-namespace GUI
-{
-	class MainWindow;
-}
-
-namespace ModuleBase
-{
-	class PropPickerInteractionStyle;
-}
-
-namespace Command
-{
-	class SketchCreater;
-}
-
-namespace GeometryWidget
-{
-	class SketchPointWidget;
-}
-
-namespace MainWidget
-{
-	class PreWindow;
-
-	class SketchViewProvider : public QObject
-	{
-		Q_OBJECT
-	public:
-		SketchViewProvider(GUI::MainWindow *mainwindow, PreWindow *preWin);
-		~SketchViewProvider();
-
-		void setSketchType(ModuleBase::SketchType t);
-		void showSketchPlane(bool show);
-
-	signals:
-		void showSketch(TopoDS_Shape *);
-		void hideSketch(TopoDS_Shape *);
-		void showMessage(QString);
-		void showDialog(QDialog *);
-
-	private slots:
-		void onMouseRelease(double *pt);
-		void onMouseMove(double *pt);
-		void onRightMoustRelease();
-		void onMiddleMouseUp();
-
-		void showSketchSlot(TopoDS_Shape *shape);
-		void removeSketchSlot(TopoDS_Shape *shape);
-		void removeSketchActors();
-
-		void pointTo2D(gp_Pnt *p);
-
-	private:
-		GUI::MainWindow *_mainWindow{};
-		PreWindow *_preWindow{};
-		Geometry::GeometryData *_geoData{};
-		GeometryWidget::SketchPointWidget *_pointWidget{};
-
-		ModuleBase::SketchType _sketchType{ModuleBase::SketchNone};
-		ModuleBase::PropPickerInteractionStyle *_interactionStyle{};
-		Command::SketchCreater *_creater{};
-		vtkActor *_axisXActor{};
-		vtkActor *_axisYActor{};
-		vtkActor *_tempActor{};
-
-		QHash<TopoDS_Shape *, vtkActor *> _sketchActorHash{};
-	};
-
-}
-
-#endif