Back to home page

EIC code displayed by LXR

 
 

    


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

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