Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:16:26

0001 // Created on: 1996-12-24
0002 // Created by: Alexander BRIVIN
0003 // Copyright (c) 1996-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 _Vrml_AsciiText_HeaderFile
0018 #define _Vrml_AsciiText_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TCollection_AsciiString.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 #include <Vrml_AsciiTextJustification.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <Standard_OStream.hxx>
0029 
0030 //! defines a AsciiText node of VRML specifying geometry shapes.
0031 //! This node represents strings of text characters from ASCII coded
0032 //! character set. All subsequent strings advance y by -( size * spacing).
0033 //! The justification field determines the placement of the strings in the x
0034 //! dimension. LEFT (the default) places the left edge of each string at x=0.
0035 //! CENTER places the center of each string at x=0. RIGHT places the right edge
0036 //! of each string at x=0. Text is rendered from left to right, top to
0037 //! bottom in the font set by FontStyle.
0038 //! The default value for the wigth field indicates the natural width
0039 //! should be used for that string.
0040 class Vrml_AsciiText : public Standard_Transient
0041 {
0042 
0043 public:
0044   Standard_EXPORT Vrml_AsciiText();
0045 
0046   Standard_EXPORT Vrml_AsciiText(
0047     const occ::handle<NCollection_HArray1<TCollection_AsciiString>>& aString,
0048     const double                                                     aSpacing,
0049     const Vrml_AsciiTextJustification                                aJustification,
0050     const double                                                     aWidth);
0051 
0052   Standard_EXPORT void SetString(
0053     const occ::handle<NCollection_HArray1<TCollection_AsciiString>>& aString);
0054 
0055   Standard_EXPORT occ::handle<NCollection_HArray1<TCollection_AsciiString>> String() const;
0056 
0057   Standard_EXPORT void SetSpacing(const double aSpacing);
0058 
0059   Standard_EXPORT double Spacing() const;
0060 
0061   Standard_EXPORT void SetJustification(const Vrml_AsciiTextJustification aJustification);
0062 
0063   Standard_EXPORT Vrml_AsciiTextJustification Justification() const;
0064 
0065   Standard_EXPORT void SetWidth(const double aWidth);
0066 
0067   Standard_EXPORT double Width() const;
0068 
0069   Standard_EXPORT Standard_OStream& Print(Standard_OStream& anOStream) const;
0070 
0071   DEFINE_STANDARD_RTTIEXT(Vrml_AsciiText, Standard_Transient)
0072 
0073 private:
0074   occ::handle<NCollection_HArray1<TCollection_AsciiString>> myString;
0075   double                                                    mySpacing;
0076   Vrml_AsciiTextJustification                               myJustification;
0077   double                                                    myWidth;
0078 };
0079 
0080 #endif // _Vrml_AsciiText_HeaderFile