Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:18:04

0001 // Created on: 1993-01-11
0002 // Created by: CKY / Contract Toubro-Larsen ( TCD )
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 _IGESGraph_TextFontDef_HeaderFile
0018 #define _IGESGraph_TextFontDef_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 #include <IGESData_IGESEntity.hxx>
0027 class TCollection_HAsciiString;
0028 class IGESBasic_HArray1OfHArray1OfInteger;
0029 
0030 //! defines IGES Text Font Definition Entity, Type <310>
0031 //! in package IGESGraph
0032 //!
0033 //! Used to define the appearance of characters in a text font.
0034 //! It may be used to describe a complete font or a
0035 //! modification to a subset of characters in another font.
0036 class IGESGraph_TextFontDef : public IGESData_IGESEntity
0037 {
0038 
0039 public:
0040   Standard_EXPORT IGESGraph_TextFontDef();
0041 
0042   //! This method is used to set the fields of the class
0043   //! TextFontDef
0044   //! - aFontCode         : Font Code
0045   //! - aFontName         : Font Name
0046   //! - aSupersededFont   : Number of superseded font
0047   //! - aSupersededEntity : Text Definition Entity
0048   //! - aScale            : No. of grid units = 1 text height unit
0049   //! - allASCIICodes     : ASCII codes for characters
0050   //! - allNextCharX & Y  : Grid locations of the next
0051   //! character's origin (Integer vals)
0052   //! - allPenMotions     : No. of pen motions for the characters
0053   //! - allPenFlags       : Pen up/down flags,
0054   //! 0 = Down (default), 1 = Up
0055   //! - allMovePenToX & Y : Grid locations the pen will move to
0056   //! This method initializes the fields of the class TextFontDef.
0057   //! An exception is raised if the lengths of allASCIICodes,
0058   //! allNextChars, allPenMotions, allPenFlags and allMovePenTo
0059   //! are not same.
0060   Standard_EXPORT void Init(const int                                    aFontCode,
0061                             const occ::handle<TCollection_HAsciiString>& aFontName,
0062                             const int                                    aSupersededFont,
0063                             const occ::handle<IGESGraph_TextFontDef>&    aSupersededEntity,
0064                             const int                                    aScale,
0065                             const occ::handle<NCollection_HArray1<int>>& allASCIICodes,
0066                             const occ::handle<NCollection_HArray1<int>>& allNextCharX,
0067                             const occ::handle<NCollection_HArray1<int>>& allNextCharY,
0068                             const occ::handle<NCollection_HArray1<int>>& allPenMotions,
0069                             const occ::handle<IGESBasic_HArray1OfHArray1OfInteger>& allPenFlags,
0070                             const occ::handle<IGESBasic_HArray1OfHArray1OfInteger>& allMovePenToX,
0071                             const occ::handle<IGESBasic_HArray1OfHArray1OfInteger>& allMovePenToY);
0072 
0073   //! returns the font code.
0074   Standard_EXPORT int FontCode() const;
0075 
0076   //! returns the font name.
0077   Standard_EXPORT occ::handle<TCollection_HAsciiString> FontName() const;
0078 
0079   //! True if this definition supersedes another
0080   //! TextFontDefinition Entity,
0081   //! False if it supersedes value.
0082   Standard_EXPORT bool IsSupersededFontEntity() const;
0083 
0084   //! returns the font number which this entity modifies.
0085   Standard_EXPORT int SupersededFontCode() const;
0086 
0087   //! returns the font entity which this entity modifies.
0088   Standard_EXPORT occ::handle<IGESGraph_TextFontDef> SupersededFontEntity() const;
0089 
0090   //! returns the number of grid units which equal one text height unit.
0091   Standard_EXPORT int Scale() const;
0092 
0093   //! returns the number of characters in this definition.
0094   Standard_EXPORT int NbCharacters() const;
0095 
0096   //! returns the ASCII code of Chnum'th character.
0097   //! Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
0098   Standard_EXPORT int ASCIICode(const int Chnum) const;
0099 
0100   //! returns grid location of origin of character next to Chnum'th char.
0101   //! Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
0102   Standard_EXPORT void NextCharOrigin(const int Chnum, int& NX, int& NY) const;
0103 
0104   //! returns number of pen motions for Chnum'th character.
0105   //! Exception OutOfRange is raised if Chnum <= 0 or Chnum > NbCharacters
0106   Standard_EXPORT int NbPenMotions(const int Chnum) const;
0107 
0108   //! returns pen status(True if 1, False if 0) of Motionnum'th motion
0109   //! of Chnum'th character.
0110   //! Exception raised if Chnum <= 0 or Chnum > NbCharacters or
0111   //! Motionnum <= 0 or Motionnum > NbPenMotions
0112   Standard_EXPORT bool IsPenUp(const int Chnum, const int Motionnum) const;
0113 
0114   Standard_EXPORT void NextPenPosition(const int Chnum,
0115                                        const int Motionnum,
0116                                        int&      IX,
0117                                        int&      IY) const;
0118 
0119   DEFINE_STANDARD_RTTIEXT(IGESGraph_TextFontDef, IGESData_IGESEntity)
0120 
0121 private:
0122   int                                              theFontCode;
0123   occ::handle<TCollection_HAsciiString>            theFontName;
0124   int                                              theSupersededFontCode;
0125   occ::handle<IGESGraph_TextFontDef>               theSupersededFontEntity;
0126   int                                              theScale;
0127   occ::handle<NCollection_HArray1<int>>            theASCIICodes;
0128   occ::handle<NCollection_HArray1<int>>            theNextCharOriginX;
0129   occ::handle<NCollection_HArray1<int>>            theNextCharOriginY;
0130   occ::handle<NCollection_HArray1<int>>            theNbPenMotions;
0131   occ::handle<IGESBasic_HArray1OfHArray1OfInteger> thePenMotions;
0132   occ::handle<IGESBasic_HArray1OfHArray1OfInteger> thePenMovesToX;
0133   occ::handle<IGESBasic_HArray1OfHArray1OfInteger> thePenMovesToY;
0134 };
0135 
0136 #endif // _IGESGraph_TextFontDef_HeaderFile