CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbMText.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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.
116 , firstLineInd(0.0) {}
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,
348 kByStyle = 5
349 };
350
367
389 FlowDirection flowDirection);
390
395
401 int setContents(const OdString& text);
402
408 int setContentsRTF(const OdString& text);
409
416 double actualWidth() const;
417
424 static const OdString nonBreakSpace();
425
432 static const OdString overlineOn();
433
440 static const OdString overlineOff();
441
448 static const OdString underlineOn();
449
456 static const OdString underlineOff();
457
464 static const OdString colorChange();
465
472 static const OdString fontChange();
473
480 static const OdString heightChange();
481
488 static const OdString widthChange();
489
496 static const OdString obliqueChange();
497
504 static const OdString trackChange();
505
512 static const OdString lineBreak();
513
519 static const OdString paragraphBreak();
520
526 static const OdString stackStart();
527
534 static const OdString alignChange();
535
542 static const OdString blockBegin();
543
550 static const OdString blockEnd();
551
558 static const OdString strikethroughOn();
559
567
583 OdDb::LineSpacingStyle lineSpacingStyle);
584
589
599 double lineSpacingFactor);
600
604 double lineSpacingFactor() const;
605
624
647 OdDb::TextHorzMode horizontalMode);
648
664
684 OdDb::TextVertMode verticalMode);
685
690
692
694 OdDbDwgFiler* pFiler);
695
696 virtual void dwgOutFields(
697 OdDbDwgFiler* pFiler) const;
698
700 OdDbDxfFiler* pFiler);
701
702 virtual void dxfOutFields(
703 OdDbDxfFiler* pFiler) const;
704
706 OdGiWorldDraw* pWd) const;
707
709 OdGiViewportDraw* pVd) const;
710
712
714 OdRxObjectPtrArray& entitySet) const;
715
717 OdRxObjectPtrArray& entitySet) const;
718
720 void* pClsid) const;
721
722 void subClose();
723
724 virtual bool isPlanar() const { return true; };
725
746 OdDbMTextEnum fragmentFn,
747 void *params,
748 OdGiWorldDraw *ctxt = 0) const;
749
759 OdGiWorldDraw *ctxt = 0) const;
760
780 OdGePoint3dArray& boundingPoints, double dGapX = 0., double dGapY = 0.) const;
781
799 OdGePoint3dArray& boundingPoints) const;
800
834
836 OdGeExtents3d& extents) const;
837
841 bool backgroundFillOn() const;
842
848 bool bEnable);
849
854
860 const OdCmColor& color);
861
869
882 const double scaleFactor);
883
888
894 const OdCmTransparency& transparency);
895
901
910 bool enable);
911
917 OdDbMTextIndents& indents) const;
918
920 const OdString& fieldName,
921 OdDbField* pField);
923 OdDbObjectId fieldId);
925 const OdString& fieldName);
926
937
943 OdDbDatabase *pDb,
944 bool doSubents);
945
949 kDynamicColumns
950 };
951
952 void setDynamicColumns(double width, double gutter, bool bAutoHeigh);
953 void setStaticColumns(double width, double gutter, OdInt16 count);
954
969
983
988
997 void setColumnAutoHeight(bool bAutoHeigh);
998
1003
1013
1017 double getColumnWidth() const;
1018
1027 void setColumnWidth(double colWidth);
1028
1032 double getColumnGutterWidth() const;
1033
1042 void setColumnGutterWidth(double colGutter);
1043
1048
1054 void setColumnFlowReversed(bool bFlowRev);
1055
1061 double getColumnHeight(OdInt16 col) const;
1062
1072 void setColumnHeight(OdInt16 col, double colHeight);
1073
1077 double height() const;
1078
1084 void setHeight(double value);
1085
1086 virtual OdResult getPlane(OdGePlane& plane, OdDb::Planarity& planarity) const;
1087
1089
1093 double ascent() const;
1094
1098 double descent() const;
1099
1105 void setShowBorders(bool bEnable);
1106
1109 bool showBorders() const;
1110
1114};
1115
1120
1121#include "TD_PackPop.h"
1122
1123#endif
1124
#define DBENT_EXPORT
Definition: DbExport.h:67
OdSmartPtr< OdDbMText > OdDbMTextPtr
Definition: DbMText.h:1119
int(* OdDbMTextEnum)(OdDbMTextFragment *, void *)
Definition: DbMText.h:119
OdArray< OdDbMTextIndent > OdDbMTextIndents
Definition: DbMText.h:123
unsigned int OdUInt32
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
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:338
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
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:948
@ kNoColumns
Definition: DbMText.h:947
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)
virtual bool isPlanar() const
Definition: DbMText.h:724
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
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
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
bool strikethrough
Definition: DbMText.h:83
OdString fontname
Definition: DbMText.h:91
OdGePoint3d location
Definition: DbMText.h:56
double widthFactor
Definition: DbMText.h:69
bool stackBottom
Definition: DbMText.h:79
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