1 // Created on: 1998-06-03
2 // Created by: data exchange team
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _ShapeCustom_HeaderFile
18 #define _ShapeCustom_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopTools_DataMapOfShapeShape.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Integer.hxx>
27 #include <GeomAbs_Shape.hxx>
28 #include <Standard_Boolean.hxx>
30 class BRepTools_Modification;
31 class BRepTools_Modifier;
32 class Message_ProgressIndicator;
33 class ShapeBuild_ReShape;
34 class ShapeCustom_RestrictionParameters;
35 class ShapeCustom_Surface;
36 class ShapeCustom_Curve;
37 class ShapeCustom_Curve2d;
38 class ShapeCustom_RestrictionParameters;
39 class ShapeCustom_Modification;
40 class ShapeCustom_DirectModification;
41 class ShapeCustom_TrsfModification;
42 class ShapeCustom_BSplineRestriction;
43 class ShapeCustom_ConvertToRevolution;
44 class ShapeCustom_SweptToElementary;
45 class ShapeCustom_ConvertToBSpline;
48 //! This package is intended to
49 //! convert geometrical objects and topological. The
50 //! modifications of one geometrical object to another
51 //! (one) geometrical object are provided. The supported
52 //! modifications are the following:
53 //! conversion of BSpline and Bezier surfaces to analytical form,
54 //! conversion of indirect elementary surfaces (with left-handed
55 //! coordinate systems) into direct ones,
56 //! conversion of elementary surfaces to surfaces of revolution,
57 //! conversion of surface of linear extrusion, revolution, offset
58 //! surface to bspline,
59 //! modification of parameterization, degree, number of segments of bspline
60 //! surfaces, scale the shape.
68 //! Applies modifier to shape and checks sharing in the case assemblies.
69 Standard_EXPORT static TopoDS_Shape ApplyModifier (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M, TopTools_DataMapOfShapeShape& context, BRepTools_Modifier& MD, const Handle(Message_ProgressIndicator)& aProgress = NULL, const Handle(ShapeBuild_ReShape)& aReShape = NULL);
71 //! Returns a new shape without indirect surfaces.
72 Standard_EXPORT static TopoDS_Shape DirectFaces (const TopoDS_Shape& S);
74 //! Returns a new shape which is scaled original
75 Standard_EXPORT static TopoDS_Shape ScaleShape (const TopoDS_Shape& S, const Standard_Real scale);
77 //! Returns a new shape with all surfaces, curves and pcurves
78 //! which type is BSpline/Bezier or based on them converted
79 //! having Degree less than <MaxDegree> or number of spans less
80 //! than <NbMaxSegment> in dependence on parameter priority <Degree>.
81 //! <GmaxDegree> and <GMaxSegments> are maximum possible degree
82 //! and number of spans correspondingly.
83 //! These values will be used in those cases when approximation with
84 //! specified parameters is impossible and one of GmaxDegree or
85 //! GMaxSegments is selected in dependence on priority.
86 //! Note that even if approximation is impossible with <GMaxDegree>
87 //! then number of spans can exceed specified <GMaxSegment>
88 //! <Rational> specifies if to convert Rational BSpline/Bezier into
89 //! polynomial B-Spline.
90 //! If flags ConvOffSurf,ConvOffCurve3d,ConvOffCurve2d are Standard_True there are means
91 //! that Offset surfaces , Offset curves 3d and Offset curves 2d are converted to BSPline
93 Standard_EXPORT static TopoDS_Shape BSplineRestriction (const TopoDS_Shape& S, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer MaxDegree, const Standard_Integer MaxNbSegment, const GeomAbs_Shape Continuity3d, const GeomAbs_Shape Continuity2d, const Standard_Boolean Degree, const Standard_Boolean Rational, const Handle(ShapeCustom_RestrictionParameters)& aParameters);
95 //! Returns a new shape with all elementary periodic surfaces converted
96 //! to Geom_SurfaceOfRevolution
97 Standard_EXPORT static TopoDS_Shape ConvertToRevolution (const TopoDS_Shape& S);
99 //! Returns a new shape with all surfaces of revolution and linear extrusion
100 //! convert to elementary periodic surfaces
101 Standard_EXPORT static TopoDS_Shape SweptToElementary (const TopoDS_Shape& S);
103 //! Returns a new shape with all surfaces of linear extrusion, revolution,
104 //! offset, and planar surfaces converted according to flags to
105 //! Geom_BSplineSurface (with same parameterisation).
106 Standard_EXPORT static TopoDS_Shape ConvertToBSpline (const TopoDS_Shape& S, const Standard_Boolean extrMode, const Standard_Boolean revolMode, const Standard_Boolean offsetMode, const Standard_Boolean planeMode = Standard_False);
122 friend class ShapeCustom_Surface;
123 friend class ShapeCustom_Curve;
124 friend class ShapeCustom_Curve2d;
125 friend class ShapeCustom_RestrictionParameters;
126 friend class ShapeCustom_Modification;
127 friend class ShapeCustom_DirectModification;
128 friend class ShapeCustom_TrsfModification;
129 friend class ShapeCustom_BSplineRestriction;
130 friend class ShapeCustom_ConvertToRevolution;
131 friend class ShapeCustom_SweptToElementary;
132 friend class ShapeCustom_ConvertToBSpline;
142 #endif // _ShapeCustom_HeaderFile