0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Interface / Interface_ReportEntity.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-02-05
2// Created by: Christian CAILLET
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _Interface_ReportEntity_HeaderFile
18#define _Interface_ReportEntity_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
25e59720 23#include <Standard_Transient.hxx>
42cf5bc1 24#include <Standard_Boolean.hxx>
25class Interface_Check;
26class Standard_Transient;
27
28
29class Interface_ReportEntity;
25e59720 30DEFINE_STANDARD_HANDLE(Interface_ReportEntity, Standard_Transient)
42cf5bc1 31
32//! A ReportEntity is produced to aknowledge and memorize the
33//! binding between a Check and an Entity. The Check can bring
34//! Fails (+ Warnings if any), or only Warnings. If it is empty,
35//! the Report Entity is for an Unknown Entity.
36//!
37//! The ReportEntity brings : the Concerned Entity, the
38//! Check, and if the Entity is empty (Fails due to Read
39//! Errors, hence the Entity could not be loaded), a Content.
40//! The Content is itself an Transient Object, but remains in a
41//! literal form : it is an "Unknown Entity". If the Concerned
42//! Entity is itself Unknown, Concerned and Content are equal.
43//!
44//! According to the Check, if it brings Fail messages,
45//! the ReportEntity is an "Error Entity", the Concerned Entity is
46//! an "Erroneous Entity". Else it is a "Correction Entity", the
47//! Concerned Entity is a "Corrected Entity". With no Check
48//! message and if Concerened and Content are equal, it reports
49//! for an "Unknown Entity".
50//!
51//! Each norm must produce its own type of Unknown Entity, but can
52//! use the class UndefinedContent to brings parameters : it is
53//! enough for most of information and avoids to redefine them,
54//! only the specific part remains to be defined for each norm.
25e59720 55class Interface_ReportEntity : public Standard_Transient
42cf5bc1 56{
57
58public:
59
60
61 //! Creates a ReportEntity for an Unknown Entity : Check is empty,
62 //! and Concerned equates Content (i.e. the Unknown Entity)
63 Standard_EXPORT Interface_ReportEntity(const Handle(Standard_Transient)& unknown);
64
65 //! Creates a ReportEntity with its features :
66 //! - <acheck> is the Check to be memorised
67 //! - <concerned> is the Entity to which the Check is bound
68 //! Later, a Content can be set : it is required for an Error
69 Standard_EXPORT Interface_ReportEntity(const Handle(Interface_Check)& acheck, const Handle(Standard_Transient)& concerned);
70
71 //! Sets a Content : it brings non interpreted data which belong
72 //! to the Concerned Entity. It can be empty then loaded later.
73 //! Remark that for an Unknown Entity, Content is set by Create.
74 Standard_EXPORT void SetContent (const Handle(Standard_Transient)& content);
75
76 //! Returns the stored Check
77 Standard_EXPORT const Handle(Interface_Check)& Check() const;
78
79 //! Returns the stored Check in order to change it
80 Standard_EXPORT Handle(Interface_Check)& CCheck();
81
82 //! Returns the stored Concerned Entity. It equates the Content
83 //! in the case of an Unknown Entity
84 Standard_EXPORT Handle(Standard_Transient) Concerned() const;
85
86 //! Returns True if a Content is stored (it can equate Concerned)
87 Standard_EXPORT Standard_Boolean HasContent() const;
88
89 //! Returns True if a Content is stored AND differs from Concerned
90 //! (i.e. redefines content) : used when Concerned could not be
91 //! loaded
92 Standard_EXPORT Standard_Boolean HasNewContent() const;
93
94 //! Returns the stored Content, or a Null Handle
95 //! Remark that it must be an "Unknown Entity" suitable for
96 //! the norm of the containing Model
97 Standard_EXPORT Handle(Standard_Transient) Content() const;
98
99 //! Returns True for an Error Entity, i.e. if the Check
100 //! brings at least one Fail message
101 Standard_EXPORT Standard_Boolean IsError() const;
102
103 //! Returns True for an Unknown Entity, i,e. if the Check
104 //! is empty and Concerned equates Content
105 Standard_EXPORT Standard_Boolean IsUnknown() const;
106
107
108
109
25e59720 110 DEFINE_STANDARD_RTTIEXT(Interface_ReportEntity,Standard_Transient)
42cf5bc1 111
112protected:
113
114
115
116
117private:
118
119
120 Handle(Interface_Check) thecheck;
121 Handle(Standard_Transient) theconcerned;
122 Handle(Standard_Transient) thecontent;
123
124
125};
126
127
128
129
130
131
132
133#endif // _Interface_ReportEntity_HeaderFile