CFx SDK Documentation  2023 SP0
DbMText.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef OD_DBMTEXT_H
28 #define OD_DBMTEXT_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbEntity.h"
33 #include "TextDefs.h"
34 #include "Ge/GePoint2d.h"
35 #include "Ge/GePoint3d.h"
36 #include "Ge/GeDoubleArray.h"
37 
38 class OdGeVector3d;
39 class OdGePoint2d;
40 
54 {
55  OdGePoint3d location; // Insertion point.
56 
57  /* OdGeVector3d normal;
58  OdGeVector3d direction;
59  */
60 
61  OdString text; // Text string.
62 
63  OdString font; // SHX Font.
64  OdString bigfont; // SHX Bigfont.
65 
66  OdGePoint2d extents; // Extents in OCS.
67  double capsHeight; // Height.
68  double widthFactor; // Width factor.
69  double obliqueAngle; // Obliquing angle.
70  double trackingFactor; // Tracking factor.
71 
72  // OdUInt16 colorIndex;
73 
75  bool vertical; // Text is vertical.
76 
77  bool stackTop; // Text is top of stacked text.
78  bool stackBottom; // Text is bottom of stacked text.
79 
80  bool underlined; // Text is underlined.
81  bool overlined; // Text is overlined.
83 
84  OdGePoint3d underPoints[2]; // Underline endpoints.
85  OdGePoint3d overPoints[2]; // Overline endpoints.
87 
88  // true type font data
89 
90  OdString fontname; // TrueType font name, or empty string.
91  int charset; // TrueType character set.
92  bool bold; // Text is bold.
93  bool italic; // Text is italic.
94 
95  // 0 - no change 1 - change to original 2 - change to other
96 
97  int changeStyle; // 0 == No change; 1 == Change to original; 2 == Change to other
98  bool lineBreak; // Text is followed by a line break.
99  bool newParagraph; // Text fragment starts new paragraph.
100 };
101 
108 {
109  double paragraphInd; // Subsequent line indent.
110 
111  double firstLineInd; // First line indent.
112 
113  OdGeDoubleArray tabs; // Tab settings.
114 };
115 
116 typedef int(*OdDbMTextEnum)(
118  void *);
119 
121 
122 class OdDbText;
123 
137 {
138 public:
140 
142 
147 
154  const OdGePoint3d& location);
155 
160 
166  void setNormal(
167  const OdGeVector3d& normal);
168 
173 
183  const OdGeVector3d& direction);
184 
188  double rotation() const;
189 
196  double rotation);
197 
204  double width() const;
205 
214  void setWidth(
215  double width);
216 
221 
228  OdDbObjectId textStyleId);
229 
233  double textHeight() const;
234 
244  double height);
245 
247  {
248  kTopLeft = 1, // Top Left
249  kTopCenter = 2, // Top Center
250  kTopRight = 3, // Top Right
251  kMiddleLeft = 4, // Middle Left
252  kMiddleCenter = 5, // Middle Center
253  kMiddleRight = 6, // Middle Right
254  kBottomLeft = 7, // Bottom Left
255  kBottomCenter = 8, // Bottom Center
256  kBottomRight = 9, // Bottom Right
257  kBaseLeft = 10, // Baseline Left /reserved for future use/
258  kBaseCenter = 11, // Baseline Center /reserved for future use/
259  kBaseRight = 12, // Baseline Right /reserved for future use/
260  kBaseAlign = 13, // Baseline Aligned /reserved for future use/
261  kBottomAlign = 14, // Bottom Aligned /reserved for future use/
262  kMiddleAlign = 15, // Middle Aligned /reserved for future use/
263  kTopAlign = 16, // Top Aligned /reserved for future use/
264  kBaseFit = 17, // Baseline Fit /reserved for future use/
265  kBottomFit = 18, // Bottom Fit /reserved for future use/
266  kMiddleFit = 19, // Middle Fit /reserved for future use/
267  kTopFit = 20, // Top Fit /reserved for future use/
268  kBaseMid = 21, // Baseline Middled /reserved for future use/
269  kBottomMid = 22, // Bottom Middled /reserved for future use/
270  kMiddleMid = 23, // Middle Middled /reserved for future use/
271  kTopMid = 24 // Top Middled /reserved for future use/
272  };
273 
294 
330 
332  {
333  kLtoR = 1, // Left to Right
334  kRtoL = 2, // Right to Left
335  kTtoB = 3, // Top to Bottom
336  kBtoT = 4, // Bottom to Top
337  kByStyle = 5 // By Style
338  };
339 
356 
378  FlowDirection flowDirection);
379 
384 
390  int setContents(const OdString& text);
391 
397  int setContentsRTF(const OdString& text);
398 
405  double actualWidth() const;
406 
413  static const OdString nonBreakSpace();
414 
421  static const OdString overlineOn();
422 
429  static const OdString overlineOff();
430 
437  static const OdString underlineOn();
438 
445  static const OdString underlineOff();
446 
453  static const OdString colorChange();
454 
461  static const OdString fontChange();
462 
469  static const OdString heightChange();
470 
477  static const OdString widthChange();
478 
485  static const OdString obliqueChange();
486 
493  static const OdString trackChange();
494 
501  static const OdString lineBreak();
502 
508  static const OdString paragraphBreak();
509 
515  static const OdString stackStart();
516 
523  static const OdString alignChange();
524 
531  static const OdString blockBegin();
532 
539  static const OdString blockEnd();
540 
547  static const OdString strikethroughOn();
548 
555  static const OdString strikethroughOff();
556 
572  OdDb::LineSpacingStyle lineSpacingStyle);
573 
578 
588  double lineSpacingFactor);
589 
593  double lineSpacingFactor() const;
594 
613 
636  OdDb::TextHorzMode horizontalMode);
637 
653 
673  OdDb::TextVertMode verticalMode);
674 
679 
681  OdDbDwgFiler* pFiler);
682 
683  virtual void dwgOutFields(
684  OdDbDwgFiler* pFiler) const;
685 
687  OdDbDxfFiler* pFiler);
688 
689  virtual void dxfOutFields(
690  OdDbDxfFiler* pFiler) const;
691 
693  OdGiWorldDraw* pWd) const;
694 
696  OdGiViewportDraw* pVd) const;
697 
698  virtual OdResult subTransformBy(const OdGeMatrix3d& xfm);
699 
701  OdRxObjectPtrArray& entitySet) const;
702 
704  OdRxObjectPtrArray& entitySet) const;
705 
707  void* pClsid) const;
708 
709  void subClose();
710 
731  OdDbMTextEnum fragmentFn,
732  void *params,
733  OdGiWorldDraw *ctxt = 0) const;
734 
743  double actualHeight(
744  OdGiWorldDraw *ctxt = 0) const;
745 
765  OdGePoint3dArray& boundingPoints, double dGapX = 0., double dGapY = 0.) const;
766 
784  OdGePoint3dArray& boundingPoints) const;
785 
819 
821  OdGeExtents3d& extents) const;
822 
826  bool backgroundFillOn() const;
827 
833  bool bEnable);
834 
839 
845  const OdCmColor& color);
846 
853  double getBackgroundScaleFactor() const;
854 
867  const double scaleFactor);
868 
873 
879  const OdCmTransparency& transparency);
880 
885  bool useBackgroundColorOn() const;
886 
895  bool enable);
896 
902  OdDbMTextIndents& indents) const;
903 
905  const OdString& fieldName,
906  OdDbField* pField);
908  OdDbObjectId fieldId);
910  const OdString& fieldName);
911 
922 
928  OdDbDatabase *pDb,
929  bool doSubents);
930 
931  enum ColumnType {
934  kDynamicColumns
935  };
936 
937  void setDynamicColumns(double width, double gutter, bool bAutoHeigh);
938  void setStaticColumns(double width, double gutter, OdInt16 count);
939 
954 
967  void setColumnType(ColumnType colType);
968 
972  bool getColumnAutoHeight() const;
973 
982  void setColumnAutoHeight(bool bAutoHeigh);
983 
988 
997  void setColumnCount(OdInt32 numCol);
998 
1002  double getColumnWidth() const;
1003 
1012  void setColumnWidth(double colWidth);
1013 
1017  double getColumnGutterWidth() const;
1018 
1027  void setColumnGutterWidth(double colGutter);
1028 
1033 
1039  void setColumnFlowReversed(bool bFlowRev);
1040 
1046  double getColumnHeight(OdInt16 col) const;
1047 
1057  void setColumnHeight(OdInt16 col, double colHeight);
1058 
1062  double height() const;
1063 
1069  void setHeight(double value);
1070 
1071  virtual OdResult getPlane(OdGePlane& plane, OdDb::Planarity& planarity) const;
1072 
1073  virtual OdResult subGetTransformedCopy(const OdGeMatrix3d& mat, OdDbEntityPtr& pCopy) const;
1074 
1078  double ascent() const;
1079 
1083  double descent() const;
1084 
1090  void setShowBorders(bool bEnable);
1091 
1094  bool showBorders();
1095 
1099 };
1100 
1105 
1106 #include "TD_PackPop.h"
1107 
1108 #endif
1109 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbMText > OdDbMTextPtr
Definition: DbMText.h:1104
int(* OdDbMTextEnum)(OdDbMTextFragment *, void *)
Definition: DbMText.h:116
OdArray< OdDbMTextIndent > OdDbMTextIndents
Definition: DbMText.h:120
short OdInt16
int OdInt32
OdResult
Definition: OdResult.h:29
OdResult removeField(OdDbObjectId fieldId)
OdString text()
bool getColumnFlowReversed() const
double height() const
static const OdString trackChange()
void setColumnCount(OdInt32 numCol)
void getActualBoundingPoints(OdGePoint3dArray &boundingPoints, double dGapX=0., double dGapY=0.) const
static const OdString nonBreakSpace()
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
double descent() const
bool useBackgroundColorOn() const
static const OdString blockBegin()
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
void setColumnGutterWidth(double colGutter)
double actualWidth() const
ODDB_DECLARE_MEMBERS(OdDbMText)
void setUseBackgroundColor(bool enable)
static const OdString heightChange()
int setContentsRTF(const OdString &text)
double textHeight() const
void setHeight(double value)
static const OdString underlineOff()
double getColumnWidth() const
void setColumnHeight(OdInt16 col, double colHeight)
double width() const
static const OdString overlineOn()
OdGeVector3d normal() const
double getBackgroundScaleFactor() const
FlowDirection
Definition: DbMText.h:332
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &mat, OdDbEntityPtr &pCopy) const
void setDynamicColumns(double width, double gutter, bool bAutoHeigh)
OdResult setAttachmentMovingLocation(AttachmentPoint attachment)
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm)
OdDbObjectId textStyle() const
OdString contents() const
void getParagraphsIndent(OdDbMTextIndents &indents) const
AttachmentPoint
Definition: DbMText.h:247
void setColumnAutoHeight(bool bAutoHeigh)
double lineSpacingFactor() const
OdInt32 getColumnCount() const
static const OdString colorChange()
static const OdString underlineOn()
static const OdString lineBreak()
static const OdString blockEnd()
virtual OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const
void setBackgroundScaleFactor(const double scaleFactor)
static const OdString paragraphBreak()
void setVerticalMode(OdDb::TextVertMode verticalMode)
void setTextHeight(double height)
void setLocation(const OdGePoint3d &location)
OdDb::TextVertMode verticalMode() const
double rotation() const
void subViewportDraw(OdGiViewportDraw *pVd) const
static const OdString obliqueChange()
double actualHeight(OdGiWorldDraw *ctxt=0) const
void convertFieldToText()
void setTextStyle(OdDbObjectId textStyleId)
void setLineSpacingFactor(double lineSpacingFactor)
static const OdString fontChange()
bool backgroundFillOn() const
@ kStaticColumns
Definition: DbMText.h:933
@ kNoColumns
Definition: DbMText.h:932
int setContents(const OdString &text)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void setShowBorders(bool bEnable)
static const OdString alignChange()
OdCmTransparency getBackgroundTransparency() const
double ascent() const
bool subWorldDraw(OdGiWorldDraw *pWd) const
static const OdString widthChange()
static const OdString strikethroughOff()
void setRotation(double rotation)
double getColumnHeight(OdInt16 col) const
OdCmColor getBackgroundFillColor() const
void explodeFragments(OdDbMTextEnum fragmentFn, void *params, OdGiWorldDraw *ctxt=0) const
void setLineSpacingStyle(OdDb::LineSpacingStyle lineSpacingStyle)
void getBoundingPoints(OdGePoint3dArray &boundingPoints) const
bool getColumnAutoHeight() const
void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
static const OdString stackStart()
void setBackgroundTransparency(const OdCmTransparency &transparency)
void setBackgroundFill(bool bEnable)
void setColumnWidth(double colWidth)
OdGeVector3d direction() const
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
void setColumnType(ColumnType colType)
OdDb::LineSpacingStyle lineSpacingStyle() const
OdGeMatrix3d getEcs() const
void setColumnFlowReversed(bool bFlowRev)
OdDbObjectId setField(const OdString &fieldName, OdDbField *pField)
FlowDirection flowDirection() const
OdDbObjectId removeField(const OdString &fieldName)
bool showBorders()
OdDb::TextHorzMode horizontalMode() const
void setFlowDirection(FlowDirection flowDirection)
void setAttachment(AttachmentPoint type)
void setWidth(double width)
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const
ColumnType getColumnType() const
void setNormal(const OdGeVector3d &normal)
void subClose()
void setDirection(const OdGeVector3d &direction)
double getColumnGutterWidth() const
void setHorizontalMode(OdDb::TextHorzMode horizontalMode)
OdGePoint3d location() const
void setBackgroundFillColor(const OdCmColor &color)
AttachmentPoint attachment() const
static const OdString overlineOff()
static const OdString strikethroughOn()
void setStaticColumns(double width, double gutter, OdInt16 count)
OdResult subGetClassID(void *pClsid) const
GLenum GLint * params
Definition: gles2_ext.h:184
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLsizei GLsizei * count
Definition: gles2_ext.h:276
GLint location
Definition: gles2_ext.h:284
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLenum attachment
Definition: gles2_ext.h:501
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
TextHorzMode
Definition: TextDefs.h:35
@ kBtoT
Definition: DbTableStyle.h:76
@ kTtoB
Definition: DbTableStyle.h:75
TextVertMode
Definition: TextDefs.h:45
Planarity
Definition: DbEntity.h:74
@ kMiddleCenter
Definition: DbTableStyle.h:94
@ kMiddleLeft
Definition: DbTableStyle.h:93
@ kBottomLeft
Definition: DbTableStyle.h:96
@ kTopRight
Definition: DbTableStyle.h:92
@ kBottomRight
Definition: DbTableStyle.h:98
@ kMiddleRight
Definition: DbTableStyle.h:95
@ kBottomCenter
Definition: DbTableStyle.h:97
@ kTopLeft
Definition: DbTableStyle.h:90
@ kTopCenter
Definition: DbTableStyle.h:91
LineSpacingStyle
Definition: TextDefs.h:53
double trackingFactor
Definition: DbMText.h:70
OdGePoint3d strikePoints[2]
Definition: DbMText.h:86
OdString text
Definition: DbMText.h:61
OdGePoint3d underPoints[2]
Definition: DbMText.h:84
bool newParagraph
Definition: DbMText.h:99
OdGePoint2d extents
Definition: DbMText.h:66
OdGePoint3d overPoints[2]
Definition: DbMText.h:85
bool strikethrough
Definition: DbMText.h:82
OdString fontname
Definition: DbMText.h:90
OdGePoint3d location
Definition: DbMText.h:55
double widthFactor
Definition: DbMText.h:68
bool stackBottom
Definition: DbMText.h:78
double obliqueAngle
Definition: DbMText.h:69
OdCmEntityColor color
Definition: DbMText.h:74
OdString bigfont
Definition: DbMText.h:64
OdString font
Definition: DbMText.h:63
double capsHeight
Definition: DbMText.h:67
double firstLineInd
Definition: DbMText.h:111
OdGeDoubleArray tabs
Definition: DbMText.h:113
double paragraphInd
Definition: DbMText.h:109