Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:17:27

0001 // Created on: 1993-05-10
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-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 _IGESData_GeneralModule_HeaderFile
0018 #define _IGESData_GeneralModule_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Interface_GeneralModule.hxx>
0024 #include <Standard_Integer.hxx>
0025 class Standard_Transient;
0026 class Interface_EntityIterator;
0027 class IGESData_IGESEntity;
0028 class Interface_ShareTool;
0029 class Interface_Check;
0030 class IGESData_DirChecker;
0031 class Interface_CopyTool;
0032 class TCollection_HAsciiString;
0033 
0034 //! Definition of General Services adapted to IGES.
0035 //! This Services comprise : Shared & Implied Lists, Copy, Check
0036 //! They are adapted according to the organisation of IGES
0037 //! Entities : Directory Part, Lists of Associativities and
0038 //! Properties are specifically processed
0039 class IGESData_GeneralModule : public Interface_GeneralModule
0040 {
0041 
0042 public:
0043   //! Fills the list of Entities shared by an IGESEntity <ent>,
0044   //! according a Case Number <CN> (formerly computed by CaseNum).
0045   //! Considers Properties and Directory Part, and calls
0046   //! OwnSharedCase (which is adapted to each Type of Entity)
0047   Standard_EXPORT void FillSharedCase(const int                              CN,
0048                                       const occ::handle<Standard_Transient>& ent,
0049                                       Interface_EntityIterator&              iter) const override;
0050 
0051   //! Lists the Entities shared by a given IGESEntity <ent>, from
0052   //! its specific parameters : specific for each type
0053   Standard_EXPORT virtual void OwnSharedCase(const int                               CN,
0054                                              const occ::handle<IGESData_IGESEntity>& ent,
0055                                              Interface_EntityIterator& iter) const = 0;
0056 
0057   //! Lists the Implied References of <ent>. Here, these are the
0058   //! Associativities, plus the Entities defined by OwnSharedCase
0059   Standard_EXPORT void ListImpliedCase(const int                              CN,
0060                                        const occ::handle<Standard_Transient>& ent,
0061                                        Interface_EntityIterator&              iter) const override;
0062 
0063   //! Specific list of Entities implied by a given IGESEntity <ent>
0064   //! (in addition to Associativities). By default, there are none,
0065   //! but this method can be redefined as required
0066   Standard_EXPORT virtual void OwnImpliedCase(const int                               CN,
0067                                               const occ::handle<IGESData_IGESEntity>& ent,
0068                                               Interface_EntityIterator&               iter) const;
0069 
0070   //! Semantic Checking of an IGESEntity. Performs general Checks,
0071   //! which use DirChecker, then call OwnCheck which does a check
0072   //! specific for each type of Entity
0073   Standard_EXPORT void CheckCase(const int                              CN,
0074                                  const occ::handle<Standard_Transient>& ent,
0075                                  const Interface_ShareTool&             shares,
0076                                  occ::handle<Interface_Check>&          ach) const override;
0077 
0078   //! Returns a DirChecker, specific for each type of Entity
0079   //! (identified by its Case Number) : this DirChecker defines
0080   //! constraints which must be respected by the DirectoryPart
0081   Standard_EXPORT virtual IGESData_DirChecker DirChecker(
0082     const int                               CN,
0083     const occ::handle<IGESData_IGESEntity>& ent) const = 0;
0084 
0085   //! Performs Specific Semantic Check for each type of Entity
0086   Standard_EXPORT virtual void OwnCheckCase(const int                               CN,
0087                                             const occ::handle<IGESData_IGESEntity>& ent,
0088                                             const Interface_ShareTool&              shares,
0089                                             occ::handle<Interface_Check>&           ach) const = 0;
0090 
0091   //! Specific answer to the question "is Copy properly implemented"
0092   //! For IGES, answer is always True
0093   Standard_EXPORT bool CanCopy(const int                              CN,
0094                                const occ::handle<Standard_Transient>& ent) const override;
0095 
0096   //! Specific creation of a new void entity
0097   Standard_EXPORT bool NewVoid(const int                        CN,
0098                                occ::handle<Standard_Transient>& entto) const override = 0;
0099 
0100   //! Copy ("Deep") from <entfrom> to <entto> (same type)
0101   //! by using a CopyTool which provides its working Map.
0102   //! For IGESEntities, Copies general data (Directory Part, List of
0103   //! Properties) and call OwnCopyCase
0104   Standard_EXPORT void CopyCase(const int                              CN,
0105                                 const occ::handle<Standard_Transient>& entfrom,
0106                                 const occ::handle<Standard_Transient>& entto,
0107                                 Interface_CopyTool&                    TC) const override;
0108 
0109   //! Copies parameters which are specific of each Type of Entity
0110   Standard_EXPORT virtual void OwnCopyCase(const int                               CN,
0111                                            const occ::handle<IGESData_IGESEntity>& entfrom,
0112                                            const occ::handle<IGESData_IGESEntity>& entto,
0113                                            Interface_CopyTool&                     TC) const = 0;
0114 
0115   //! Renewing of Implied References.
0116   //! For IGESEntities, Copies general data(List of Associativities)
0117   //! and calls OwnRenewCase
0118   Standard_EXPORT void RenewImpliedCase(const int                              CN,
0119                                         const occ::handle<Standard_Transient>& entfrom,
0120                                         const occ::handle<Standard_Transient>& entto,
0121                                         const Interface_CopyTool&              TC) const override;
0122 
0123   //! Renews parameters which are specific of each Type of Entity :
0124   //! the provided default does nothing, but this method may be
0125   //! redefined as required
0126   Standard_EXPORT virtual void OwnRenewCase(const int                               CN,
0127                                             const occ::handle<IGESData_IGESEntity>& entfrom,
0128                                             const occ::handle<IGESData_IGESEntity>& entto,
0129                                             const Interface_CopyTool&               TC) const;
0130 
0131   //! Prepares an IGES Entity for delete : works on directory part
0132   //! then calls OwnDeleteCase
0133   //! While dispatch requires to copy the entities, <dispatched> is
0134   //! ignored, entities are cleared in any case
0135   Standard_EXPORT void WhenDeleteCase(const int                              CN,
0136                                       const occ::handle<Standard_Transient>& ent,
0137                                       const bool dispatched) const override;
0138 
0139   //! Specific preparation for delete, acts on own parameters
0140   //! Default does nothing, to be redefined as required
0141   Standard_EXPORT virtual void OwnDeleteCase(const int                               CN,
0142                                              const occ::handle<IGESData_IGESEntity>& ent) const;
0143 
0144   //! Returns the name of an IGES Entity (its NameValue)
0145   //! Can be redefined for an even more specific case ...
0146   Standard_EXPORT occ::handle<TCollection_HAsciiString> Name(
0147     const int                              CN,
0148     const occ::handle<Standard_Transient>& ent,
0149     const Interface_ShareTool&             shares) const override;
0150 
0151   DEFINE_STANDARD_RTTIEXT(IGESData_GeneralModule, Interface_GeneralModule)
0152 };
0153 
0154 #endif // _IGESData_GeneralModule_HeaderFile