Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:17:08

0001 // Created on: 1999-06-22
0002 // Created by: data exchange team
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 _ShapeProcessAPI_ApplySequence_HeaderFile
0018 #define _ShapeProcessAPI_ApplySequence_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopoDS_Shape.hxx>
0025 #include <TopTools_ShapeMapHasher.hxx>
0026 #include <NCollection_DataMap.hxx>
0027 #include <TCollection_AsciiString.hxx>
0028 #include <Standard_CString.hxx>
0029 #include <TopAbs_ShapeEnum.hxx>
0030 #include <Message_ProgressRange.hxx>
0031 
0032 class ShapeProcess_ShapeContext;
0033 class TopoDS_Shape;
0034 
0035 //! Applies one of the sequence read from resource file.
0036 class ShapeProcessAPI_ApplySequence
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Creates an object and loads resource file and sequence of
0042   //! operators given by their names.
0043   Standard_EXPORT ShapeProcessAPI_ApplySequence(const char* const rscName,
0044                                                 const char* const seqName = "");
0045 
0046   //! Returns object for managing resource file and sequence of
0047   //! operators.
0048   Standard_EXPORT occ::handle<ShapeProcess_ShapeContext>& Context();
0049 
0050   //! Performs sequence of operators stored in myRsc.
0051   //! If <fillmap> is True adds history "shape-shape" into myMap
0052   //! for shape and its subshapes until level <until> (included).
0053   //! If <until> is TopAbs_SHAPE, all the subshapes are considered.
0054   Standard_EXPORT TopoDS_Shape
0055     PrepareShape(const TopoDS_Shape&          shape,
0056                  const bool                   fillmap     = false,
0057                  const TopAbs_ShapeEnum       until       = TopAbs_SHAPE,
0058                  const Message_ProgressRange& theProgress = Message_ProgressRange());
0059 
0060   //! Clears myMap with accumulated history.
0061   Standard_EXPORT void ClearMap();
0062 
0063   //! Returns myMap with accumulated history.
0064   Standard_EXPORT const NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>&
0065                         Map() const;
0066 
0067   //! Prints result of preparation onto the messenger of the context.
0068   //! Note that results can be accumulated from previous preparations
0069   //! it method ClearMap was not called before PrepareShape.
0070   Standard_EXPORT void PrintPreparationResult() const;
0071 
0072 private:
0073   occ::handle<ShapeProcess_ShapeContext>                                   myContext;
0074   NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myMap;
0075   TCollection_AsciiString                                                  mySeq;
0076 };
0077 
0078 #endif // _ShapeProcessAPI_ApplySequence_HeaderFile