CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
DbMText.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 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#include "DwgDeclareMembers.h"
38
39class OdGeVector3d;
40class OdGePoint2d;
41
55{
56 OdGePoint3d location; // Insertion point.
57
58 /* OdGeVector3d normal;
59 OdGeVector3d direction;
60 */
61
62 OdString text; // Text string.
63
64 OdString font; // SHX Font.
65 OdString bigfont; // SHX Bigfont.
66
67 OdGePoint2d extents; // Extents in OCS.
68 double capsHeight; // Height.
69 double widthFactor; // Width factor.
70 double obliqueAngle; // Obliquing angle.
71 double trackingFactor; // Tracking factor.
72
73 // OdUInt16 colorIndex;
74
76 bool vertical; // Text is vertical.
77
78 bool stackTop; // Text is top of stacked text.
79 bool stackBottom; // Text is bottom of stacked text.
80
81 bool underlined; // Text is underlined.
82 bool overlined; // Text is overlined.
84
85 OdGePoint3d underPoints[2]; // Underline endpoints.
86 OdGePoint3d overPoints[2]; // Overline endpoints.
88
89 // true type font data
90
91 OdString fontname; // TrueType font name, or empty string.
92 int charset; // TrueType character set.
93 bool bold; // Text is bold.
94 bool italic; // Text is italic.
95
96 // 0 - no change 1 - change to original 2 - change to other
97
98 int changeStyle; // 0 == No change; 1 == Change to original; 2 == Change to other
99 bool lineBreak; // Text is followed by a line break.
100 bool newParagraph; // Text fragment starts new paragraph.
101};
102
109{
110 double paragraphInd; // Subsequent line indent.
111
112 double firstLineInd; // First line indent.
113
114 OdGeDoubleArray tabs; // Tab settings.
117};
118
119typedef int(*OdDbMTextEnum)(
121 void *);
122
124
125class OdDbText;
126
140{
141public:
143
145
150
157 const OdGePoint3d& location);
158
163
170 const OdGeVector3d& normal);
171
176
186 const OdGeVector3d& direction);
187
191 double rotation() const;
192
199 double rotation);
200
207 double width() const;
208
218 double width);
219
224
231 OdDbObjectId textStyleId);
232
236 double textHeight() const;
237
247 double height);
248
250 {
251 kTopLeft = 1, // Top Left
252 kTopCenter = 2, // Top Center
253 kTopRight = 3, // Top Right
254 kMiddleLeft = 4, // Middle Left
255 kMiddleCenter = 5, // Middle Center
256 kMiddleRight = 6, // Middle Right
257 kBottomLeft = 7, // Bottom Left
258 kBottomCenter = 8, // Bottom Center
259 kBottomRight = 9, // Bottom Right
260 kBaseLeft = 10, // Baseline Left /reserved for future use/
261 kBaseCenter = 11, // Baseline Center /reserved for future use/
262 kBaseRight = 12, // Baseline Right /reserved for future use/
263 kBaseAlign = 13, // Baseline Aligned /reserved for future use/
264 kBottomAlign = 14, // Bottom Aligned /reserved for future use/
265 kMiddleAlign = 15, // Middle Aligned /reserved for future use/
266 kTopAlign = 16, // Top Aligned /reserved for future use/
267 kBaseFit = 17, // Baseline Fit /reserved for future use/
268 kBottomFit = 18, // Bottom Fit /reserved for future use/
269 kMiddleFit = 19, // Middle Fit /reserved for future use/
270 kTopFit = 20, // Top Fit /reserved for future use/
271 kBaseMid = 21, // Baseline Middled /reserved for future use/
272 kBottomMid = 22, // Bottom Middled /reserved for future use/
273 kMiddleMid = 23, // Middle Middled /reserved for future use/
274 kTopMid = 24 // Top Middled /reserved for future use/
275 };
276
297
333
338 {
340 kLtoR = 1,
342 kRtoL = 2,
344 kTtoB = 3,
346 kBtoT = 4,
349 };
350
367
390
395
402
410
417
424 double actualWidth() const;
425
432 static const OdString nonBreakSpace();
433
440 static const OdString overlineOn();
441
448 static const OdString overlineOff();
449
456 static const OdString underlineOn();
457
464 static const OdString underlineOff();
465
472 static const OdString colorChange();
473
480 static const OdString fontChange();
481
488 static const OdString heightChange();
489
496 static const OdString widthChange();
497
504 static const OdString obliqueChange();
505
512 static const OdString trackChange();
513
520 static const OdString lineBreak();
521
527 static const OdString paragraphBreak();
528
534 static const OdString stackStart();
535
542 static const OdString alignChange();
543
550 static const OdString blockBegin();
551
558 static const OdString blockEnd();
559
566 static const OdString strikethroughOn();
567
575
592
597
607 double lineSpacingFactor);
608
612 double lineSpacingFactor() const;
613
632
656
672
693
698
700
702 OdDbDwgFiler* pFiler);
703
704 virtual void dwgOutFields(
705 OdDbDwgFiler* pFiler) const;
706
708 OdDbDxfFiler* pFiler);
709
710 virtual void dxfOutFields(
711 OdDbDxfFiler* pFiler) const;
712
714 OdGiWorldDraw* pWd) const;
715
717 OdGiViewportDraw* pVd) const;
718
720
722 OdRxObjectPtrArray& entitySet) const;
723
725 OdRxObjectPtrArray& entitySet) const;
726
728 void* pClsid) const;
729
730 void subClose();
731
732 virtual bool isPlanar() const { return true; };
733
754 OdDbMTextEnum fragmentFn,
755 void *params,
756 OdGiWorldDraw *ctxt = 0) const;
757
767 OdGiWorldDraw *ctxt = 0) const;
768
788 OdGePoint3dArray& boundingPoints, double dGapX = 0., double dGapY = 0.) const;
789
807 OdGePoint3dArray& boundingPoints) const;
808
842
844 OdGeExtents3d& extents) const;
845
849 bool backgroundFillOn() const;
850
856 bool bEnable);
857
862
868 const OdCmColor& color);
869
877
890 const double scaleFactor);
891
896
903
909
918 bool enable);
919
925 OdDbMTextIndents& indents) const;
926
928 const OdString& fieldName,
929 OdDbField* pField);
931 OdDbObjectId fieldId);
933 const OdString& fieldName);
934
945
951 OdDbDatabase *pDb,
952 bool doSubents);
953
959
960 void setDynamicColumns(double width, double gutter, bool bAutoHeigh);
961 void setStaticColumns(double width, double gutter, OdInt16 count);
962
977
991
996
1005 void setColumnAutoHeight(bool bAutoHeigh);
1006
1011
1021
1025 double getColumnWidth() const;
1026
1035 void setColumnWidth(double colWidth);
1036
1040 double getColumnGutterWidth() const;
1041
1050 void setColumnGutterWidth(double colGutter);
1051
1056
1062 void setColumnFlowReversed(bool bFlowRev);
1063
1069 double getColumnHeight(OdInt16 col) const;
1070
1080 void setColumnHeight(OdInt16 col, double colHeight);
1081
1085 double height() const;
1086
1092 void setHeight(double value);
1093
1094 virtual OdResult getPlane(OdGePlane& plane, OdDb::Planarity& planarity) const;
1095
1097
1101 double ascent() const;
1102
1106 double descent() const;
1107
1113 void setShowBorders(bool bEnable);
1114
1117 bool showBorders() const;
1118
1122
1127
1132};
1133
1138
1139#include "TD_PackPop.h"
1140
1141#endif
1142
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
OdSmartPtr< OdDbEntity > OdDbEntityPtr
Definition DbEntity.h:51
#define DBENT_EXPORT
Definition DbExport.h:67
OdSmartPtr< OdDbMText > OdDbMTextPtr
Definition DbMText.h:1137
int(* OdDbMTextEnum)(OdDbMTextFragment *, void *)
Definition DbMText.h:119
OdArray< OdDbMTextIndent > OdDbMTextIndents
Definition DbMText.h:123
OdArray< double, OdMemoryAllocator< double > > OdGeDoubleArray
unsigned int OdUInt32
short OdInt16
int OdInt32
OdResult
Definition OdResult.h:29
OdArray< OdRxObjectPtr > OdRxObjectPtrArray
Definition RxObject.h:1196
OdCmColor color() const
OdCmTransparency transparency() const
OdResult removeField(OdDbObjectId fieldId)
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
void setUseBackgroundColor(bool enable)
static const OdString heightChange()
double textHeight() const
void setHeight(double value)
static const OdString underlineOff()
int setContentsRTF(const OdString &text, BaseTextHeightRFT base=kRTFTextHeightUIExport)
double getColumnWidth() const
OdString text() const
void setColumnHeight(OdInt16 col, double colHeight)
double width() const
static const OdString overlineOn()
OdGeVector3d normal() const
double getBackgroundScaleFactor() const
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:250
@ kBaseRight
Definition DbMText.h:262
@ kBottomLeft
Definition DbMText.h:257
@ kTopCenter
Definition DbMText.h:252
@ kMiddleFit
Definition DbMText.h:269
@ kBaseCenter
Definition DbMText.h:261
@ kTopAlign
Definition DbMText.h:266
@ kBottomMid
Definition DbMText.h:272
@ kMiddleMid
Definition DbMText.h:273
@ kBottomAlign
Definition DbMText.h:264
@ kBaseLeft
Definition DbMText.h:260
@ kBottomCenter
Definition DbMText.h:258
@ kMiddleAlign
Definition DbMText.h:265
@ kBottomRight
Definition DbMText.h:259
@ kBottomFit
Definition DbMText.h:268
@ kMiddleLeft
Definition DbMText.h:254
@ kMiddleRight
Definition DbMText.h:256
@ kBaseAlign
Definition DbMText.h:263
@ kMiddleCenter
Definition DbMText.h:255
@ kTopRight
Definition DbMText.h:253
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)
BaseTextHeightRFT
Definition DbMText.h:404
@ kRTFTextHeightUIExport
Definition DbMText.h:406
@ kRTFHalfTextHeightUIExport
Definition DbMText.h:408
static const OdString paragraphBreak()
void setVerticalMode(OdDb::TextVertMode verticalMode)
void setTextHeight(double height)
void setLocation(const OdGePoint3d &location)
OdString contentsRTF() const
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:956
@ kDynamicColumns
Definition DbMText.h:957
@ kNoColumns
Definition DbMText.h:955
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
OdString getTextWithFieldCodes() 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)
virtual bool isPlanar() const
Definition DbMText.h:732
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)
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
DWGMAP_DECLARE_MEMBERS(OdDbMText)
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
bool showBorders() const
static const OdString overlineOff()
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const
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
GLsizei GLsizei * count
Definition gles2_ext.h:276
GLuint GLsizei GLsizei GLint GLenum * type
Definition gles2_ext.h:274
GLsizei const GLfloat * value
Definition gles2_ext.h:302
TextHorzMode
Definition TextDefs.h:35
TextVertMode
Definition TextDefs.h:45
Planarity
Definition DbEntity.h:74
LineSpacingStyle
Definition TextDefs.h:53
double trackingFactor
Definition DbMText.h:71
OdGePoint3d strikePoints[2]
Definition DbMText.h:87
OdString text
Definition DbMText.h:62
OdGePoint3d underPoints[2]
Definition DbMText.h:85
OdGePoint2d extents
Definition DbMText.h:67
OdGePoint3d overPoints[2]
Definition DbMText.h:86
OdString fontname
Definition DbMText.h:91
OdGePoint3d location
Definition DbMText.h:56
double widthFactor
Definition DbMText.h:69
double obliqueAngle
Definition DbMText.h:70
OdCmEntityColor color
Definition DbMText.h:75
OdString bigfont
Definition DbMText.h:65
OdString font
Definition DbMText.h:64
double capsHeight
Definition DbMText.h:68
double firstLineInd
Definition DbMText.h:112
OdGeDoubleArray tabs
Definition DbMText.h:114
double paragraphInd
Definition DbMText.h:110