DgnAttachment.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 "DgnPlatform.h"
11 
13 
16  {
17  LocateOn = 0,
18  LocateOff = 1,
19  ParentLocateOff = 2,
20  NoLocateRights = 3,
22  };
23 
25 enum class ProxyCacheStatus
26  {
27  NotCached = 0,
28  UpToDate = 1,
29  ModelChanged = 2,
30  ViewChanged = 3,
31  NotUsedInView = 4,
32  AttachmentChanged = 5,
33  ObsoleteVersion = 6,
34  NotDisplayedInView = 7,
35  MissingReferences = 8,
36  Disconnected = 9,
37  ReferenceNotFound = 10,
40  };
41 
43  {
44  UInt32 symbologySet:1;
45  UInt32 hiliteBoundary:1;
46  UInt32 displayHilitedManip:1;
47  UInt32 displayHilitedSelected:1;
48  UInt32 dontUpdateChildren:1;
49  UInt32 redundant:1;
50  UInt32 missingModel:1;
51  UInt32 rightNotGranted:1;
52  UInt32 namedGroupFound:1;
53  UInt32 revisionNotAvailable:1;
54  UInt32 resolvedHistoryTag:1;
55  UInt32 revisionFromParent:1;
56  UInt32 findModelByID:1;
57  UInt32 missingGeoCoordApp:1;
58  UInt32 missingGeoCoordSys:1;
59  UInt32 isCircular:1;
60  UInt32 calculatedTransformUsed:1;
61  UInt32 namedGroupProcessingComplete:1;
62  UInt32 hiddenLineCaching:2;
63  UInt32 proxyCacheSynchOption:2;
64  UInt32 dontAddRefClip:1;
65  UInt32 unused:9;
66  };
67 
68 
69 
70 //=======================================================================================
73 //=======================================================================================
75  {
77  virtual ~DgnAttachmentAppData () {}
78 
80  struct Key : AppDataKey {};
81 
83  virtual void _OnCleanup (DgnAttachmentR host) = 0;
84 
88  virtual bool _OnCacheRelease (DgnAttachmentR host) {return false;}
89 
91  virtual void _OnRewrite (DgnAttachmentR host) { }
92  };
93 
94 /*=================================================================================**/
193 {
194 private:
195  virtual void MakeClassAbstract() = 0;
196 public:
197 public:
198 
201  {
205  };
206 
208 
209  DGNPLATFORM_EXPORT StatusInt WriteToModel (bool loadRasterRefs = false, bool treatAsNew = false);
216 
223  DGNPLATFORM_EXPORT StatusInt Rewrite (bool writeSettings, bool writeLevelDisplaySettings);
224 
228  DGNPLATFORM_EXPORT ElementId GetElementId () const;
229 
231 
233 
241 
247  DGNPLATFORM_EXPORT StatusInt DropAppData (DgnAttachmentAppData::Key const& key);
248 
254  DGNPLATFORM_EXPORT DgnAttachmentAppData* FindAppData (DgnAttachmentAppData::Key const& key) const;
256 
258 
259 
264  DGNPLATFORM_EXPORT DgnModelRefCR GetParent () const;
265 
269  DGNPLATFORM_EXPORT DgnModelRefR GetParentR ();
270 
275  DGNPLATFORM_EXPORT DgnAttachmentCP GetParentDgnAttachmentCP() const;
276 
280  DGNPLATFORM_EXPORT DgnAttachmentP GetParentDgnAttachmentP();
281 
287  DGNPLATFORM_EXPORT DgnAttachmentCR GetBaseDgnAttachment () const;
288 
292  DGNPLATFORM_EXPORT DgnAttachmentR GetBaseDgnAttachmentR ();
293 
295 
297 
298 
304  DGNPLATFORM_EXPORT WString GetAttachFileName () const;
305 
311  DGNPLATFORM_EXPORT WString GetAttachFullFileSpec (bool dontFindIfPreviouslyNotFound = true) const;
312 
317  DGNPLATFORM_EXPORT WCharCP GetAttachModelName () const;
318 
322  DGNPLATFORM_EXPORT bool IsMissingFile () const;
323 
326  DGNPLATFORM_EXPORT bool IsMissingModel () const;
327 
330  DGNPLATFORM_EXPORT bool IsRightNotGranted() const;
331 
334  DGNPLATFORM_EXPORT bool IsRevisionNotAvailable() const;
335 
338  DGNPLATFORM_EXPORT bool IsMissingGeoCoordApp() const;
339 
342  DGNPLATFORM_EXPORT bool IsMissingGeoCoordSys() const;
343 
346  DGNPLATFORM_EXPORT DgnDocumentMonikerPtr GetAttachMoniker () const;
347 
350  DGNPLATFORM_EXPORT void SetAttachMoniker (DgnDocumentMonikerR);
351 
353 
355 
356  DGNPLATFORM_EXPORT void GetTransformToParent (TransformR, bool scaleZfor2dRef) const;
362 
366  DGNPLATFORM_EXPORT void SetRotMatrix (RotMatrixCR);
367 
371  DGNPLATFORM_EXPORT RotMatrixCR GetRotMatrix () const;
372 
377  DGNPLATFORM_EXPORT void SetMasterOrigin (DPoint3dCR);
378 
382  DGNPLATFORM_EXPORT void GetMasterOrigin (DPoint3dR origin) const;
383 
389  DGNPLATFORM_EXPORT void SetRefOrigin (DPoint3dCR);
390 
394  DGNPLATFORM_EXPORT DPoint3dCR GetRefOrigin () const;
395 
400  DGNPLATFORM_EXPORT void SetScaleMode (ScaleMode);
401 
405  DGNPLATFORM_EXPORT ScaleMode GetScaleMode () const;
406 
410  DGNPLATFORM_EXPORT void SetStoredScale (double);
411 
417  DGNPLATFORM_EXPORT double GetStoredScale () const;
418 
424  DGNPLATFORM_EXPORT double GetDisplayScale () const;
426 
428 
429  DGNPLATFORM_EXPORT bool IsLocateLocked () const;
434 
438  DGNPLATFORM_EXPORT void SetLocateLock (bool);
439 
444  DGNPLATFORM_EXPORT DgnAttachmentLocateStatus GetLocateStatus () const;
445 
450  DGNPLATFORM_EXPORT bool IsSnapLocked () const;
451 
455  DGNPLATFORM_EXPORT void SetSnapLock (bool);
456 
466  DGNPLATFORM_EXPORT void SetIsDisplayed (bool state, bool loadIfNecessary=true, bool processAffected=true);
467 
472  DGNPLATFORM_EXPORT bool IsDisplayed () const;
473 
478  DGNPLATFORM_EXPORT void SetDgnAttachmentLevel (LevelId levelId);
479 
483  DGNPLATFORM_EXPORT LevelId GetDgnAttachmentLevel () const;
484 
488  DGNPLATFORM_EXPORT bool DoesLevelControlDisplay () const;
489 
493  DGNPLATFORM_EXPORT void SetLevelControlsDisplay (bool);
494 
498  DGNPLATFORM_EXPORT bool IsApplicationLocked () const;
499 
504  DGNPLATFORM_EXPORT void SetApplicationLocked (bool);
505 
516  DGNPLATFORM_EXPORT void SetNestDepth (UInt16 d);
517 
521  DGNPLATFORM_EXPORT UShort GetNestDepth () const;
522 
525  DGNPLATFORM_EXPORT void SetTransparency (double value);
526 
531  DGNPLATFORM_EXPORT bool GetDoNotDisplayAsNested () const;
532 
536  DGNPLATFORM_EXPORT void SetDoNotDisplayAsNested (bool);
537 
541  DGNPLATFORM_EXPORT bool IsInSS () const;
542 
547  DGNPLATFORM_EXPORT bool IsHighlighted (bool checkParents = true) const;
549 
551 
552  DGNPLATFORM_EXPORT bool IsClipped () const;
555 
562  DGNPLATFORM_EXPORT void GetClipBoundaries (ClipVectorPtr& clip, ViewportP vp, bool relativeToImmediateParent, bool onlyMasksIfClipElement) const;
563 
566  DGNPLATFORM_EXPORT ElementId GetClipElementId () const;
567 
572  DGNPLATFORM_EXPORT StatusInt SetClipElementId (ElementId clipElement);
573 
576  DGNPLATFORM_EXPORT void ClearClipElementId ();
577 
581  DGNPLATFORM_EXPORT UInt32 GetClipPointCount () const;
582 
587  DGNPLATFORM_EXPORT void GetClipPoints (bvector<DPoint2d>& clipPoints) const;
588 
593  DGNPLATFORM_EXPORT StatusInt SetClipPoints (DPoint2dCP points, UInt32 numPoints);
594 
603  DGNPLATFORM_EXPORT StatusInt SetClipBoundFromViewPoints (DPoint2dCP points, UInt32 numPoints, RotMatrixCR viewRotMatrix, DPoint3dR viewOrigin, double viewActiveZ, bool discardClipMasks);
604 
610  DGNPLATFORM_EXPORT StatusInt AppendClipVoidPoints (DPoint2dP points, UInt32 numPoints, RotMatrixCR viewRotMatrix);
611 
615  DGNPLATFORM_EXPORT bool HasBackClip () const;
616 
620  DGNPLATFORM_EXPORT bool HasFrontClip () const;
621 
626  DGNPLATFORM_EXPORT double GetFrontClipDepth () const;
627 
632  DGNPLATFORM_EXPORT StatusInt SetFrontClipDepth (double depth);
633 
638  DGNPLATFORM_EXPORT double GetBackClipDepth () const;
639 
644  DGNPLATFORM_EXPORT StatusInt SetBackClipDepth (double depth);
645 
648  DGNPLATFORM_EXPORT RotMatrixCR GetClipRotMatrix () const;
649 
653  DGNPLATFORM_EXPORT void SetClipRotMatrix (RotMatrixCR rotation);
654 
659  DGNPLATFORM_EXPORT bool IsRotateClipping () const;
660 
665  DGNPLATFORM_EXPORT void SetRotateClipping (bool yesNo);
667 
669 
670  DGNPLATFORM_EXPORT StatusInt SetLogicalName (WCharCP);
675 
680  DGNPLATFORM_EXPORT WCharCP GetLogicalName () const;
681 
685  DGNPLATFORM_EXPORT void SetUniqueLogical ();
686 
690  DGNPLATFORM_EXPORT void SetAttachDescription (WCharCP);
691 
696  DGNPLATFORM_EXPORT WCharCP GetAttachDescription () const;
698 
701  {
702  private:
703  friend struct DgnAttachment;
704  bool m_clipBoundary;
705  bool m_applyFrontBackClip;
706  bool m_keepMask;
707 
708  public:
709  ApplyViewClipOptions () : m_clipBoundary(true), m_applyFrontBackClip(true), m_keepMask(true) {;}
710 
711  void SetClipBoundary (bool b) {m_clipBoundary=b;}
712  void SetApplyFrontBackClip (bool b) {m_applyFrontBackClip=b;}
713  void SetKeepMask (bool b) {m_keepMask=b;}
714  };
715 
717 
718  DGNPLATFORM_EXPORT StatusInt ApplyNamedView (WCharCP viewName, double userScale, double acsScale = 1.0, ApplyViewClipOptions const& clipOptions = ApplyViewClipOptions(), bool getModelFromView = true, StandardView auxRotation = StandardView::NotStandard);
729 
736  DGNPLATFORM_EXPORT StatusInt ApplyStandardView (StandardView stdview, double userScale, double acsScale = 1.0);
737 
741  DGNPLATFORM_EXPORT NamedViewPtr GetNamedView () const;
742 
745  DGNPLATFORM_EXPORT void SetSynchWithNamedView (ReferenceSynchOption);
746 
749  DGNPLATFORM_EXPORT ReferenceSynchOption GetSynchWithNamedView () const;
750 
752 
753 };
754 
755 
The elements in the DgnAttachment can be located.
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
virtual ~DgnAttachmentAppData()
Destructor, overridden by subclasses if needed to free resources.
Definition: DgnAttachment.h:77
UInt32 LevelId
Definition: DgnPlatformBaseType.r.h:85
There are elements within the cached model that were created since the cache was calulated.
uint16_t UInt16
Definition: Bentley.r.h:118
The elements can't be located because Locate is turned off for this DgnAttachment.
Resolution Scale and Storage unit scale from parent model to referenced model is automatically applie...
Definition: DgnAttachment.h:202
ReferenceSynchOption
Definition: DgnPlatform.r.h:1899
The elements can't be located because the Locate permission is disallowed for this DgnAttachment...
The elements can't be located because Locate is turned off for a parent DgnAttachment of this DgnAtta...
struct RotMatrix const & RotMatrixCR
Definition: msgeomstructs_typedefs.h:135
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
The root parent of the reference does not match the root model of the view.
struct DgnPlatform::DgnModelRef const & DgnModelRefCR
Definition: DgnPlatform.h:223
virtual void _OnRewrite(DgnAttachmentR host)
Override this method to be notified when the attachment element is rewritten (due to an attachment ch...
Definition: DgnAttachment.h:91
wchar_t const * WCharCP
Definition: Bentley.h:224
uint32_t UInt32
Definition: Bentley.r.h:128
ApplyViewClipOptions()
Definition: DgnAttachment.h:709
ScaleMode
How elements in the referenced model are to be scaled when displayed through this attachment...
Definition: DgnAttachment.h:200
The Proxy Cache is up to date and valid.
3d point coordinates.
Definition: dpoint3d.h:19
There are some DgnAttachments that were present when the cache was created that are no longer found...
An application can store per-DgnAttachment data that it needs at runtime by subclassing DgnAttachment...
Definition: DgnAttachment.h:74
A DgnDocumentMoniker identifies a file.
Definition: DgnDocumentManager.h:181
Only User Scale is applied.
Definition: DgnAttachment.h:204
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
unsigned short UShort
Definition: Bentley.r.h:133
A unique (for this session) key to identify this AppData type.
Definition: DgnAppData.h:21
The attachment viewing angle, camera, or clipping has changed, so the cache no longer accurately refl...
The cache is from an old version and cannot be used.
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
The set of elements displayed has changed. A level could have been turned on or off, or an element class turned on or off.
A DgnAttachment represents a reference from one model to another, with transforming, clipping, and filtering applied.
Definition: DgnAttachment.h:192
int StatusInt
Definition: Bentley.h:222
3x4 matrix for defining coordinate frames and affine transformations.
Definition: transform.h:22
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
Clipping options when applying a named view.
Definition: DgnAttachment.h:700
The root parent of the DgnAttachment matches root model of the view, but the DgnAttachment is not dis...
virtual bool _OnCacheRelease(DgnAttachmentR host)
Override this method to be notified when the DgnModel associated with the DgnAttachment is about to b...
Definition: DgnAttachment.h:88
DgnAttachmentLocateStatus
Returned by GetLocateStatus to indicate whether the elements within a DgnAttachment can be located...
Definition: DgnAttachment.h:15
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
The elements can't be located because the Locate permission is disallowed for a parent DgnAttachment ...
A unique Key to identify each subclass of DgnAttachmentAppData.
Definition: DgnAttachment.h:80
Definition: DgnAttachment.h:42
Resolution Scale from parent model to referenced model is automatically applied in addition to user s...
Definition: DgnAttachment.h:203
ProxyCacheStatus
Returned by GetProxyCacheStatus to indicate the status of the ProxyCache of this DgnAttachment.
Definition: DgnAttachment.h:25
struct DPoint2d const * DPoint2dCP
Definition: msgeomstructs_typedefs.h:78
struct DgnPlatform::DgnAttachment const * DgnAttachmentCP
Definition: DgnPlatform.h:185
StandardView
Definition: DgnPlatform.r.h:388
void SetApplyFrontBackClip(bool b)
Sets whether to assign the DgnAttachment front and back clipping planes from the named view front and...
Definition: DgnAttachment.h:712
void SetClipBoundary(bool b)
Sets whether to assign the DgnAttachment clip boundary from the named view extent.
Definition: DgnAttachment.h:711
2d point coordinates.
Definition: dpoint2d.h:23
void SetKeepMask(bool b)
Sets whether to retain the current clip masks if possible.
Definition: DgnAttachment.h:713
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Definition: DgnViewport.h:186
struct DgnPlatform::DgnAttachment const & DgnAttachmentCR
Definition: DgnPlatform.h:185

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