Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-15 08:30:31

0001 // Created on: 1994-03-14
0002 // Created by: Christian CAILLET
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 _StepData_StepDumper_HeaderFile
0018 #define _StepData_StepDumper_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Interface_GeneralLib.hxx>
0025 #include <StepData_WriterLib.hxx>
0026 #include <StepData_StepWriter.hxx>
0027 #include <Standard_Integer.hxx>
0028 class StepData_StepModel;
0029 class StepData_Protocol;
0030 
0031 //! Provides a way to dump entities processed through STEP, with
0032 //! these features :
0033 //! - same form as for writing a STEP File (because it is clear
0034 //! and compact enough, even if the names of the fields do not
0035 //! appear) : thus, no additional resource is required
0036 //! - possibility to look for an entity itself (only its Type or
0037 //! with its content), an entity and it shared items (one level)
0038 //! or all the entities its refers to, directly or recursively.
0039 class StepData_StepDumper
0040 {
0041 public:
0042   DEFINE_STANDARD_ALLOC
0043 
0044   //! Creates a StepDumper, able to work on a given StepModel
0045   //! (which defines the total scope for dumping entities) and
0046   //! a given Protocol from Step (which defines the authorized
0047   //! types to be dumped)
0048   //! <mode> commands what is to be displayed (number or label)
0049   //! 0 for number (and corresponding labels  are displayed apart)
0050   //! 1 for label  (and corresponding numbers are displayed apart)
0051   //! 2 for label without anymore
0052   Standard_EXPORT StepData_StepDumper(const Handle(StepData_StepModel)& amodel,
0053                                       const Handle(StepData_Protocol)&  protocol,
0054                                       const Standard_Integer            mode = 0);
0055 
0056   //! Gives an access to the tool which is used to work : this allow
0057   //! to acts on some parameters : Floating Format, Scopes ...
0058   Standard_EXPORT StepData_StepWriter& StepWriter();
0059 
0060   //! Dumps a Entity on an Messenger. Returns True if
0061   //! success, False, if the entity to dump has not been recognized
0062   //! by the Protocol. <level> can have one of these values :
0063   //! - 0 : prints the TYPE only, as known in STEP Files (StepType)
0064   //! If <ent> has not been regognized by the Protocol, or if its
0065   //! type is Complex, the StepType is replaced by the display of
0066   //! the cdl type. Complex Type are well processed by level 1.
0067   //! - 1 : dumps the entity, completely (whatever it has simple or
0068   //! complex type) but alone.
0069   //! - 2 : dumps the entity completely, plus the item its refers to
0070   //! at first level (a header message designates the starting
0071   //! entity of the dump) <Lists Shared and Implied>
0072   //! - 3 : dumps the entity and its referred items at any levels
0073   //!
0074   //! For levels 1,2,3, the numbers displayed (form #nnn) are the
0075   //! numbers of the corresponding entities in the Model
0076   Standard_EXPORT Standard_Boolean Dump(Standard_OStream&                 S,
0077                                         const Handle(Standard_Transient)& ent,
0078                                         const Standard_Integer            level);
0079 
0080   //! Works as Dump with a Transient, but directly takes the
0081   //! entity designated by its number in the Model
0082   //! Returns False, also if <num> is out of range
0083   Standard_EXPORT Standard_Boolean Dump(Standard_OStream&      S,
0084                                         const Standard_Integer num,
0085                                         const Standard_Integer level);
0086 
0087 protected:
0088 private:
0089   Handle(StepData_StepModel) themodel;
0090   Interface_GeneralLib       theslib;
0091   StepData_WriterLib         thewlib;
0092   StepData_StepWriter        thewriter;
0093 };
0094 
0095 #endif // _StepData_StepDumper_HeaderFile