CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbRasterVariables.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#ifndef __IMGVARS_H
25#define __IMGVARS_H
27#include "TD_PackPush.h"
28
30
31#include "DbRasterImageDef.h"
32#include "OdString.h"
33
38
51{
52public:
53
55
57
59 {
60 kImageFrameInvalid = -1, // Invalid
61 kImageFrameOff = 0, // Frame is off
62 kImageFrameAbove = 1, // Frame is above the image
63 kImageFrameBelow = 2, // Frame is below the image
64 // New in R24 (AC24 support)
65 kImageFrameOnNoPlot = 3 // Frame is above the image, but not drawn during plotting
66 };
67
69 {
70 kImageQualityInvalid = -1, // Invalid
71 kImageQualityDraft = 0, // Draft quality
72 kImageQualityHigh = 1 // High quality
73 };
74
76 OdDbDwgFiler* pFiler);
77
78 virtual void dwgOutFields(
79 OdDbDwgFiler* pFiler) const;
80
82 OdDbDxfFiler* pFiler);
83
84 virtual void dxfOutFields
85 (OdDbDxfFiler* pFiler) const;
86
102 virtual FrameSettings imageFrame() const;
103
120 virtual void setImageFrame(
121 FrameSettings imageFrame );
122
136 virtual ImageQuality imageQuality() const;
137
152 virtual void setImageQuality(
153 ImageQuality imageQuality );
154
187
221 virtual void setUserScale(
223
233 static OdDbRasterVariablesPtr openRasterVariables(
234 OdDbDatabase* pDb,
235 OdDb::OpenMode openMode = OdDb::kForRead);
236};
237
238
240 OdDbRasterVariablesPtr pRastVars;
241 ODA_ASSERT(pDatabase);
242 if (pDatabase) {
243 OdString AcDbRasterVariables(L"AcDbRasterVariables");
245 OdResult res;
246 pRastVars = ::odrxCastByClassName<OdDbRasterVariables>(pRootDict->getAt(ACAD_IMAGE_VARS, &res).openObject(mode), AcDbRasterVariables);
247 if (res == eKeyNotFound) {
248 pRootDict->upgradeOpen();
249 pRastVars = ::odrxSafeCreateObject<OdDbRasterVariables>(AcDbRasterVariables);
250
252 switch (pDatabase->getINSUNITS()) {
253 default:
254 //case OdDb::kUnitsUndefined:
256 break;
259 break;
260 case OdDb::kUnitsFeet:
262 break;
265 break;
268 break;
271 break;
274 break;
277 break;
280 break;
281 case OdDb::kUnitsMils:
283 break;
286 break;
289 break;
292 break;
295 break;
298 break;
301 break;
304 break;
307 break;
310 break;
313 break;
316 break;
317 }
318 pRastVars->setUserScale(units);
319 pRootDict->setAt(ACAD_IMAGE_VARS, pRastVars);
320 if (mode == OdDb::kForRead) {
321 pRastVars->downgradeOpen();
322 }
323 }
324 }
325 return pRastVars;
326}
327
328#include "TD_PackPop.h"
329
330#endif // __IMGVARS_H
331
#define ISM_EXPORT
OdSmartPtr< OdDbRasterVariables > OdDbRasterVariablesPtr
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:57
OdResult
Definition: OdResult.h:29
OdDbObjectId getNamedObjectsDictionaryId() const
OdResult openObject(OdDbObjectPtr &pObj, OdDb::OpenMode openMode=OdDb::kForRead, bool openErasedOne=false) const
virtual FrameSettings imageFrame() const
ODDB_DECLARE_MEMBERS(OdDbRasterVariables)
static OdDbRasterVariablesPtr openRasterVariables(OdDbDatabase *pDb, OdDb::OpenMode openMode=OdDb::kForRead)
virtual OdDbRasterImageDef::Units userScale() const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
virtual ImageQuality imageQuality() const
virtual void setUserScale(OdDbRasterImageDef::Units units)
virtual void setImageQuality(ImageQuality imageQuality)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual void setImageFrame(FrameSettings imageFrame)
OpenMode
Definition: DbObjectId.h:54
@ kForRead
Definition: DbObjectId.h:56
@ kUnitsHectometers
Definition: OdaDefs.h:468
@ kUnitsAstronomical
Definition: OdaDefs.h:470
@ kUnitsNanometers
Definition: OdaDefs.h:464
@ kUnitsFeet
Definition: OdaDefs.h:454
@ kUnitsParsecs
Definition: OdaDefs.h:472
@ kUnitsCentimeters
Definition: OdaDefs.h:457
@ kUnitsMillimeters
Definition: OdaDefs.h:456
@ kUnitsMils
Definition: OdaDefs.h:461
@ kUnitsInches
Definition: OdaDefs.h:453
@ kUnitsLightYears
Definition: OdaDefs.h:471
@ kUnitsMicrons
Definition: OdaDefs.h:465
@ kUnitsDekameters
Definition: OdaDefs.h:467
@ kUnitsYards
Definition: OdaDefs.h:462
@ kUnitsDecimeters
Definition: OdaDefs.h:466
@ kUnitsMeters
Definition: OdaDefs.h:458
@ kUnitsKilometers
Definition: OdaDefs.h:459
@ kUnitsGigameters
Definition: OdaDefs.h:469
@ kUnitsMicroinches
Definition: OdaDefs.h:460
@ kUnitsAngstroms
Definition: OdaDefs.h:463
@ kUnitsMiles
Definition: OdaDefs.h:455