Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-30 08:46:32

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