Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:47:36

0001 // Created on: 1996-10-02
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1996-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 _LocOpe_SplitDrafts_HeaderFile
0018 #define _LocOpe_SplitDrafts_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 #include <TopoDS_Shape.hxx>
0024 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0025 #include <TopTools_ListOfShape.hxx>
0026 
0027 class TopoDS_Face;
0028 class TopoDS_Wire;
0029 class gp_Dir;
0030 class gp_Pln;
0031 
0032 //! This  class  provides  a    tool to   realize  the
0033 //! following operations on a shape :
0034 //! - split a face of the shape with a wire,
0035 //! - put draft angle on both side of the wire.
0036 //! For each side, the draft angle may be different.
0037 class LocOpe_SplitDrafts 
0038 {
0039 public:
0040 
0041   DEFINE_STANDARD_ALLOC
0042 
0043   //! Empty constructor.
0044   LocOpe_SplitDrafts() {}
0045 
0046   //! Creates the algorithm on the shape <S>.
0047   LocOpe_SplitDrafts(const TopoDS_Shape& S) : myShape (S) {}
0048   
0049   //! Initializes the algorithm with the shape <S>.
0050   Standard_EXPORT void Init (const TopoDS_Shape& S);
0051   
0052   //! Splits the face <F> of the former given shape with
0053   //! the wire  <W>.  The wire is  assumed to lie on the
0054   //! face.    Puts a draft  angle on  both parts of the
0055   //! wire.    <Extractg>,  <Nplg>, <Angleg> define  the
0056   //! arguments  for   the   left  part   of the   wire.
0057   //! <Extractd>,  <Npld>, <Angled> define the arguments
0058   //! for the right part of the wire. The draft angle is
0059   //! measured    with the  direction  <Extract>.  <Npl>
0060   //! defines the neutral plane (points belonging to the
0061   //! neutral plane are not  modified).  <Angle> is  the
0062   //! value of the draft  angle.  If <ModifyLeft> is set
0063   //! to <Standard_False>, no draft  angle is applied to
0064   //! the left part of the wire. If <ModifyRight> is set
0065   //! to <Standard_False>,no draft  angle  is applied to
0066   //! the right part of the wire.
0067   Standard_EXPORT void Perform (const TopoDS_Face& F, const TopoDS_Wire& W, const gp_Dir& Extractg, const gp_Pln& NPlg, const Standard_Real Angleg, const gp_Dir& Extractd, const gp_Pln& NPld, const Standard_Real Angled, const Standard_Boolean ModifyLeft = Standard_True, const Standard_Boolean ModifyRight = Standard_True);
0068   
0069   //! Splits the face <F> of the former given shape with
0070   //! the  wire <W>.  The wire is  assumed to lie on the
0071   //! face.  Puts a draft angle  on the left part of the
0072   //! wire.   The draft    angle is   measured  with the
0073   //! direction  <Extract>.   <Npl> defines the  neutral
0074   //! plane (points belonging  to the neutral plane  are
0075   //! not modified). <Angle> is  the value of  the draft
0076   //! angle.
0077   Standard_EXPORT void Perform (const TopoDS_Face& F, const TopoDS_Wire& W, const gp_Dir& Extract, const gp_Pln& NPl, const Standard_Real Angle);
0078   
0079   //! Returns <Standard_True> if the modification has been successfully performed.
0080   Standard_Boolean IsDone() const { return !myResult.IsNull(); }
0081 
0082   const TopoDS_Shape& OriginalShape() const { return myShape; }
0083 
0084   //! Returns the modified shape.
0085   Standard_EXPORT const TopoDS_Shape& Shape() const;
0086 
0087   //! Manages the descendant shapes.
0088   Standard_EXPORT const TopTools_ListOfShape& ShapesFromShape (const TopoDS_Shape& S) const;
0089 
0090 private:
0091 
0092   TopoDS_Shape myShape;
0093   TopoDS_Shape myResult;
0094   TopTools_DataMapOfShapeListOfShape myMap;
0095 
0096 };
0097 
0098 #endif // _LocOpe_SplitDrafts_HeaderFile