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 _ShapeBuild_ReShape_HeaderFile
0018 #define _ShapeBuild_ReShape_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <BRepTools_ReShape.hxx>
0024 #include <TopAbs_ShapeEnum.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <ShapeExtend_Status.hxx>
0027 class TopoDS_Shape;
0028 
0029 // resolve name collisions with X11 headers
0030 #ifdef Status
0031   #undef Status
0032 #endif
0033 
0034 class ShapeBuild_ReShape;
0035 DEFINE_STANDARD_HANDLE(ShapeBuild_ReShape, BRepTools_ReShape)
0036 
0037 //! Rebuilds a Shape by making pre-defined substitutions on some
0038 //! of its components
0039 //!
0040 //! In a first phase, it records requests to replace or remove
0041 //! some individual shapes
0042 //! For each shape, the last given request is recorded
0043 //! Requests may be applied "Oriented" (i.e. only to an item with
0044 //! the SAME orientation) or not (the orientation of replacing
0045 //! shape is respectful of that of the original one)
0046 //!
0047 //! Then, these requests may be applied to any shape which may
0048 //! contain one or more of these individual shapes
0049 class ShapeBuild_ReShape : public BRepTools_ReShape
0050 {
0051 
0052 public:
0053 
0054   
0055   //! Returns an empty Reshape
0056   Standard_EXPORT ShapeBuild_ReShape();
0057 
0058   //! Applies the substitutions requests to a shape
0059   //!
0060   //! <until> gives the level of type until which requests are taken
0061   //! into account. For subshapes of the type <until> no rebuild
0062   //! and further exploring are done.
0063   //! ACTUALLY, NOT IMPLEMENTED BELOW  TopAbs_FACE
0064   //!
0065   //! <buildmode> says how to do on a SOLID,SHELL ... if one of its
0066   //! sub-shapes has been changed:
0067   //! 0: at least one Replace or Remove -> COMPOUND, else as such
0068   //! 1: at least one Remove (Replace are ignored) -> COMPOUND
0069   //! 2: Replace and Remove are both ignored
0070   //! If Replace/Remove are ignored or absent, the result as same
0071   //! type as the starting shape
0072   Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until, const Standard_Integer buildmode);
0073   
0074   //! Applies the substitutions requests to a shape.
0075   //!
0076   //! <until> gives the level of type until which requests are taken
0077   //! into account. For subshapes of the type <until> no rebuild
0078   //! and further exploring are done.
0079   //!
0080   //! NOTE: each subshape can be replaced by shape of the same type
0081   //! or by shape containing only shapes of that type (for
0082   //! example, TopoDS_Edge can be replaced by TopoDS_Edge,
0083   //! TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges).
0084   //! If incompatible shape type is encountered, it is ignored
0085   //! and flag FAIL1 is set in Status.
0086   Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until = TopAbs_SHAPE) Standard_OVERRIDE;
0087   
0088   //! Returns a complete substitution status for a shape
0089   //! 0  : not recorded,   <newsh> = original <shape>
0090   //! < 0: to be removed,  <newsh> is NULL
0091   //! > 0: to be replaced, <newsh> is a new item
0092   //! If <last> is False, returns status and new shape recorded in
0093   //! the map directly for the shape, if True and status > 0 then
0094   //! recursively searches for the last status and new shape.
0095   Standard_EXPORT virtual Standard_Integer Status (const TopoDS_Shape& shape, TopoDS_Shape& newsh, const Standard_Boolean last = Standard_False) Standard_OVERRIDE;
0096   
0097   //! Queries the status of last call to Apply(shape,enum)
0098   //! OK   : no (sub)shapes replaced or removed
0099   //! DONE1: source (starting) shape replaced
0100   //! DONE2: source (starting) shape removed
0101   //! DONE3: some subshapes replaced
0102   //! DONE4: some subshapes removed
0103   //! FAIL1: some replacements not done because of bad type of subshape
0104   Standard_EXPORT virtual Standard_Boolean Status (const ShapeExtend_Status status) const;
0105 
0106 
0107 
0108 
0109   DEFINE_STANDARD_RTTIEXT(ShapeBuild_ReShape,BRepTools_ReShape)
0110 
0111 protected:
0112 
0113 
0114 
0115 
0116 private:
0117 
0118 
0119 
0120 
0121 };
0122 
0123 
0124 
0125 
0126 
0127 
0128 
0129 #endif // _ShapeBuild_ReShape_HeaderFile