DimensionHandler.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include "TextHandlers.h"
14 
15 
18 
19 DGNPLATFORM_TYPEDEFS (IDimCreateData);
20 
22 
23 struct DimFormattedText;
24 
25 /*=================================================================================**/
35  {
36  protected:
38 
40  { m_dirFormatter = DirectionFormatter::Create(); }
41 
42  public:
43 
44  virtual ~IDimCreateData () {}
45  virtual DimensionStyleCR _GetDimStyle() const = 0;
46  virtual DgnTextStyleCR _GetTextStyle() const = 0;
47  virtual Symbology _GetSymbology() const = 0;
48  virtual LevelId _GetLevelID() const = 0;
49  virtual DirectionFormatterCR _GetDirFormat() const {return *m_dirFormatter;}
50  virtual int _GetViewNumber() const = 0;
51  virtual RotMatrixCR _GetDimRMatrix() const = 0;
52  virtual RotMatrixCR _GetViewRMatrix() const = 0;
53  virtual bool _GetAnnScaleAllowed() const {return true;}
54  };
55 
56 /*=================================================================================**/
65 {
66 private:
67  virtual void MakeClassAbstract() = 0;
68 public:
69 public:
70 
74 DGNPLATFORM_EXPORT DimensionType GetDimensionType (ElementHandleCR eh) const;
75 
80 DGNPLATFORM_EXPORT DimensionStylePtr GetDimensionStyle (ElementHandleCR eh) const;
81 
89 DGNPLATFORM_EXPORT DimStylePropMaskPtr GetOverrideFlags (ElementHandleCR eh) const;
90 
94 DGNPLATFORM_EXPORT int GetNumPoints (ElementHandleCR eh) const;
95 
99 DGNPLATFORM_EXPORT int GetNumSegments (ElementHandleCR eh) const;
100 
106 DGNPLATFORM_EXPORT BentleyStatus ExtractPoint (ElementHandleCR eh, DPoint3dR point, int iPoint) const;
107 
114 DGNPLATFORM_EXPORT BentleyStatus GetHeight (ElementHandleCR eh, double& height) const;
115 
122 DGNPLATFORM_EXPORT BentleyStatus GetJustification (ElementHandleCR eh, int segmentNo, DimStyleProp_Text_Justification& just) const;
123 
129 DGNPLATFORM_EXPORT BentleyStatus GetWitnessVisibility (ElementHandleCR eh, int pointNo, bool& value) const;
130 
136 DGNPLATFORM_EXPORT BentleyStatus GetWitnessUseAltSymbology (ElementHandleCR eh, int pointNo, bool& value) const;
137 
142 DGNPLATFORM_EXPORT BentleyStatus GetRotationMatrix (ElementHandleCR eh, RotMatrixR rmatrix) const;
143 
150 DGNPLATFORM_EXPORT BentleyStatus GetProxyCell (ElementHandleCR dimElement, DgnPlatform::ElementId& proxyCellId, DPoint3dP origin, RotMatrixP rotMatrix) const;
151 
156 DGNPLATFORM_EXPORT BentleyStatus GetTextOffset (ElementHandleCR dimElement, int segmentNo, DPoint2dR offset) const;
157 
161 DGNPLATFORM_EXPORT BentleyStatus GetViewRotation (ElementHandleCR dimElement, RotMatrixR rmatrix) const;
162 
165 DGNPLATFORM_EXPORT bool GetAngularDimensionClockWiseSweep (ElementHandleCR dimElement) const;
166 };
167 
168 /*=================================================================================**/
174 {
175 private:
176  virtual void MakeClassAbstract() = 0;
177 public:
178 public:
179 
188 DGNPLATFORM_EXPORT void ApplyDimensionStyle (EditElementHandleR eeh, DimensionStyleCR dimStyle, bool retainOverrides);
189 
196 DGNPLATFORM_EXPORT BentleyStatus SetPoint (EditElementHandleR eeh, DPoint3dCP point, AssocPoint const* assocPt, int iPoint);
197 
205 DGNPLATFORM_EXPORT BentleyStatus InsertPoint (EditElementHandleR eeh, DPoint3dCP point, AssocPoint const* assocPt, DimensionStyleCR dimStyle, int iPoint);
206 
213 DGNPLATFORM_EXPORT BentleyStatus SetHeight (EditElementHandleR eeh, double height);
214 
220 DGNPLATFORM_EXPORT BentleyStatus SetJustification (EditElementHandleR eeh, int segmentNo, DimStyleProp_Text_Justification just);
221 
227 DGNPLATFORM_EXPORT BentleyStatus SetWitnessVisibility (EditElementHandleR eeh, int pointNo, bool value);
228 
234 DGNPLATFORM_EXPORT BentleyStatus SetWitnessUseAltSymbology (EditElementHandleR eh, int pointNo, bool value);
235 
240 DGNPLATFORM_EXPORT BentleyStatus SetRotationMatrix (EditElementHandleR eeh, RotMatrixCR rmatrix);
241 
247 DGNPLATFORM_EXPORT BentleyStatus DeletePoint (EditElementHandleR dim, int pointNo);
248 
255 DGNPLATFORM_EXPORT DgnHandlersStatus SetProxyCell (EditElementHandleR dimElement, DgnPlatform::ElementId const& proxyCellId, DPoint3dCR origin, RotMatrixCR rotMatrix);
256 
261 DGNPLATFORM_EXPORT BentleyStatus SetTextOffset (EditElementHandleR dimElement, int segmentNo, DPoint2dCR offset);
262 
266 DGNPLATFORM_EXPORT BentleyStatus SetViewRotation (EditElementHandleR dimElement, RotMatrixCR rMatrix);
267 
271 DGNPLATFORM_EXPORT void SetAngularDimensionClockWiseSweep (EditElementHandleR dimElement, bool value);
272 
281 DGNPLATFORM_EXPORT BentleyStatus SetPointsForLabelLine (EditElementHandleR eeh, DSegment3dCP segment, HitPathP hitPath, double offset, RotMatrixCR viewRMatrix, DimensionStyleCR dimStyle);
282 
283 
284 };
285 
286 /*=================================================================================**/
289 
293  {
294 
296  DGNPLATFORM_EXPORT UInt32 GetPartSegment () const;
298  DGNPLATFORM_EXPORT DimensionTextPartType GetPartType () const;
300  DGNPLATFORM_EXPORT DimensionTextPartSubType GetPartSubType () const;
301 
302  public:
307  DGNPLATFORM_EXPORT static ITextPartIdPtr Create (UInt32 partSegment, DimensionPartType partType, DimensionPartSubType partSubType);
308 
313  DGNPLATFORM_EXPORT static ITextPartIdPtr Create (UInt32 partSegment, DimensionTextPartType partType, DimensionTextPartSubType partSubType);
314 
315  }; // DimensionTextPartId
316 
317 
318 
319 /*=================================================================================**/
328  ITextEdit
329 {
332 
333 DGNPLATFORM_EXPORT static BentleyStatus GetTextPointNo(int& pointNo, ElementHandleCR element, int segmentNo);
335 
343 DGNPLATFORM_EXPORT static BentleyStatus CreateDimensionElement (EditElementHandleR eeh, IDimCreateDataCR createData, DimensionType dimType, bool is3d, DgnModelRefR modelRef);
344 
345 };
347 
348 
350 
3x3 matrix commonly used for pure rotations, but in general may also have scales and non-perpendicula...
Definition: rotmatrix.h:21
virtual ~IDimCreateData()
Definition: DimensionHandler.h:44
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
Definition: HitPath.h:87
UInt32 LevelId
Definition: DgnPlatformBaseType.r.h:85
#define ELEMENTHANDLER_DECLARE_MEMBERS(__classname__, __exporter__)
Definition: Handler.h:86
DGNPLATFORM_TYPEDEFS(IDimCreateData)
! While querying a dimension using ITextEdit and ITextQuery the returned ! object is a DimensionTextP...
Definition: DimensionHandler.h:292
DgnHandlersStatus
Definition: DgnPlatformErrors.r.h:241
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
struct RotMatrix const & RotMatrixCR
Definition: msgeomstructs_typedefs.h:135
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
DirectionFormatterPtr m_dirFormatter
Definition: DimensionHandler.h:37
Definition: DgnPlatform.h:1622
uint32_t UInt32
Definition: Bentley.r.h:128
DimensionType
Definition: DgnPlatform.r.h:1069
Definition: ITextEdit.h:46
Interface for handlers that support annotation behavior.
Definition: IAnnotationHandler.h:20
DimStyleProp_Text_Justification
Valid values for text justification.
Definition: DimensionStyleProps.r.h:370
Base class for handlers that control the display of graphic (visible) elements.
Definition: DisplayHandler.h:30
DimensionPartType
Definition: DimensionStyleProps.r.h:1659
3d point coordinates.
Definition: dpoint3d.h:19
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
BentleyStatus
Definition: Bentley.h:208
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
struct DgnPlatform::DgnTextStyle const & DgnTextStyleCR
Definition: DgnPlatform.h:229
Definition: ITextEdit.h:144
struct DSegment3d const * DSegment3dCP
Definition: msgeomstructs_typedefs.h:115
virtual bool _GetAnnScaleAllowed() const
If true, the dimension will be assigned the model's annotation scale if appropriate given the style a...
Definition: DimensionHandler.h:53
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
An object of this type is required to supply necessary information to DimensionHandler::CreateDimensi...
Definition: DimensionHandler.h:34
IDimCreateData()
Definition: DimensionHandler.h:39
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
The default type handler for Dimension elements (type: DIMENSION_ELM).
Definition: DimensionHandler.h:324
virtual DirectionFormatterCR _GetDirFormat() const
Supplies direction formatting information for the new dimension. Only called when creating label line...
Definition: DimensionHandler.h:49
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
Query an element for dimension specific properties.
Definition: DimensionHandler.h:64
Interface adopted by an Element Handler that wants to participate in MicroStation transactions...
Definition: ITransactionHandler.h:37
DimensionTextPartType
Definition: DimensionStyleProps.r.h:1690
Modify and Query dimension specific properties of an element.
Definition: DimensionHandler.h:173
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
DimensionTextPartSubType
Definition: DimensionStyleProps.r.h:1696
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
struct DgnPlatform::DimensionStyle const & DimensionStyleCR
Definition: DimensionStyle.h:16
#define EXPORT_VTABLE_ATTRIBUTE
Definition: Bentley.h:67
DimensionPartSubType
Definition: DimensionStyleProps.r.h:1675
2d point coordinates.
Definition: dpoint2d.h:23
Definition: DgnPlatform.r.h:543

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.