Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-23 09:20:25

0001 // Created on: 1992-11-10
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-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_DirChecker_HeaderFile
0018 #define _IGESData_DirChecker_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <IGESData_DefType.hxx>
0026 class Interface_Check;
0027 class IGESData_IGESEntity;
0028 
0029 //! This class centralizes general Checks upon an IGES Entity's
0030 //! Directory Part. That is : such field Ignored or Required,
0031 //! or Required with a given Value (for an Integer field)
0032 //! More precise checks can be performed as necessary, by each
0033 //! Entity (method OwnCheck).
0034 //!
0035 //! Each class of Entity defines its DirChecker (method DirChecker)
0036 //! and the DirChecker is able to perform its Checks on an Entity
0037 //!
0038 //! A Required Value or presence of a field causes a Fail Message
0039 //! if criterium is not satisfied
0040 //! An Ignored field causes a Correction Message if the field is
0041 //! not null/zero
0042 class IGESData_DirChecker
0043 {
0044 public:
0045   DEFINE_STANDARD_ALLOC
0046 
0047   //! Returns a DirChecker, with no criterium at all to be checked
0048   Standard_EXPORT IGESData_DirChecker();
0049 
0050   //! Returns a DirChecker, with no criterium except Required Type
0051   Standard_EXPORT IGESData_DirChecker(const int atype);
0052 
0053   //! Returns a DirChecker, with no criterium except Required values
0054   //! for Type and Form numbers
0055   Standard_EXPORT IGESData_DirChecker(const int atype, const int aform);
0056 
0057   //! Returns a DirChecker, with no criterium except Required values
0058   //! for Type number (atype), and Required Range for Form number
0059   //! (which must be between aform1 and aform2 included)
0060   Standard_EXPORT IGESData_DirChecker(const int atype, const int aform1, const int aform2);
0061 
0062   //! Returns True if at least one criterium has already been set
0063   //! Allows user to store a DirChecker (static variable) then ask
0064   //! if it has been set before setting it
0065   Standard_EXPORT bool IsSet() const;
0066 
0067   //! Sets a DirChecker with most current criteria, that is :
0068   //! Structure Ignored ( worths call Structure(crit = DefVoid) )
0069   Standard_EXPORT void SetDefault();
0070 
0071   //! Sets Structure criterium.
0072   //! If crit is DefVoid, Ignored : should not be defined
0073   //! If crit is DefReference, Required : must be defined
0074   //! Other values are not taken in account
0075   Standard_EXPORT void Structure(const IGESData_DefType crit);
0076 
0077   //! Sets LineFont criterium
0078   //! If crit is DefVoid, Ignored : should not be defined
0079   //! If crit is DefAny, Required : must be defined (value or ref)
0080   //! If crit is DefValue, Required as a Value (error if Reference)
0081   //! Other values are not taken in account
0082   Standard_EXPORT void LineFont(const IGESData_DefType crit);
0083 
0084   //! Sets LineWeight criterium
0085   //! If crit is DefVoid, Ignored : should not be defined
0086   //! If crit is DefValue, Required
0087   //! Other values are not taken in account
0088   Standard_EXPORT void LineWeight(const IGESData_DefType crit);
0089 
0090   //! Sets Color criterium
0091   //! If crit is DefVoid, Ignored : should not be defined
0092   //! If crit is DefAny, Required : must be defined (value or ref)
0093   //! Other values are not taken in account
0094   Standard_EXPORT void Color(const IGESData_DefType crit);
0095 
0096   //! Sets Graphics data (LineFont, LineWeight, Color, Level, View)
0097   //! to be ignored according value of Hierarchy status :
0098   //! If hierarchy is not given, they are Ignored any way
0099   //! (that is, they should not be defined)
0100   //! If hierarchy is given, Graphics are Ignored if the Hierarchy
0101   //! status has the value given in argument "hierarchy"
0102   Standard_EXPORT void GraphicsIgnored(const int hierarchy = -1);
0103 
0104   //! Sets Blank Status to be ignored
0105   //! (should not be defined, or its value should be 0)
0106   Standard_EXPORT void BlankStatusIgnored();
0107 
0108   //! Sets Blank Status to be required at a given value
0109   Standard_EXPORT void BlankStatusRequired(const int val);
0110 
0111   //! Sets Subordinate Status to be ignored
0112   //! (should not be defined, or its value should be 0)
0113   Standard_EXPORT void SubordinateStatusIgnored();
0114 
0115   //! Sets Subordinate Status to be required at a given value
0116   Standard_EXPORT void SubordinateStatusRequired(const int val);
0117 
0118   //! Sets Blank Status to be ignored
0119   //! (should not be defined, or its value should be 0)
0120   Standard_EXPORT void UseFlagIgnored();
0121 
0122   //! Sets Blank Status to be required at a given value
0123   //! Give -1 to demand UseFlag not zero (but no precise value req.)
0124   Standard_EXPORT void UseFlagRequired(const int val);
0125 
0126   //! Sets Hierarchy Status to be ignored
0127   //! (should not be defined, or its value should be 0)
0128   Standard_EXPORT void HierarchyStatusIgnored();
0129 
0130   //! Sets Hierarchy Status to be required at a given value
0131   Standard_EXPORT void HierarchyStatusRequired(const int val);
0132 
0133   //! Performs the Checks on an IGESEntity, according to the
0134   //! recorded criteria
0135   //! In addition, does minimal Checks, such as admitted range for
0136   //! Status, or presence of Error status in some data (Color, ...)
0137   Standard_EXPORT void Check(occ::handle<Interface_Check>&           ach,
0138                              const occ::handle<IGESData_IGESEntity>& ent) const;
0139 
0140   //! Performs a Check only on Values of Type Number and Form Number
0141   //! This allows to do a check on an Entity not yet completely
0142   //! filled but of which Type and Form Number have been already set
0143   Standard_EXPORT void CheckTypeAndForm(occ::handle<Interface_Check>&           ach,
0144                                         const occ::handle<IGESData_IGESEntity>& ent) const;
0145 
0146   //! Corrects the Directory Entry of an IGES Entity as far as it is
0147   //! possible according recorded criteria without any ambiguity :
0148   //! - if a numeric Status is required a given value, this value is
0149   //! enforced
0150   //! - if an item is required to be Void, or if it recorded as
0151   //! Erroneous, it is cleared (set to Void)
0152   //! - Type Number is enforced
0153   //! - finally Form Number is enforced only if one and only Value
0154   //! is admitted (no range, see Constructors of DirChecker)
0155   Standard_EXPORT bool Correct(const occ::handle<IGESData_IGESEntity>& ent) const;
0156 
0157 private:
0158   bool             isitset;
0159   int              thetype;
0160   int              theform1;
0161   int              theform2;
0162   IGESData_DefType thestructure;
0163   IGESData_DefType thelinefont;
0164   IGESData_DefType thelineweig;
0165   IGESData_DefType thecolor;
0166   int              thegraphier;
0167   int              theblankst;
0168   int              thesubordst;
0169   int              theuseflag;
0170   int              thehierst;
0171 };
0172 
0173 #endif // _IGESData_DirChecker_HeaderFile