DgnGeoCoord.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 #if defined (__DGNGEOCOORD_BUILD__)
11 # define DGNGEOCOORD_EXPORTED __declspec(dllexport)
12 #else
13 # define DGNGEOCOORD_EXPORTED __declspec(dllimport)
14 #endif
15 
16 #include <GeoCoord\basegeocoord.h>
20 #include <Bentley/bvector.h>
22 
23 typedef struct GeoCoordType66 const* GeoCoordType66CP;
24 typedef struct GeoCoordType66 * GeoCoordType66P;
25 typedef union ProjectionParams const* ProjectionParamsCP;
26 typedef union ProjectionParams * ProjectionParamsP;
27 
29 
30 namespace GeoCoordinates {
31 
33 
35  {
39  };
40 
42  {
43  Cartesian = 0,
44  XYZ = 1
45  };
46 
47 /*=================================================================================**/
54 {
55 /*---------------------------------------------------------------------------------**/
66 virtual StatusInt BeforeCoordinateSystemChanged (DgnGCSP oldGCS, DgnGCSP newGCS, DgnModelRefP modelRef, bool primaryCoordSys, bool writingToFile, bool reprojectData) = 0;
67 
68 /*---------------------------------------------------------------------------------**/
78 virtual void AfterCoordinateSystemChanged (DgnGCSP oldGCS, DgnGCSP newGCS, DgnModelRefP modelRef, bool primaryCoordSys, bool writtenToFile, bool reprojectData) = 0;
79 
80 /*---------------------------------------------------------------------------------**/
88 virtual StatusInt BeforeCoordinateSystemDeleted (DgnGCSP currentGCS, DgnModelRefP modelRef, bool primaryCoordSys) = 0;
89 
90 /*---------------------------------------------------------------------------------**/
97 virtual void AfterCoordinateSystemDeleted (DgnGCSP currentGCS, DgnModelRefP modelRef, bool primaryCoordSys) = 0;
98 
99 /*---------------------------------------------------------------------------------**/
107 virtual void BeforeReferenceGeoCoordinationChanged (DgnModelRefP modelRef, GeoCoordinationState oldState, GeoCoordinationState newState) = 0;
108 
109 /*---------------------------------------------------------------------------------**/
117 virtual void AfterReferenceGeoCoordinationChanged (DgnModelRefP modelRef, GeoCoordinationState oldState, GeoCoordinationState newState) = 0;
118 
119 };
120 
121 typedef bvector <IGeoCoordinateEventHandler*> T_GeoCoordEventHandlers;
122 
123 /*=================================================================================**/
146 {
147 private:
148  virtual void MakeClassAbstract() = 0;
149 public:
150 
151 public:
152 
153 /*---------------------------------------------------------------------------------**/
161 DGNGEOCOORD_EXPORTED static DgnGCSPtr CreateGCS
162 (
163 WCharCP coordinateSystemName,
164 DgnModelRefP modelRef
165 );
166 
167 /*---------------------------------------------------------------------------------**/
174 DGNGEOCOORD_EXPORTED static DgnGCSPtr CreateGCS
175 (
176 DgnModelRefP modelRef
177 );
178 
179 /*---------------------------------------------------------------------------------**/
186 DGNGEOCOORD_EXPORTED static DgnGCSPtr CreateGCS
187 (
188 BaseGCSCP baseGCS,
189 DgnModelRefP modelRef
190 );
191 
192 /*---------------------------------------------------------------------------------**/
197 DGNGEOCOORD_EXPORTED static DgnGCSPtr CreateGCS
198 (
199 DgnGCSCR dgnGcs
200 );
201 
202 /*---------------------------------------------------------------------------------**/
208 DGNGEOCOORD_EXPORTED void CartesianFromUors
209 (
210 DPoint3dR outCartesian,
211 DPoint3dCR inUors
212 ) const;
213 
214 /*---------------------------------------------------------------------------------**/
220 DGNGEOCOORD_EXPORTED void CartesianFromUors2D
221 (
222 DPoint2dR outCartesian,
223 DPoint2dCR inUors
224 ) const;
225 
226 /*---------------------------------------------------------------------------------**/
232 DGNGEOCOORD_EXPORTED void UorsFromCartesian
233 (
234 DPoint3dR outUors,
235 DPoint3dCR inCartesian
236 ) const;
237 
238 /*---------------------------------------------------------------------------------**/
244 DGNGEOCOORD_EXPORTED void UorsFromCartesian2D
245 (
246 DPoint2dR outUors,
247 DPoint2dCR inCartesian
248 ) const;
249 
250 /*---------------------------------------------------------------------------------**/
258 (
259 DPoint3dR outUors,
260 GeoPointCR inLatLong
261 ) const;
262 
263 /*---------------------------------------------------------------------------------**/
271 (
272 GeoPointR outLatLong,
273 DPoint3dCR inUors
274 ) const;
275 
276 /*---------------------------------------------------------------------------------**/
283 DGNGEOCOORD_EXPORTED ReprojectStatus LatLongFromUorsXYZ
284 (
285 GeoPointR outLatLong,
286 DPoint3dCR inUors
287 ) const;
288 
289 /*---------------------------------------------------------------------------------**/
306 (
307 DPoint3dP outUorsDest,
308 GeoPointP outLatLongDest,
309 GeoPointP outLatLongSrc,
310 DPoint3dCP inUors,
311 int numPoints,
312 DgnGCSCR destMstnGCS
313 ) const;
314 
315 /*---------------------------------------------------------------------------------**/
333 (
334 DPoint3dP outUorsDest,
335 GeoPointP outLatLongDest,
336 GeoPointP outLatLongSrc,
337 DPoint3dCP inUors,
338 int numPoints,
339 GeoCoordInterpretation interpretation,
340 DgnGCSCR destMstnGCS
341 ) const;
342 
343 /*---------------------------------------------------------------------------------**/
349 DGNGEOCOORD_EXPORTED ReprojectStatus UorsFromLatLong2D
350 (
351 DPoint2dR outUors,
352 GeoPoint2dCR inLatLong
353 ) const;
354 
355 /*---------------------------------------------------------------------------------**/
361 DGNGEOCOORD_EXPORTED ReprojectStatus LatLongFromUors2D
362 (
363 GeoPoint2dR outLatLong,
364 DPoint2dCR inUors
365 ) const;
366 
367 /*---------------------------------------------------------------------------------**/
384 (
385 DPoint2dP outUorsDest,
386 GeoPoint2dP outLatLongDest,
387 GeoPoint2dP outLatLongSrc,
388 DPoint2dCP inUors,
389 int numPoints,
390 DgnGCSCR destMstnGCS
391 ) const;
392 
393 /*---------------------------------------------------------------------------------**/
406 DGNGEOCOORD_EXPORTED ReprojectStatus GetLocalTransform
407 (
408 TransformP outTransform,
409 DPoint3dCR elementOrigin,
411 bool doRotate,
412 bool doScale,
413 DgnGCSCR destMstnGCS
414 ) const;
415 
416 /*---------------------------------------------------------------------------------**/
430 DGNGEOCOORD_EXPORTED ReprojectStatus GetLocalTransform
431 (
432 TransformP outTransform,
433 DPoint3dCR elementOrigin,
434 DPoint3dCP extent,
435 bool doRotate,
436 bool doScale,
437 GeoCoordInterpretation interpretation,
438 DgnGCSCR destMstnGCS
439 ) const;
440 
441 /*---------------------------------------------------------------------------------**/
447 DGNGEOCOORD_EXPORTED WCharCP GetProjectionName
448 (
449 WStringR outputBuffer
450 ) const;
451 
452 /*---------------------------------------------------------------------------------**/
458 DGNGEOCOORD_EXPORTED WCharCP GetDisplayName
459 (
460 WStringR outputBuffer
461 ) const;
462 
463 /*---------------------------------------------------------------------------------**/
474 (
475 DgnModelRefP modelRef,
476 bool primaryCoordSys,
477 bool writeToFile,
478 bool reprojectData,
479 bool reportProblems
480 );
481 
482 /*---------------------------------------------------------------------------------**/
490 DGNGEOCOORD_EXPORTED static DgnGCSP FromModel
491 (
492 DgnModelRefP modelRef,
493 bool primaryCoordSys
494 );
495 
496 /*---------------------------------------------------------------------------------**/
502 DGNGEOCOORD_EXPORTED static StatusInt DeleteFromModel
503 (
504 DgnModelRefP modelRef,
505 bool primaryCoordSys
506 );
507 
508 /*---------------------------------------------------------------------------------**/
516 DGNGEOCOORD_EXPORTED static DgnGCSP FromCache
517 (
518 DgnModelP cache,
519 bool primaryCoordSys
520 );
521 
522 /*---------------------------------------------------------------------------------**/
527 DGNGEOCOORD_EXPORTED static void ReloadGeoReferences
528 (
529 DgnModelRefP modelRef
530 );
531 
532 /*---------------------------------------------------------------------------------**/
537 DGNGEOCOORD_EXPORTED static void SetEventHandler
538 (
540 );
541 
542 /*---------------------------------------------------------------------------------**/
547 DGNGEOCOORD_EXPORTED static void RemoveEventHandler
548 (
550 );
551 
552 /*---------------------------------------------------------------------------------**/
557 DGNGEOCOORD_EXPORTED double GetPaperScale () const;
558 
559 /*---------------------------------------------------------------------------------**/
567 DGNGEOCOORD_EXPORTED StatusInt SetPaperScale
568 (
569 double paperScale,
570 DgnModelRefP modelRef
571 );
572 
573 };
574 
575 
576 } // ends GeoCoordinate namespace
577 
Definition: DgnGeoCoord.h:43
struct GeoPoint const & GeoPointCR
Definition: msgeomstructs_typedefs.h:137
struct GeoPoint2d const & GeoPoint2dCR
Definition: msgeomstructs_typedefs.h:138
The MicroStation Geographic Coordinate System class extend the base Geographic Coordinate System clas...
Definition: DgnGeoCoord.h:145
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
struct GeoCoordType66 const * GeoCoordType66CP
Definition: DgnGeoCoord.h:23
The IGeoCoordinateEventHandler class defines an interface that applications that need notification of...
Definition: DgnGeoCoord.h:53
struct GeoPoint & GeoPointR
Definition: msgeomstructs_typedefs.h:137
GeoCoordinationState
Definition: DgnGeoCoord.h:34
Application-defined object that is stored with a DgnModel.
Definition: DgnModel.h:125
bvector< IGeoCoordinateEventHandler * > T_GeoCoordEventHandlers
Definition: DgnGeoCoord.h:121
wchar_t const * WCharCP
Definition: Bentley.h:224
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
3d point coordinates.
Definition: dpoint3d.h:19
struct GeoCoordType66 * GeoCoordType66P
Definition: DgnGeoCoord.h:24
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
Definition: MicroStation.r.h:734
ReprojectStatus
Status values returned by GeoCoordinate System reproject methods, including Handler::_OnGeoCoordinate...
Definition: GeoPoint.h:44
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
Definition: DgnGeoCoord.h:37
class BaseGCS const * BaseGCSCP
Definition: BaseGeoCoord.h:96
union ProjectionParams const * ProjectionParamsCP
Definition: DgnGeoCoord.h:25
struct GeoPoint2d * GeoPoint2dP
Definition: msgeomstructs_typedefs.h:138
struct GeoPoint * GeoPointP
Definition: msgeomstructs_typedefs.h:137
int StatusInt
Definition: Bentley.h:222
3x4 matrix for defining coordinate frames and affine transformations.
Definition: transform.h:22
struct GeoCoordinates::DgnGCS const & DgnGCSCR
Definition: DgnPlatform.h:499
GeoCoordInterpretation
Definition: DgnGeoCoord.h:41
RefCountedPtr< DgnGCS > DgnGCSPtr
Definition: DgnGeoCoord.h:32
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
Geographic Coordinate System class.
Definition: BaseGeoCoord.h:132
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
struct GeoPoint2d & GeoPoint2dR
Definition: msgeomstructs_typedefs.h:138
union ProjectionParams * ProjectionParamsP
Definition: DgnGeoCoord.h:26
Definition: DgnGeoCoord.h:38
#define DGNGEOCOORD_EXPORTED
Definition: DgnGeoCoord.h:13
struct DPoint2d const * DPoint2dCP
Definition: msgeomstructs_typedefs.h:78
Definition: DgnGeoCoord.h:44
2d point coordinates.
Definition: dpoint2d.h:23
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Definition: DgnGeoCoord.h:36

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