COMPASSi/trunk/code/inc/OCC/OCCModeling/Stdafx_M.h

301 lines
7.8 KiB
C++

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#ifdef _WIN32
#include <windows.h>
#else
#endif
//standard OCC types
#pragma warning( disable : 4311 )
#pragma warning( disable : 4312 )
#pragma warning( disable : 4267 )
#pragma warning( disable : 4819 )
#pragma warning( disable : 4018 )
#pragma warning( disable : 4800 )
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_Version.hxx>
//#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TColgp_Array1OfVec.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
//for OCC graphic
//2016srq
//#include <WNT_Window.hxx>
//#include <Graphic3d_WNTGraphicDevice.hxx>
//#include <Quantity_NameOfColor.hxx>
//
//#include <V3d_Viewer.hxx>
//#include <V3d_View.hxx>
//#include <V3d_TypeOfOrientation.hxx>
//
//#include <AIS_InteractiveContext.hxx>
//#include <AIS_Shape.hxx>
//#include <AIS_Trihedron.hxx>
//#include <AIS_DisplayMode.hxx>
//
//#include <V3d_Plane.hxx>
////#include <AIS_Point.hxx>
//#include <AIS_Drawer.hxx>
//#include <AIS_ListOfInteractive.hxx>
//#include <AIS_ListIteratorOfListOfInteractive.hxx>
//#include <Prs3d_TextAspect.hxx>
//#include <Prs3d_ArrowAspect.hxx>
//#include <Prs3d_PointAspect.hxx>
//#include <Prs3d_IsoAspect.hxx>
/* 20200602 by czb
#include "AnyCoreBaseInclude.h"
#include "AnyVizBase.h"
#include "AnyVizRender.h"
#include "AnyVizGL.h"
#include "AnyVizBridge.h"
#include "Scene\ASelectedShapeQuery.h"
*/
//end 2016srq
//topology
//#include <Poly_Array1OfTriangle.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Builder.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <GCPnts_TangentialDeflection.hxx>
//brep tools
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
// #include <MgtBRep.hxx> // XUEFENG DELETE 202101
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <BRepFeat_SplitShape.hxx>//srq 2012-2-18
#include <BRepAlgoAPI_Section.hxx>//srq 2012-2-18
#include <BRepPrimAPI_MakeHalfSpace.hxx>//srq 2012-2-18
#include <BRepAlgoAPI_Cut.hxx>//srq 2012-2-18
#include <IntTools_FaceFace.hxx>//srq 2012-2-22
#include <IntTools_Curve.hxx>//srq 2012-2-22
//#include <BRepAlgo_Section.hxx>//srq 2012-2-23
#include <BRepAlgoAPI_Section.hxx>
#include <ShapeFix_Shape.hxx>//srq 2012-2-24
#include <TopOpeBRep_FacesIntersector.hxx>//srq 2012-2-27
#include <TColGeom_HSequenceOfCurve.hxx>//srq 2012-2-27
#include <TopOpeBRep_HArray1OfLineInter.hxx>//srq 2012-2-27
#include <TopOpeBRepTool_OutCurveType.hxx>//srq 2012-2-28
#include <GeomLib_IsPlanarSurface.hxx>//srq 2012-3-1
#include <BRepPrimAPI_MakePrism.hxx>//srq 2012-3-1
#include <BRepBuilderAPI_Transform.hxx>//srq 2012-3-1
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <TopTools_ListOfShape.hxx>
// #include <BOPTools_DSFiller.hxx> // XUEFENG DELETE 202101
#include <BRepAlgoAPI_Section.hxx>//srq 2012-2-23
#include <BRepAdaptor_CompCurve.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Approx_Curve3d.hxx>
//#include <BRepMesh.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <TopoDS_Shape.hxx>
#include <BRepMesh_Deflection.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepTools_ReShape.hxx>
#include <LocOpe_SplitShape.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <Geom2dLProp_CurAndInf2d.hxx>
#include <GeomAPI.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <GeomAbs_CurveType.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <Prs3d_Presentation.hxx>
#include <BRepAlgo.hxx>
#include <BRep_Tool.hxx>
#include <BRep_PointOnCurve.hxx>
#include <BRepExtrema_ExtCC.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepOffsetAPI_MakePipeShell.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepOffsetAPI_ThruSections.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include <BRepOffsetAPI_Sewing.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
#include <GeomAPI_Interpolate.hxx>
// #include <Handle_Geom_Plane.hxx> // XUEFENG DELETE 202101
#include <Geom_Plane.hxx>
#include <gp.hxx>
#include <gp_Trsf.hxx>
#include <gp_Dir.hxx>
#include <gp_Circ.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
#include <gp_Elips.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Line.hxx>
#include <Geom_Hyperbola.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Parabola.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Geom_BSplineCurve.hxx>
#include "GC_MakePlane.hxx"
#include "GC_MakeArcOfEllipse.hxx"
#include "GC_MakeArcOfParabola.hxx"
#include "gce_MakeParab.hxx"
#include <GeomAPI_IntCS.hxx>
#include <GeomAPI_IntSS.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_PointsToBSplineSurface.hxx>
#include <GeomFill_BSplineCurves.hxx>
#include <GeomFill_Pipe.hxx>
#include <GeomConvert.hxx>
#include <ElSLib.hxx>
#include <ProjLib.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
//csfdb I/E
//#include <FSD_File.hxx>
//#include <ShapeSchema.hxx>
//#include <Storage_Data.hxx>
//#include <Storage_Error.hxx>
//#include <Storage_HSeqOfRoot.hxx>
//#include <Storage_Root.hxx>
//#include <PTopoDS_HShape.hxx>
//#include <PTColStd_TransientPersistentMap.hxx>
// iges I/E
#include <IGESControl_Reader.hxx>
#include <IGESControl_Controller.hxx>
#include <IGESControl_Writer.hxx>
#include <IFSelect_ReturnStatus.hxx>
#include <Interface_Static.hxx>
//step I/E
#include <STEPControl_Reader.hxx>
#include <STEPControl_Writer.hxx>
//for stl export
//#include <StlAPI_Writer.hxx>
//for vrml export
//#include <VrmlAPI_Writer.hxx>
//#include <IFSelect_ReturnStatus.hxx>
//#include <STEPControl_StepModelType.hxx>
//#include <TopTools_HSequenceOfShape.hxx>
#ifdef _WIN32
#include "atlstr.h"
#include <winbase.h>
#else
#endif
#include <string>
//#include <assert.h>
//#include <cassert>
#include <stdlib.h>
#include <map>
#include <list>
#include <vector>
#include <set>
#include <algorithm>
//#include <limits>
//#include <numeric>
//
#include "Aspect_Handle.hxx"
#include <iosfwd>
using namespace std;
inline string CreateTempPath()
{
//保存路径的数组
char path[1000];
//路径的长度
int fileLen = 0;//=GetModuleFileName(NULL,path,1000);
string p = path;
int index = p.rfind('\\');
string filePath = p.substr(0,index+1);
return filePath;
}
inline bool isExistFile(string path)
{
//return (_access( ( tempPath + file).c_str(), 0 )) != -1 ;
//WIN32_FIND_DATA FindFileData;
//HANDLE hFind;
//hFind = FindFirstFile(path.c_str(), &FindFileData);
//return hFind != INVALID_HANDLE_VALUE;
return false;
}
inline string iToString(int i)
{
string str;
stringstream ss;
ss<<i;
ss>>str;
return str;
}
inline void WriteLog(const char* str)
{
if(str == NULL)
{
return;
}
ofstream f;
f.open("log.txt", ios::app);
string s = "\r\n";
f.write(str, strlen(str));
f.write(s.c_str(), strlen(s.c_str()));
f.close();
}
//static string tempPath = "..\\..\\..\\bin\\Debug\\Data\\temp\\";
static string tempPath = CreateTempPath() + "Data\\temp\\";