CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxDatabase.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2023 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "FxPragmaPush.h"
20
21#include "DDKERNEL.h"
22
23#include <OdCodePage.h>
24#include <DbDatabase.h>
25#include <DbSecurity.h>
26
27#include <set>
28
29class CFxFileData;
30class CFxGsModel;
34class CFxString;
35class CFxView;
36
37class CFxDatabase;
39
40#define LAST_DWGDIRECT_UNDO_ID 0x1000 //this value is much bigger than last DWGDirect undo value
41
48{
49public:
51
53 ~CFxDatabase(void) override;
54
61 static CFxDatabasePtr LoadFile( const CFxString& strFilename, OdCodePageId* pCodepage = 0, const OdPassword& password = OdPassword() );
62
69 virtual bool SaveFile( const CFxFileData* pNewData = 0, bool deleteBackupFile = true ) = 0;
70
77 static CFxDatabasePtr RecoverFile( const CFxString& strFilename, OdCodePageId* pCodepage = 0, const OdPassword& password = OdPassword() );
78
82 virtual void LockFile( bool bLock ) = 0;
83
89
94 bool IsModelLayoutActive() const;
95
101
105 virtual const CFxUnitsFormatter* GetUnitsFormatter() const = 0;
106
110 virtual const CFxFileData& GetFileData() const = 0;
111
115 virtual void SetFileData(const CFxFileData &) const = 0;
116
120 virtual CFxGsModel* GetFxGsModel() = 0;
124 virtual const CFxGsModel* GetFxGsModel() const = 0;
132 virtual void StartUndoRecord( const CFxString& strLabel ) = 0;
133
137 virtual void ResetTime() = 0;
138
145
154 virtual int BlockPurge( OdDbObjectId id, bool block ) = 0;
155
161 virtual const std::set<OdDbObjectId>& GetBlockedPurge() const = 0;
162
168 virtual const OdTimeStamp& getElapsedTime() = 0;
169
170 //overrides of system variables
171 OdCodePageId getDWGCODEPAGE() const override;
172 OdGePoint2d getPLIMMIN() const override = 0;
173 OdGePoint2d getPLIMMAX() const override = 0;
174
175 //newly added functions
176 virtual bool setDWGCODEPAGE( OdCodePageId value ) = 0;
177 virtual bool setTDUCREATE( OdDbDate value ) = 0;
178 virtual bool setTDUUPDATE( OdDbDate value ) = 0;
179 virtual bool setTDINDWG( OdDbDate value ) = 0;
180 virtual bool setTDUSRTIMER( OdDbDate value ) = 0;
181 virtual bool setPSTYLEMODE( bool value ) = 0;
182 virtual bool setPUCSORG( OdGePoint3d value ) = 0;
183 virtual bool setPUCSXDIR( OdGeVector3d value ) = 0;
184 virtual bool setPUCSYDIR( OdGeVector3d value ) = 0;
185 virtual bool setUCSORG( OdGePoint3d value ) = 0;
186 virtual bool setUCSXDIR( OdGeVector3d value ) = 0;
187 virtual bool setUCSYDIR( OdGeVector3d value ) = 0;
188 virtual bool setPUCSAll( OdGePoint3d org, OdGeVector3d xDir, OdGeVector3d yDir ) = 0;
189 virtual bool setUCSAll( OdGePoint3d org, OdGeVector3d xDir, OdGeVector3d yDir ) = 0;
190
191 virtual OdString getUSERS1() const = 0;
192 virtual bool setUSERS1( const OdString& value ) = 0;
193 virtual OdString getUSERS2() const = 0;
194 virtual bool setUSERS2( const OdString& value ) = 0;
195 virtual OdString getUSERS3() const = 0;
196 virtual bool setUSERS3( const OdString& value ) = 0;
197 virtual OdString getUSERS4() const = 0;
198 virtual bool setUSERS4( const OdString& value ) = 0;
199 virtual OdString getUSERS5() const = 0;
200 virtual bool setUSERS5( const OdString& value ) = 0;
201 virtual OdInt16 getBINDTYPE() const = 0;
202 virtual bool setBINDTYPE( OdInt16 value ) = 0;
203
207#define QVAR_DEF_RO( type, name, validator ) \
208 virtual type get##name() const = 0; \
209 virtual bool set##name( type val ) = 0;
210
211#define QVAR_DEF( type, name, validator ) \
212 QVAR_DEF_RO( type, name, validator )
213
214#define QVAR_DEF_RO_2( type, name, validator )
215#define QVAR_DEF_2( type, name, validator )
216
217#define FX_VAR_DEF_RO( type, name, def_val, metric_def_value, filerType, rbType, validation ) \
218 QVAR_DEF_RO( type, name, validation )
219
220#define FX_VAR_DEF( type, name, def_val, metric_def_value, filerType, rbType, validation ) \
221 QVAR_DEF_RO( type, name, validation )
222
223#define ODTUCSNAME OdDbHardPointerId
224
225 #include <QuasiVarDefs.h>
226 #include "fxdbvardefs.h"
227
228#undef ODTUCSNAME
229
230#undef QVAR_DEF_RO
231#undef QVAR_DEF
232#undef QVAR_DEF_RO_2
233#undef QVAR_DEF_2
234
235#undef FX_VAR_DEF_RO
236#undef FX_VAR_DEF
237
239 {
240 kPU_COMMANDNAME = LAST_DWGDIRECT_UNDO_ID + 1,
241
242 //constant definitions
243 #define FX_VAR_DEF(type, name, def_val, metric_def_value, filerType, rbType, validate) kPU_Db##name,
244 #define FX_VAR_DEF_RO(type, name, def_val, metric_def_value, filerType, rbType, validate) kPU_Db##name,
245 #define FX_REGVAR_DEF( type, name, def_val, filerType, rbType, validation ) kPU_Db##name,
246 #define FX_REGVAR_DEF_RO( type, name, def_val, filerType, rbType, validation ) kPU_Db##name,
247 #define QVAR_DEF( type, name, validation ) kPU_Db##name,
248 #define QVAR_DEF_RO( type, name, validation ) kPU_Db##name,
249
250 #include "fxdbvardefs.h"
251 #include "FxSysVarDefs.h"
252 #include <QuasiVarDefs.h>
253
254 #undef FX_VAR_DEF
255 #undef FX_VAR_DEF_RO
256 #undef FX_REGVAR_DEF
257 #undef FX_REGVAR_DEF_RO
258 #undef QVAR_DEF
259 #undef QVAR_DEF_RO
260
261 #define REGVAR_DEF( type, name, def_val, filerType, validation ) kPU_Db##name,
262 #include <SysVarDefs.h>
263 #undef REGVAR_DEF
264
281
282 kPU_DbDummy
283 };
284
285 //UNDOCTL modes
287 {
288 Enabled = 0x1,
289 One = 0x2,
290 Auto = 0x4,
291 Combine = 0x10,
292 Layer = 0x20
293 };
294
303 virtual CFxView* GetGsView( OdDbObjectId id ) const = 0;
304
305private:
306 //don't call this function
307 //use SaveFile
308 void writeFile(
309 OdStreamBuf* pStreamBuf,
311 OdDb::DwgVersion fileVersion,
312 bool saveThumbnailImage = false,
313 int dxfPrecision = 16);
314
315};
316
317#include "FxPragmaPop.h"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
OdString OdPassword
Definition: DbSecurity.h:52
fileType
Definition: FxBIM.h:102
OdSmartPtr< CFxDatabase > CFxDatabasePtr
Definition: FxDatabase.h:38
#define LAST_DWGDIRECT_UNDO_ID
Definition: FxDatabase.h:40
OdCodePageId
Definition: OdCodePage.h:31
short OdInt16
virtual OdString getUSERS5() const =0
virtual void StartUndoRecord(const CFxString &strLabel)=0
virtual bool setTDINDWG(OdDbDate value)=0
virtual OdString getUSERS2() const =0
virtual bool setUSERS2(const OdString &value)=0
virtual bool setUCSORG(OdGePoint3d value)=0
virtual OdInt16 getBINDTYPE() const =0
virtual const CFxFileData & GetFileData() const =0
static CFxDatabasePtr RecoverFile(const CFxString &strFilename, OdCodePageId *pCodepage=0, const OdPassword &password=OdPassword())
virtual CFxDatabaseHistory * GetDatabaseHistory()=0
Gets the database history.
virtual OdString getUSERS3() const =0
OdDbObjectId GetActiveViewportId(OdDbObjectId idLayout=OdDbObjectId::kNull) const
virtual bool setPUCSAll(OdGePoint3d org, OdGeVector3d xDir, OdGeVector3d yDir)=0
~CFxDatabase(void) override
virtual const OdTimeStamp & getElapsedTime()=0
virtual bool setTDUCREATE(OdDbDate value)=0
OdGePoint2d getPLIMMIN() const override=0
virtual int BlockPurge(OdDbObjectId id, bool block)=0
Block purge.
virtual bool setUCSAll(OdGePoint3d org, OdGeVector3d xDir, OdGeVector3d yDir)=0
@ kPU_DbPSTYLEMODE
Definition: FxDatabase.h:270
@ kPU_DbTDUSRTIMER
Definition: FxDatabase.h:269
@ kPU_DbDWGCODEPAGE
Definition: FxDatabase.h:265
virtual void SetFileData(const CFxFileData &) const =0
static CFxDatabasePtr LoadFile(const CFxString &strFilename, OdCodePageId *pCodepage=0, const OdPassword &password=OdPassword())
virtual void ResetTime()=0
virtual CFxView * GetGsView(OdDbObjectId id) const =0
virtual bool setUSERS3(const OdString &value)=0
virtual bool setTDUUPDATE(OdDbDate value)=0
virtual OdString getUSERS4() const =0
OdCodePageId getDWGCODEPAGE() const override
virtual CFxGsModel * GetFxGsModel()=0
OdGePoint2d getPLIMMAX() const override=0
virtual bool setUSERS1(const OdString &value)=0
virtual bool setPUCSXDIR(OdGeVector3d value)=0
virtual const CFxGsModel * GetFxGsModel() const =0
virtual bool setPSTYLEMODE(bool value)=0
virtual const CFxUnitsFormatter * GetUnitsFormatter() const =0
virtual const std::set< OdDbObjectId > & GetBlockedPurge() const =0
virtual bool setUSERS5(const OdString &value)=0
OdDbObjectId GetActiveBlockId() const
virtual bool SaveFile(const CFxFileData *pNewData=0, bool deleteBackupFile=true)=0
virtual bool setTDUSRTIMER(OdDbDate value)=0
virtual bool setDWGCODEPAGE(OdCodePageId value)=0
virtual bool setBINDTYPE(OdInt16 value)=0
CFxDatabase(void)
virtual void LockFile(bool bLock)=0
virtual bool setUCSYDIR(OdGeVector3d value)=0
ODRX_DECLARE_MEMBERS(CFxDatabase)
virtual bool setUCSXDIR(OdGeVector3d value)=0
virtual bool setPUCSORG(OdGePoint3d value)=0
virtual CFxRecentlyErased * GetRecentlyErased()=0
virtual OdString getUSERS1() const =0
virtual bool setPUCSYDIR(OdGeVector3d value)=0
bool IsModelLayoutActive() const
virtual bool setUSERS4(const OdString &value)=0
void writeFile(OdStreamBuf *pStreamBuf, OdDb::SaveType fileType, OdDb::DwgVersion fileVersion, bool saveThumbnailImage=false, int dxfPrecision=16)
static TOOLKIT_EXPORT_STATIC const OdDbObjectId kNull
Definition: DbObjectId.h:110
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
DwgVersion
Definition: OdaDefs.h:47
SaveType
Definition: DbObject.h:152