Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:02

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