Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:55

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ShapeCustom_HeaderFile
0018 #define _ShapeCustom_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_DataMapOfShapeShape.hxx>
0025 #include <Standard_Real.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 #include <Message_ProgressRange.hxx>
0029 
0030 class TopoDS_Shape;
0031 class BRepTools_Modification;
0032 class BRepTools_Modifier;
0033 class ShapeBuild_ReShape;
0034 class ShapeCustom_RestrictionParameters;
0035 
0036 
0037 //! This package is intended to
0038 //! convert geometrical objects and topological. The
0039 //! modifications of one geometrical object to another
0040 //! (one) geometrical object are provided. The supported
0041 //! modifications are the following:
0042 //! conversion of BSpline and Bezier surfaces to analytical form,
0043 //! conversion of indirect elementary surfaces (with left-handed
0044 //! coordinate systems) into  direct ones,
0045 //! conversion of elementary surfaces to surfaces of revolution,
0046 //! conversion of surface of linear extrusion, revolution, offset
0047 //! surface to bspline,
0048 //! modification of parameterization, degree, number of segments of bspline
0049 //! surfaces,  scale the shape.
0050 class ShapeCustom 
0051 {
0052 public:
0053 
0054   DEFINE_STANDARD_ALLOC
0055 
0056   
0057   //! Applies modifier to shape and checks sharing in the case assemblies.
0058   Standard_EXPORT static TopoDS_Shape ApplyModifier
0059     (const TopoDS_Shape& S, const Handle(BRepTools_Modification)& M,
0060      TopTools_DataMapOfShapeShape& context, BRepTools_Modifier& MD,
0061      const Message_ProgressRange& theProgress = Message_ProgressRange(),
0062      const Handle(ShapeBuild_ReShape)& aReShape = NULL);
0063   
0064   //! Returns a new shape without indirect surfaces.
0065   Standard_EXPORT static TopoDS_Shape DirectFaces (const TopoDS_Shape& S);
0066   
0067   //! Returns a new shape which is scaled original
0068   Standard_EXPORT static TopoDS_Shape ScaleShape (const TopoDS_Shape& S, const Standard_Real scale);
0069   
0070   //! Returns a new shape with all surfaces, curves and pcurves
0071   //! which type is BSpline/Bezier or based on them converted
0072   //! having Degree less than <MaxDegree> or number of spans less
0073   //! than <NbMaxSegment> in dependence on parameter priority <Degree>.
0074   //! <GmaxDegree> and <GMaxSegments> are maximum possible degree
0075   //! and number of spans correspondingly.
0076   //! These values will be used in those cases when approximation with
0077   //! specified parameters is impossible and one of GmaxDegree or
0078   //! GMaxSegments is selected in dependence on priority.
0079   //! Note that even if approximation is impossible with <GMaxDegree>
0080   //! then number of spans can exceed specified <GMaxSegment>
0081   //! <Rational> specifies if to convert Rational BSpline/Bezier into
0082   //! polynomial B-Spline.
0083   //! If flags ConvOffSurf,ConvOffCurve3d,ConvOffCurve2d are Standard_True there are means
0084   //! that Offset surfaces , Offset curves 3d and Offset curves 2d are converted to BSPline
0085   //! correspondingly.
0086   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);
0087   
0088   //! Returns a new shape with all elementary periodic surfaces converted
0089   //! to Geom_SurfaceOfRevolution
0090   Standard_EXPORT static TopoDS_Shape ConvertToRevolution (const TopoDS_Shape& S);
0091   
0092   //! Returns a new shape with all surfaces of revolution and linear extrusion
0093   //! convert to elementary periodic surfaces
0094   Standard_EXPORT static TopoDS_Shape SweptToElementary (const TopoDS_Shape& S);
0095   
0096   //! Returns a new shape with all surfaces of linear extrusion, revolution,
0097   //! offset, and planar surfaces converted according to flags to
0098   //! Geom_BSplineSurface (with same parameterisation).
0099   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);
0100 
0101 };
0102 
0103 #endif // _ShapeCustom_HeaderFile