Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1999-04-15
0002 // Created by: Roman LYGIN
0003 // Copyright (c) 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 _ShapeUpgrade_WireDivide_HeaderFile
0018 #define _ShapeUpgrade_WireDivide_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <TopoDS_Wire.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <ShapeUpgrade_Tool.hxx>
0027 #include <ShapeExtend_Status.hxx>
0028 class ShapeUpgrade_SplitCurve3d;
0029 class ShapeUpgrade_SplitCurve2d;
0030 class ShapeUpgrade_EdgeDivide;
0031 class ShapeAnalysis_TransferParameters;
0032 class ShapeUpgrade_FixSmallCurves;
0033 class Geom_Surface;
0034 class TopoDS_Edge;
0035 class TopLoc_Location;
0036 
0037 // resolve name collisions with X11 headers
0038 #ifdef Status
0039   #undef Status
0040 #endif
0041 
0042 class ShapeUpgrade_WireDivide;
0043 DEFINE_STANDARD_HANDLE(ShapeUpgrade_WireDivide, ShapeUpgrade_Tool)
0044 
0045 //! Divides edges in the wire lying on the face or free wires or
0046 //! free edges with a criterion.
0047 //! Splits 3D curve and pcurve(s) of the edge on the face.
0048 //! Other pcurves which may be associated with the edge are simply
0049 //! copied.
0050 //! If 3D curve is split then pcurve on the face is split as
0051 //! well, and vice-versa.
0052 //! Input shape is not modified.
0053 //! The modifications made are recorded in external context
0054 //! (ShapeBuild_ReShape). This tool is applied to all edges
0055 //! before splitting them in order to keep sharing.
0056 class ShapeUpgrade_WireDivide : public ShapeUpgrade_Tool
0057 {
0058 
0059 public:
0060 
0061   
0062   //! Empty constructor
0063   Standard_EXPORT ShapeUpgrade_WireDivide();
0064   
0065   //! Initializes by wire and face
0066   Standard_EXPORT void Init (const TopoDS_Wire& W, const TopoDS_Face& F);
0067   
0068   //! Initializes by wire and surface
0069   Standard_EXPORT void Init (const TopoDS_Wire& W, const Handle(Geom_Surface)& S);
0070   
0071   //! Loads working wire
0072   Standard_EXPORT void Load (const TopoDS_Wire& W);
0073   
0074   //! Creates wire of one edge and calls Load for wire
0075   Standard_EXPORT void Load (const TopoDS_Edge& E);
0076   
0077   //! Sets supporting surface by face
0078   Standard_EXPORT void SetFace (const TopoDS_Face& F);
0079   
0080   //! Sets supporting surface
0081   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& S);
0082   
0083   //! Sets supporting surface with location
0084   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& S, const TopLoc_Location& L);
0085   
0086   //! Computes the resulting wire by splitting all the edges
0087   //! according to splitting criteria.
0088   //! All the modifications made are recorded in context
0089   //! (ShapeBuild_ReShape). This tool is applied to all edges
0090   //! before splitting them in order to keep sharings.
0091   //! If no supporting face or surface is defined, only 3d
0092   //! splitting criteria are used.
0093   Standard_EXPORT virtual void Perform();
0094   
0095   //! Gives the resulting Wire (equal to initial one if not done
0096   //! or Null if not loaded)
0097   Standard_EXPORT const TopoDS_Wire& Wire() const;
0098   
0099   //! Queries status of last call to Perform()
0100   //! OK - no edges were split, wire left untouched
0101   //! DONE1 - some edges were split
0102   //! FAIL1 - some edges have no 3d curve (skipped)
0103   //! FAIL2 - some edges have no pcurve (skipped)
0104   Standard_EXPORT Standard_Boolean Status (const ShapeExtend_Status status) const;
0105   
0106   //! Sets the tool for splitting 3D curves.
0107   Standard_EXPORT void SetSplitCurve3dTool (const Handle(ShapeUpgrade_SplitCurve3d)& splitCurve3dTool);
0108   
0109   //! Sets the tool for splitting pcurves.
0110   Standard_EXPORT void SetSplitCurve2dTool (const Handle(ShapeUpgrade_SplitCurve2d)& splitCurve2dTool);
0111   
0112   //! Sets the tool for Transfer parameters between curves and pcurves.
0113   Standard_EXPORT void SetTransferParamTool (const Handle(ShapeAnalysis_TransferParameters)& TransferParam);
0114   
0115   //! Sets tool for splitting edge
0116   Standard_EXPORT void SetEdgeDivideTool (const Handle(ShapeUpgrade_EdgeDivide)& edgeDivideTool);
0117   
0118   //! returns tool for splitting edges
0119   Standard_EXPORT virtual Handle(ShapeUpgrade_EdgeDivide) GetEdgeDivideTool() const;
0120   
0121   //! Returns the tool for Transfer of parameters.
0122   Standard_EXPORT virtual Handle(ShapeAnalysis_TransferParameters) GetTransferParamTool();
0123   
0124   //! Sets mode for splitting 3d curves from edges.
0125   //! 0 - only curve 3d from free edges.
0126   //! 1 - only curve 3d from shared edges.
0127   //! 2 -  all curve 3d.
0128   Standard_EXPORT void SetEdgeMode (const Standard_Integer EdgeMode);
0129   
0130   //! Sets tool for fixing small curves with specified min tolerance;
0131   Standard_EXPORT void SetFixSmallCurveTool (const Handle(ShapeUpgrade_FixSmallCurves)& FixSmallCurvesTool);
0132   
0133   //! Returns tool for fixing small curves
0134   Standard_EXPORT Handle(ShapeUpgrade_FixSmallCurves) GetFixSmallCurveTool() const;
0135 
0136 
0137 
0138 
0139   DEFINE_STANDARD_RTTIEXT(ShapeUpgrade_WireDivide,ShapeUpgrade_Tool)
0140 
0141 protected:
0142 
0143   
0144   //! Returns the tool for splitting 3D curves.
0145   Standard_EXPORT virtual Handle(ShapeUpgrade_SplitCurve3d) GetSplitCurve3dTool() const;
0146   
0147   //! Returns the tool for splitting pcurves.
0148   Standard_EXPORT virtual Handle(ShapeUpgrade_SplitCurve2d) GetSplitCurve2dTool() const;
0149 
0150   TopoDS_Face myFace;
0151   TopoDS_Wire myWire;
0152   Standard_Integer myStatus;
0153   Standard_Integer myEdgeMode;
0154 
0155 
0156 private:
0157 
0158 
0159   Handle(ShapeUpgrade_SplitCurve3d) mySplitCurve3dTool;
0160   Handle(ShapeUpgrade_SplitCurve2d) mySplitCurve2dTool;
0161   Handle(ShapeUpgrade_EdgeDivide) myEdgeDivide;
0162   Handle(ShapeAnalysis_TransferParameters) myTransferParamTool;
0163   Handle(ShapeUpgrade_FixSmallCurves) myFixSmallCurveTool;
0164 
0165 
0166 };
0167 
0168 
0169 
0170 
0171 
0172 
0173 
0174 #endif // _ShapeUpgrade_WireDivide_HeaderFile