275 lines
7.4 KiB
C
275 lines
7.4 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 )
|
|||
|
//#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>
|
|||
|
#include <Bnd_Box.hxx>
|
|||
|
//#include "AnyCoreBaseInclude.h"
|
|||
|
//#include "AnyVizBase.h"
|
|||
|
//#include "AnyVizRender.h"
|
|||
|
//#include "AnyVizGL.h"
|
|||
|
//#include "AnyVizBridge.h"
|
|||
|
#ifdef _WIN32
|
|||
|
#include <winbase.h>
|
|||
|
#else
|
|||
|
#endif
|
|||
|
#include "Aspect_Handle.hxx"
|
|||
|
#include <iosfwd>
|
|||
|
//end 2016srq
|
|||
|
|
|||
|
|
|||
|
//topology
|
|||
|
#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 <TopTools_ListIteratorOfListOfShape.hxx> //pj
|
|||
|
//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 <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 <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 <BOPTools_DSFiller.hxx> // XUEFENG DELETE 202101
|
|||
|
#include <BRepAlgoAPI_Section.hxx>//srq 2012-2-23
|
|||
|
#include <BRepAdaptor_CompCurve.hxx>
|
|||
|
//#include <Adaptor3d_HCurve.hxx>
|
|||
|
#include <Adaptor3d_Curve.hxx> // <20><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#include <Geom_Curve.hxx> // ֱ<>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#include <TopTools_ListOfShape.hxx>
|
|||
|
#include <Approx_Curve3d.hxx>
|
|||
|
//#include <BRepMesh.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>
|
|||
|
// <20>滻Ϊ<E6BBBB>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
|
|||
|
#include <GeomAdaptor_Curve.hxx> // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#include <Adaptor3d_Curve.hxx> // ͨ<><CDA8>3D<33><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
|||
|
|
|||
|
#include <NCollection_Sequence.hxx>
|
|||
|
#include <Bnd_Box.hxx>
|
|||
|
#include <BRepAlgo.hxx>
|
|||
|
#include <BRep_Tool.hxx>
|
|||
|
#include <Prs3d_Presentation.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 202009
|
|||
|
#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 <GProp_GProps.hxx> //PJ
|
|||
|
//#include <brepgprop.hxx>
|
|||
|
#include <BRepGProp.hxx> //PJ
|
|||
|
|
|||
|
//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" //pj
|
|||
|
#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 "time.h"
|
|||
|
#include "CommonType.h"
|
|||
|
|
|||
|
using namespace std;
|
|||
|
|
|||
|
static int ppppp = 0;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
typedef int BOOL;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#ifndef FALSE
|
|||
|
#define FALSE 0
|
|||
|
#endif
|
|||
|
|
|||
|
#ifndef TRUE
|
|||
|
#define TRUE 1
|
|||
|
#endif
|
|||
|
|
|||
|
#ifndef Standard_PI
|
|||
|
#define Standard_PI 3.14159
|
|||
|
#endif
|
|||
|
// END ADDED
|