ElementCopyContext.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 "DependencyManagerLinkage.h" // for DependencyRoot
11 #include "ElementHandle.h" // for ElementLinkageIteratorR
12 #include <Bentley/RefCounted.h>
13 
15 DGNPLATFORM_TYPEDEFS (PropertyCollection)
17 
19 
20 /*=================================================================================**/
204 //=======================================================================================
205 
206 //=======================================================================================
209 //=======================================================================================
211 {
213  ByUserPreference = 0,
215  CopyIfNotFound = 1,
217  CopyIfDifferent = 2,
219  CopyAlways = 3,
221  AlreadyRemapped = 4,
223  CopyByNumber = 5,
224 };
225 
226 //=======================================================================================
240 //=======================================================================================
242 {
243 private:
244  struct ECImpl;
245 
246  ECImpl* m_pimpl;
247 
248 public:
249  struct IEventHandler;
250 
251 //=======================================================================================
254 //=======================================================================================
256 {
257  Undefined = -1,
258  None = 0,
259  HasDefId = 1,
260  All = 2,
261 };
262 
263 //---------------------------------------------------------------------------------------
265 
266 //---------------------------------------------------------------------------------------
267 
269 
272 
275 
290 
291 //---------------------------------------------------------------------------------------
293 //---------------------------------------------------------------------------------------
294 
295 //---------------------------------------------------------------------------------------
297 
298 //---------------------------------------------------------------------------------------
299 
320 
321 //---------------------------------------------------------------------------------------
323 //---------------------------------------------------------------------------------------
324 
325 //---------------------------------------------------------------------------------------
327 
328 //---------------------------------------------------------------------------------------
329 
332 DGNPLATFORM_EXPORT void SetDestinationModelRef (DgnModelRefP);
333 
335 DGNPLATFORM_EXPORT DgnModelP GetDestinationModel ();
336 
338 DGNPLATFORM_EXPORT DgnModelRefP GetDestinationModelRef ();
339 
342 DGNPLATFORM_EXPORT void SetSourceModelRef (DgnModelRefP);
343 
345 DGNPLATFORM_EXPORT DgnModelRefP GetSourceModelRef (ElementHandleCP el = NULL);
346 
348 DGNPLATFORM_EXPORT DgnModelP GetSourceCache (ElementHandleCP el = NULL);
349 
351 DGNPLATFORM_EXPORT bool IsCopyFromReference ();
352 
354 DGNPLATFORM_EXPORT bool IsSameCache (ElementHandleCP eh = NULL);
355 
357 DGNPLATFORM_EXPORT bool IsSameFile (ElementHandleCP eh = NULL);
358 
365 DGNPLATFORM_EXPORT void GetModels (DgnModelRefP *srcModelRefP, DgnModelRefP *destModelP, bool *sameCacheP, bool *sameFileP, ElementHandleCP elemHandle = NULL);
366 
376 DGNPLATFORM_EXPORT void SetModelFromElmdscr (bool useElmdscr);
377 
379 DGNPLATFORM_EXPORT bool GetModelFromElmdscr () const;
380 
381 //---------------------------------------------------------------------------------------
383 //---------------------------------------------------------------------------------------
384 
385 //---------------------------------------------------------------------------------------
387 
388 //---------------------------------------------------------------------------------------
389 
390 //=======================================================================================
395 {
396 virtual void OnElementCopied (EditElementHandleR eh, ElementCopyContext&, bool isPre) = 0;
397 virtual void OnLevelCloned (ULong destLevelId, ULong sourceLevelId, bool uniqueName, ElementCopyContext& cc) = 0;
399 
400 }; // IEventHandler
401 
404 DGNPLATFORM_EXPORT static void AddHandler (IEventHandler& handler);
405 
408 DGNPLATFORM_EXPORT static void DropHandler (IEventHandler& handler);
409 
410 //---------------------------------------------------------------------------------------
412 //---------------------------------------------------------------------------------------
413 
414 //---------------------------------------------------------------------------------------
416 
417 //---------------------------------------------------------------------------------------
418 
427 DGNPLATFORM_EXPORT void SetWriteElements (bool writeAllElements);
428 
430 DGNPLATFORM_EXPORT bool GetWriteElements () const;
431 
441 DGNPLATFORM_EXPORT void SetMatchDimToDestination (bool changeDimension);
442 
444 DGNPLATFORM_EXPORT bool GetMatchDimToDestination () const;
445 
447 DGNPLATFORM_EXPORT void SetScaleReferenceDimensions (bool);
448 
450 DGNPLATFORM_EXPORT bool GetScaleReferenceDimensions () const;
451 
456 DGNPLATFORM_EXPORT void SetTransformToDestination (bool transformToDestination);
457 
459 DGNPLATFORM_EXPORT bool GetTransformToDestination () const;
460 
467 DGNPLATFORM_EXPORT void SetAssignNewGGs (bool assignNewGGs);
468 
470 DGNPLATFORM_EXPORT bool GetAssignNewGGs () const;
471 
477 DGNPLATFORM_EXPORT void SetAssignNewNodes (bool assignNewNodes);
478 
480 DGNPLATFORM_EXPORT bool GetAssignNewNodes () const;
481 
486 DGNPLATFORM_EXPORT void SetViewport (ViewportP vp);
487 
489 DGNPLATFORM_EXPORT ViewportP GetViewport () const;
490 
497 DGNPLATFORM_EXPORT void SetLevelHandling (CopyContextLevelOption levelOption);
498 
500 DGNPLATFORM_EXPORT void SetKeepRefColorIndexOnCopy (bool);
501 
503 DGNPLATFORM_EXPORT bool GetKeepRefColorIndexOnCopy ();
504 
507 DGNPLATFORM_EXPORT void SetSharedCellNameConflicts (SharedCellNameConflicts);
508 
510 DGNPLATFORM_EXPORT SharedCellNameConflicts GetSharedCellNameConflicts () const;
511 
513 DGNPLATFORM_EXPORT void SetDontPlaceTagsInGG (bool);
514 
516 DGNPLATFORM_EXPORT bool GetDontPlaceTagsInGG () const;
517 
519 DGNPLATFORM_EXPORT void SetDisableAnnotationScaling (bool b);
520 
522 DGNPLATFORM_EXPORT bool GetDisableAnnotationScaling () const;
523 
524 //---------------------------------------------------------------------------------------
526 //---------------------------------------------------------------------------------------
527 
528 
529 }; // ElementCopyContext
581 
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
Definition: TextTableHandler.h:216
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
virtual void OnProcessDatabaseLinkages(EditElementHandleR eh, ElementCopyContext &)
Definition: ElementCopyContext.h:398
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
The value of the user preference determines the behavior.
#define NULL
Definition: Bentley.h:157
bstdmap & operator=(const bstdmap &__rhs)
Definition: stdcxx/bstdmap.h:170
SharedCellNameConflicts
Definition: ElementCopyContext.h:255
Copy all levels from the source to the destination, overwriting any that exist in the destination mod...
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
#define DGNPLATFORM_TYPEDEFS(_name_)
Definition: DgnPlatform.h:73
struct DgnPlatform::ElementHandle const * ElementHandleCP
Definition: DgnPlatform.h:260
unsigned long ULong
Definition: Bentley.r.h:134
Copy levels using level number not name to compare (V7 workmode).
CopyContextLevelOption
How to handle levels when copying an element between files.
Definition: ElementCopyContext.h:210
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Copy any levels that are not found or differ from those in the destination model ref.
Only copy levels that are not found in destination model ref.
Use the ElementCopyContext class to copy elements.
Definition: ElementCopyContext.h:241
Element copy event handler.
Definition: ElementCopyContext.h:394
int StatusInt
Definition: Bentley.h:222
Do not copy any levels from the source model ref and assume that the levels have been converted to ma...
Interface to be adopted by a class the implements the reference-counting pattern. ...
Definition: RefCounted.h:34
Definition: DgnViewport.h:186

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