Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:24

0001 // Created on: 1994-08-30
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1994-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 _Draft_Modification_HeaderFile
0018 #define _Draft_Modification_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Draft_IndexedDataMapOfFaceFaceInfo.hxx>
0024 #include <Draft_IndexedDataMapOfEdgeEdgeInfo.hxx>
0025 #include <Draft_IndexedDataMapOfVertexVertexInfo.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <Draft_ErrorStatus.hxx>
0028 #include <TopoDS_Face.hxx>
0029 #include <TopTools_ListOfShape.hxx>
0030 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0031 #include <BRepTools_Modification.hxx>
0032 #include <GeomAbs_Shape.hxx>
0033 #include <TopAbs_Orientation.hxx>
0034 class gp_Dir;
0035 class gp_Pln;
0036 class Geom_Surface;
0037 class TopLoc_Location;
0038 class TopoDS_Edge;
0039 class Geom_Curve;
0040 class TopoDS_Vertex;
0041 class gp_Pnt;
0042 class Geom2d_Curve;
0043 
0044 
0045 class Draft_Modification;
0046 DEFINE_STANDARD_HANDLE(Draft_Modification, BRepTools_Modification)
0047 
0048 
0049 class Draft_Modification : public BRepTools_Modification
0050 {
0051 
0052 public:
0053 
0054   
0055   Standard_EXPORT Draft_Modification(const TopoDS_Shape& S);
0056   
0057   //! Resets on the same shape.
0058   Standard_EXPORT void Clear();
0059   
0060   //! Changes the basis shape and resets.
0061   Standard_EXPORT void Init (const TopoDS_Shape& S);
0062   
0063   //! Adds  the  face  F    and propagates    the  draft
0064   //! modification to  its  neighbour faces if they  are
0065   //! tangent. If an error occurs, will return False and
0066   //! ProblematicShape  will  return the "bad" face.
0067   Standard_EXPORT Standard_Boolean Add (const TopoDS_Face& F, const gp_Dir& Direction, const Standard_Real Angle, const gp_Pln& NeutralPlane, const Standard_Boolean Flag = Standard_True);
0068   
0069   //! Removes the face F and the neighbour faces if they
0070   //! are tangent.   It will be  necessary to  call this
0071   //! method if  the  method Add returns Standard_False,
0072   //! to unset ProblematicFace.
0073   Standard_EXPORT void Remove (const TopoDS_Face& F);
0074   
0075   //! Performs the draft angle modification and sets the
0076   //! value returned by the method  IsDone.  If an error
0077   //! occurs, IsDone  will return Standard_False, and an
0078   //! error status will  be  given by the  method Error,
0079   //! and the  shape on which  the problem appeared will
0080   //! be given by ProblematicShape
0081   Standard_EXPORT void Perform();
0082   
0083   //! Returns  True  if   Perform has  been  successfully
0084   //! called. Otherwise more information can be obtained
0085   //! using the methods Error() and ProblematicShape().
0086   Standard_EXPORT Standard_Boolean IsDone() const;
0087   
0088   Standard_EXPORT Draft_ErrorStatus Error() const;
0089   
0090   //! Returns the shape (Face,  Edge or Vertex) on which
0091   //! an error occurred.
0092   Standard_EXPORT const TopoDS_Shape& ProblematicShape() const;
0093   
0094   //! Returns all  the  faces   which  have been   added
0095   //! together with the face <F>.
0096   Standard_EXPORT const TopTools_ListOfShape& ConnectedFaces (const TopoDS_Face& F);
0097   
0098   //! Returns all the faces  on which a modification has
0099   //! been given.
0100   Standard_EXPORT const TopTools_ListOfShape& ModifiedFaces();
0101   
0102   //! Returns Standard_True if   the face <F>  has  been
0103   //! modified.  In this case,  <S> is the new geometric
0104   //! support of the  face,  <L> the new  location,<Tol>
0105   //! the   new tolerance.<RevWires>  has  to  be set to
0106   //! Standard_True when   the modification reverses the
0107   //! normal   of  the  surface.(the  wires   have to be
0108   //! reversed).  <RevFace>    has    to  be   set    to
0109   //! Standard_True  if  the orientation of the modified
0110   //! face changes in  the shells which contain it. Here
0111   //! it will be set to Standard_False.
0112   //!
0113   //! Otherwise, returns Standard_False, and <S>,   <L>,
0114   //! <Tol> , <RevWires> ,<RevFace> are not  significant.
0115   Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace) Standard_OVERRIDE;
0116   
0117   //! Returns Standard_True  if  the edge  <E> has  been
0118   //! modified.  In this case,  <C> is the new geometric
0119   //! support of the  edge, <L> the  new location, <Tol>
0120   //! the         new    tolerance.   Otherwise, returns
0121   //! Standard_False,    and  <C>,  <L>,   <Tol> are not
0122   //! significant.
0123   Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C, TopLoc_Location& L, Standard_Real& Tol) Standard_OVERRIDE;
0124   
0125   //! Returns  Standard_True if the  vertex <V> has been
0126   //! modified.  In this  case, <P> is the new geometric
0127   //! support of the vertex,   <Tol> the new  tolerance.
0128   //! Otherwise, returns Standard_False, and <P>,  <Tol>
0129   //! are not significant.
0130   Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol) Standard_OVERRIDE;
0131   
0132   //! Returns Standard_True if  the edge  <E> has a  new
0133   //! curve on surface on the face <F>.In this case, <C>
0134   //! is the new geometric support of  the edge, <L> the
0135   //! new location, <Tol> the new tolerance.
0136   //!
0137   //! Otherwise, returns  Standard_False, and <C>,  <L>,
0138   //! <Tol> are not significant.
0139   //!
0140   //! <NewE> is the new  edge created from  <E>.  <NewF>
0141   //! is the new face created from <F>. They may be useful.
0142   Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F, const TopoDS_Edge& NewE, const TopoDS_Face& NewF, Handle(Geom2d_Curve)& C, Standard_Real& Tol) Standard_OVERRIDE;
0143   
0144   //! Returns Standard_True if the Vertex  <V> has a new
0145   //! parameter on the  edge <E>. In  this case,  <P> is
0146   //! the parameter,    <Tol>  the     new    tolerance.
0147   //! Otherwise, returns Standard_False, and <P>,  <Tol>
0148   //! are not significant.
0149   Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E, Standard_Real& P, Standard_Real& Tol) Standard_OVERRIDE;
0150   
0151   //! Returns the  continuity of  <NewE> between <NewF1>
0152   //! and <NewF2>.
0153   //!
0154   //! <NewE> is the new  edge created from <E>.  <NewF1>
0155   //! (resp. <NewF2>) is the new  face created from <F1>
0156   //! (resp. <F2>).
0157   Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, const TopoDS_Edge& NewE, const TopoDS_Face& NewF1, const TopoDS_Face& NewF2) Standard_OVERRIDE;
0158 
0159 
0160 
0161 
0162   DEFINE_STANDARD_RTTIEXT(Draft_Modification,BRepTools_Modification)
0163 
0164 protected:
0165 
0166 
0167 
0168 
0169 private:
0170 
0171   
0172   Standard_EXPORT Standard_Boolean InternalAdd (const TopoDS_Face& F, const gp_Dir& Direction, const Standard_Real Angle, const gp_Pln& NeutralPlane, const Standard_Boolean Flag = Standard_True);
0173   
0174   Standard_EXPORT Standard_Boolean Propagate();
0175   
0176   Standard_EXPORT Handle(Geom_Curve) NewCurve (const Handle(Geom_Curve)& C, const Handle(Geom_Surface)& S, const TopAbs_Orientation OriS, const gp_Dir& Direction, const Standard_Real Angle, const gp_Pln& NeutralPlane, const Standard_Boolean Flag = Standard_True);
0177   
0178   Standard_EXPORT Handle(Geom_Surface) NewSurface (const Handle(Geom_Surface)& S, const TopAbs_Orientation OriS, const gp_Dir& Direction, const Standard_Real Angle, const gp_Pln& NeutralPlane);
0179 
0180   Draft_IndexedDataMapOfFaceFaceInfo myFMap;
0181   Draft_IndexedDataMapOfEdgeEdgeInfo myEMap;
0182   Draft_IndexedDataMapOfVertexVertexInfo myVMap;
0183   Standard_Boolean myComp;
0184   TopoDS_Shape myShape;
0185   TopoDS_Shape badShape;
0186   Draft_ErrorStatus errStat;
0187   TopoDS_Face curFace;
0188   TopTools_ListOfShape conneF;
0189   TopTools_IndexedDataMapOfShapeListOfShape myEFMap;
0190 
0191 
0192 };
0193 
0194 
0195 
0196 
0197 
0198 
0199 
0200 #endif // _Draft_Modification_HeaderFile