Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:17:54

0001 // Created on: 1993-01-13
0002 // Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU )
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 _IGESDimen_GeneralNote_HeaderFile
0018 #define _IGESDimen_GeneralNote_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025 #include <IGESGraph_TextFontDef.hxx>
0026 #include <gp_XYZ.hxx>
0027 #include <TCollection_HAsciiString.hxx>
0028 #include <IGESData_IGESEntity.hxx>
0029 #include <Standard_Integer.hxx>
0030 class IGESGraph_TextFontDef;
0031 class gp_Pnt;
0032 class TCollection_HAsciiString;
0033 
0034 //! defines GeneralNote, Type <212> Form <0-8, 100-200, 105>
0035 //! in package IGESDimen
0036 //! Used for formatting boxed text in different ways
0037 class IGESDimen_GeneralNote : public IGESData_IGESEntity
0038 {
0039 
0040 public:
0041   Standard_EXPORT IGESDimen_GeneralNote();
0042 
0043   //! This method is used to set the fields of the class
0044   //! GeneralNote
0045   //! - nNbChars      : number of chars strings
0046   //! - widths        : Box widths
0047   //! - heights       : Box heights
0048   //! - fontCodes     : Font codes, default = 1
0049   //! - fonts         : Text Font Definition Entities
0050   //! - slants        : Slant angles in radians
0051   //! - rotations     : Rotation angles in radians
0052   //! - mirrorFlags   : Mirror flags
0053   //! - rotFlags      : Rotation internal text flags
0054   //! - start         : Text start points
0055   //! - texts         : Text strings
0056   //! raises exception if there is mismatch between the various
0057   //! Array Lengths.
0058   Standard_EXPORT void Init(
0059     const occ::handle<NCollection_HArray1<int>>&                                   nbChars,
0060     const occ::handle<NCollection_HArray1<double>>&                                widths,
0061     const occ::handle<NCollection_HArray1<double>>&                                heights,
0062     const occ::handle<NCollection_HArray1<int>>&                                   fontCodes,
0063     const occ::handle<NCollection_HArray1<occ::handle<IGESGraph_TextFontDef>>>&    fonts,
0064     const occ::handle<NCollection_HArray1<double>>&                                slants,
0065     const occ::handle<NCollection_HArray1<double>>&                                rotations,
0066     const occ::handle<NCollection_HArray1<int>>&                                   mirrorFlags,
0067     const occ::handle<NCollection_HArray1<int>>&                                   rotFlags,
0068     const occ::handle<NCollection_HArray1<gp_XYZ>>&                                start,
0069     const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& texts);
0070 
0071   //! Changes FormNumber (indicates Graphical Representation)
0072   //! Error if not in ranges [0-8] or [100-102] or 105
0073   Standard_EXPORT void SetFormNumber(const int form);
0074 
0075   //! returns number of text strings in General Note
0076   Standard_EXPORT int NbStrings() const;
0077 
0078   //! returns number of characters of string or zero
0079   //! raises exception if Index <= 0 or Index > NbStrings()
0080   Standard_EXPORT int NbCharacters(const int Index) const;
0081 
0082   //! returns Box width of string
0083   //! raises exception if Index <= 0 or Index > NbStrings()
0084   Standard_EXPORT double BoxWidth(const int Index) const;
0085 
0086   //! returns Box height of string
0087   //! raises exception if Index <= 0 or Index > NbStrings()
0088   Standard_EXPORT double BoxHeight(const int Index) const;
0089 
0090   //! returns False if Value, True if Entity
0091   //! raises exception if Index <= 0 or Index > NbStrings()
0092   Standard_EXPORT bool IsFontEntity(const int Index) const;
0093 
0094   //! returns Font code (default = 1) of string
0095   //! returns 0 if IsFontEntity () is True
0096   //! raises exception if Index <= 0 or Index > NbStrings()
0097   Standard_EXPORT int FontCode(const int Index) const;
0098 
0099   //! returns Text Font Definition Entity of string
0100   //! returns a Null Handle if IsFontEntity () returns False
0101   //! raises exception if Index <= 0 or Index > NbStrings()
0102   Standard_EXPORT occ::handle<IGESGraph_TextFontDef> FontEntity(const int Index) const;
0103 
0104   //! returns Slant angle of string in radians
0105   //! default value = PI/2
0106   //! raises exception if Index <= 0 or Index > NbStrings()
0107   Standard_EXPORT double SlantAngle(const int Index) const;
0108 
0109   //! returns Rotation angle of string in radians
0110   //! raises exception if Index <= 0 or Index > NbStrings()
0111   Standard_EXPORT double RotationAngle(const int Index) const;
0112 
0113   //! returns Mirror Flag of string
0114   //! 0 = no mirroring
0115   //! 1 = mirror axis is perpendicular to the text base line
0116   //! 2 = mirror axis is text base line
0117   //! raises exception if Index <= 0 or Index > NbStrings()
0118   Standard_EXPORT int MirrorFlag(const int Index) const;
0119 
0120   //! returns Rotate internal text Flag of string
0121   //! 0 = text horizontal
0122   //! 1 = text vertical
0123   //! raises exception if Index <= 0 or Index > NbStrings()
0124   Standard_EXPORT int RotateFlag(const int Index) const;
0125 
0126   //! returns text start point of Index'th string
0127   //! raises exception if Index <= 0 or Index > NbStrings()
0128   Standard_EXPORT gp_Pnt StartPoint(const int Index) const;
0129 
0130   //! returns text start point of Index'th string after Transformation
0131   //! raises exception if Index <= 0 or Index > NbStrings()
0132   Standard_EXPORT gp_Pnt TransformedStartPoint(const int Index) const;
0133 
0134   //! returns distance from Start Point plane of string
0135   //! raises exception if Index <= 0 or Index > NbStrings()
0136   Standard_EXPORT double ZDepthStartPoint(const int Index) const;
0137 
0138   //! returns text string
0139   //! raises exception if Index <= 0 or Index > NbStrings()
0140   Standard_EXPORT occ::handle<TCollection_HAsciiString> Text(const int Index) const;
0141 
0142   DEFINE_STANDARD_RTTIEXT(IGESDimen_GeneralNote, IGESData_IGESEntity)
0143 
0144 private:
0145   occ::handle<NCollection_HArray1<int>>                                   theNbChars;
0146   occ::handle<NCollection_HArray1<double>>                                theBoxWidths;
0147   occ::handle<NCollection_HArray1<double>>                                theBoxHeights;
0148   occ::handle<NCollection_HArray1<int>>                                   theFontCodes;
0149   occ::handle<NCollection_HArray1<occ::handle<IGESGraph_TextFontDef>>>    theFontEntities;
0150   occ::handle<NCollection_HArray1<double>>                                theSlantAngles;
0151   occ::handle<NCollection_HArray1<double>>                                theRotationAngles;
0152   occ::handle<NCollection_HArray1<int>>                                   theMirrorFlags;
0153   occ::handle<NCollection_HArray1<int>>                                   theRotateFlags;
0154   occ::handle<NCollection_HArray1<gp_XYZ>>                                theStartPoints;
0155   occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>> theTexts;
0156 };
0157 
0158 #endif // _IGESDimen_GeneralNote_HeaderFile