Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:57

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