Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-25 09:23:24

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 Standard_Integer atype);
0052 
0053   //! Returns a DirChecker, with no criterium except Required values
0054   //! for Type and Form numbers
0055   Standard_EXPORT IGESData_DirChecker(const Standard_Integer atype, const Standard_Integer 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 Standard_Integer atype,
0061                                       const Standard_Integer aform1,
0062                                       const Standard_Integer aform2);
0063 
0064   //! Returns True if at least one criterium has already been set
0065   //! Allows user to store a DirChecker (static variable) then ask
0066   //! if it has been set before setting it
0067   Standard_EXPORT Standard_Boolean IsSet() const;
0068 
0069   //! Sets a DirChecker with most current criteria, that is :
0070   //! Structure Ignored ( worths call Structure(crit = DefVoid) )
0071   Standard_EXPORT void SetDefault();
0072 
0073   //! Sets Structure criterium.
0074   //! If crit is DefVoid, Ignored : should not be defined
0075   //! If crit is DefReference, Required : must be defined
0076   //! Other values are not taken in account
0077   Standard_EXPORT void Structure(const IGESData_DefType crit);
0078 
0079   //! Sets LineFont criterium
0080   //! If crit is DefVoid, Ignored : should not be defined
0081   //! If crit is DefAny, Required : must be defined (value or ref)
0082   //! If crit is DefValue, Required as a Value (error if Reference)
0083   //! Other values are not taken in account
0084   Standard_EXPORT void LineFont(const IGESData_DefType crit);
0085 
0086   //! Sets LineWeight criterium
0087   //! If crit is DefVoid, Ignored : should not be defined
0088   //! If crit is DefValue, Required
0089   //! Other values are not taken in account
0090   Standard_EXPORT void LineWeight(const IGESData_DefType crit);
0091 
0092   //! Sets Color criterium
0093   //! If crit is DefVoid, Ignored : should not be defined
0094   //! If crit is DefAny, Required : must be defined (value or ref)
0095   //! Other values are not taken in account
0096   Standard_EXPORT void Color(const IGESData_DefType crit);
0097 
0098   //! Sets Graphics data (LineFont, LineWeight, Color, Level, View)
0099   //! to be ignored according value of Hierarchy status :
0100   //! If hierarchy is not given, they are Ignored any way
0101   //! (that is, they should not be defined)
0102   //! If hierarchy is given, Graphics are Ignored if the Hierarchy
0103   //! status has the value given in argument "hierarchy"
0104   Standard_EXPORT void GraphicsIgnored(const Standard_Integer hierarchy = -1);
0105 
0106   //! Sets Blank Status to be ignored
0107   //! (should not be defined, or its value should be 0)
0108   Standard_EXPORT void BlankStatusIgnored();
0109 
0110   //! Sets Blank Status to be required at a given value
0111   Standard_EXPORT void BlankStatusRequired(const Standard_Integer val);
0112 
0113   //! Sets Subordinate Status to be ignored
0114   //! (should not be defined, or its value should be 0)
0115   Standard_EXPORT void SubordinateStatusIgnored();
0116 
0117   //! Sets Subordinate Status to be required at a given value
0118   Standard_EXPORT void SubordinateStatusRequired(const Standard_Integer val);
0119 
0120   //! Sets Blank Status to be ignored
0121   //! (should not be defined, or its value should be 0)
0122   Standard_EXPORT void UseFlagIgnored();
0123 
0124   //! Sets Blank Status to be required at a given value
0125   //! Give -1 to demand UseFlag not zero (but no precise value req.)
0126   Standard_EXPORT void UseFlagRequired(const Standard_Integer val);
0127 
0128   //! Sets Hierarchy Status to be ignored
0129   //! (should not be defined, or its value should be 0)
0130   Standard_EXPORT void HierarchyStatusIgnored();
0131 
0132   //! Sets Hierarchy Status to be required at a given value
0133   Standard_EXPORT void HierarchyStatusRequired(const Standard_Integer val);
0134 
0135   //! Performs the Checks on an IGESEntity, according to the
0136   //! recorded criteria
0137   //! In addition, does minimal Checks, such as admitted range for
0138   //! Status, or presence of Error status in some data (Color, ...)
0139   Standard_EXPORT void Check(Handle(Interface_Check)&           ach,
0140                              const Handle(IGESData_IGESEntity)& ent) const;
0141 
0142   //! Performs a Check only on Values of Type Number and Form Number
0143   //! This allows to do a check on an Entity not yet completely
0144   //! filled but of which Type and Form Number have been already set
0145   Standard_EXPORT void CheckTypeAndForm(Handle(Interface_Check)&           ach,
0146                                         const Handle(IGESData_IGESEntity)& ent) const;
0147 
0148   //! Corrects the Directory Entry of an IGES Entity as far as it is
0149   //! possible according recorded criteria without any ambiguity :
0150   //! - if a numeric Status is required a given value, this value is
0151   //! enforced
0152   //! - if an item is required to be Void, or if it recorded as
0153   //! Erroneous, it is cleared (set to Void)
0154   //! - Type Number is enforced
0155   //! - finally Form Number is enforced only if one and only Value
0156   //! is admitted (no range, see Constructors of DirChecker)
0157   Standard_EXPORT Standard_Boolean Correct(const Handle(IGESData_IGESEntity)& ent) const;
0158 
0159 protected:
0160 private:
0161   Standard_Boolean isitset;
0162   Standard_Integer thetype;
0163   Standard_Integer theform1;
0164   Standard_Integer theform2;
0165   IGESData_DefType thestructure;
0166   IGESData_DefType thelinefont;
0167   IGESData_DefType thelineweig;
0168   IGESData_DefType thecolor;
0169   Standard_Integer thegraphier;
0170   Standard_Integer theblankst;
0171   Standard_Integer thesubordst;
0172   Standard_Integer theuseflag;
0173   Standard_Integer thehierst;
0174 };
0175 
0176 #endif // _IGESData_DirChecker_HeaderFile