Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-26 10:22:17

0001 // Created on: 1993-02-05
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 _Interface_ReportEntity_HeaderFile
0018 #define _Interface_ReportEntity_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 class Interface_Check;
0025 
0026 //! A ReportEntity is produced to acknowledge and memorize the
0027 //! binding between a Check and an Entity. The Check can bring
0028 //! Fails (+ Warnings if any), or only Warnings. If it is empty,
0029 //! the Report Entity is for an Unknown Entity.
0030 //!
0031 //! The ReportEntity brings : the Concerned Entity, the
0032 //! Check, and if the Entity is empty (Fails due to Read
0033 //! Errors, hence the Entity could not be loaded), a Content.
0034 //! The Content is itself an Transient Object, but remains in a
0035 //! literal form : it is an "Unknown Entity". If the Concerned
0036 //! Entity is itself Unknown, Concerned and Content are equal.
0037 //!
0038 //! According to the Check, if it brings Fail messages,
0039 //! the ReportEntity is an "Error Entity", the Concerned Entity is
0040 //! an "Erroneous Entity". Else it is a "Correction Entity", the
0041 //! Concerned Entity is a "Corrected Entity". With no Check
0042 //! message and if Concerned and Content are equal, it reports
0043 //! for an "Unknown Entity".
0044 //!
0045 //! Each norm must produce its own type of Unknown Entity, but can
0046 //! use the class UndefinedContent to brings parameters : it is
0047 //! enough for most of information and avoids to redefine them,
0048 //! only the specific part remains to be defined for each norm.
0049 class Interface_ReportEntity : public Standard_Transient
0050 {
0051 
0052 public:
0053   //! Creates a ReportEntity for an Unknown Entity : Check is empty,
0054   //! and Concerned equates Content (i.e. the Unknown Entity)
0055   Standard_EXPORT Interface_ReportEntity(const occ::handle<Standard_Transient>& unknown);
0056 
0057   //! Creates a ReportEntity with its features :
0058   //! - <acheck> is the Check to be memorised
0059   //! - <concerned> is the Entity to which the Check is bound
0060   //! Later, a Content can be set : it is required for an Error
0061   Standard_EXPORT Interface_ReportEntity(const occ::handle<Interface_Check>&    acheck,
0062                                          const occ::handle<Standard_Transient>& concerned);
0063 
0064   //! Sets a Content : it brings non interpreted data which belong
0065   //! to the Concerned Entity. It can be empty then loaded later.
0066   //! Remark that for an Unknown Entity, Content is set by Create.
0067   Standard_EXPORT void SetContent(const occ::handle<Standard_Transient>& content);
0068 
0069   //! Returns the stored Check
0070   Standard_EXPORT const occ::handle<Interface_Check>& Check() const;
0071 
0072   //! Returns the stored Check in order to change it
0073   Standard_EXPORT occ::handle<Interface_Check>& CCheck();
0074 
0075   //! Returns the stored Concerned Entity. It equates the Content
0076   //! in the case of an Unknown Entity
0077   Standard_EXPORT occ::handle<Standard_Transient> Concerned() const;
0078 
0079   //! Returns True if a Content is stored (it can equate Concerned)
0080   Standard_EXPORT bool HasContent() const;
0081 
0082   //! Returns True if a Content is stored AND differs from Concerned
0083   //! (i.e. redefines content) : used when Concerned could not be
0084   //! loaded
0085   Standard_EXPORT bool HasNewContent() const;
0086 
0087   //! Returns the stored Content, or a Null Handle
0088   //! Remark that it must be an "Unknown Entity" suitable for
0089   //! the norm of the containing Model
0090   Standard_EXPORT occ::handle<Standard_Transient> Content() const;
0091 
0092   //! Returns True for an Error Entity, i.e. if the Check
0093   //! brings at least one Fail message
0094   Standard_EXPORT bool IsError() const;
0095 
0096   //! Returns True for an Unknown Entity, i,e. if the Check
0097   //! is empty and Concerned equates Content
0098   Standard_EXPORT bool IsUnknown() const;
0099 
0100   DEFINE_STANDARD_RTTIEXT(Interface_ReportEntity, Standard_Transient)
0101 
0102 private:
0103   occ::handle<Interface_Check>    thecheck;
0104   occ::handle<Standard_Transient> theconcerned;
0105   occ::handle<Standard_Transient> thecontent;
0106 };
0107 
0108 #endif // _Interface_ReportEntity_HeaderFile