CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DwgDeclareMembers.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
25#ifndef _ODDBDWGCLASSDEF_H_INCLUDED_
26#define _ODDBDWGCLASSDEF_H_INCLUDED_
27
28
29
31
32
33enum {
34# define __DUMMY_( a,b,c,d,e,f,g,h,i )
35# define CLASSDEF(DWGTYPE,ClassName, BaseClassName,DwgVer,MaintVer,DxfName,AppName,ProxyFlags,CustomFlags)\
36 kDwgId_OdDb##ClassName = DWGTYPE,
37# include "DwgClassDef.h"
38# undef CLASSDEF
39# undef CLASSmic
40# undef CLASSdim
41# undef CLASSext
42# undef __DUMMY_
49};
50
51#define DWGMAP_DECLARE_MEMBERS(ClassName) \
52protected: \
53 ClassName(OdDbObjectImpl* pImpl); \
54public: \
55 \
56 \
57 static OdSmartPtr<ClassName> cast(const OdRxObject* pObj) { \
58 if (pObj) \
59 return OdSmartPtr<ClassName>(((ClassName*)pObj->queryX(ClassName::desc())), kOdRxObjAttach); \
60 return (ClassName*)0; \
61 } \
62 \
63 \
64 \
65 \
66 static OdRxClass* desc() { return ::oddbDwgClassMapDesc(kDwgId_##ClassName); } \
67 \
68 \
69 \
70 \
71 virtual OdRxClass* isA() const; \
72 \
73 \
74 \
75 virtual OdRxObject* queryX(const OdRxClass* protocolClass) const; \
76 \
77 \
78 \
79 static OdRxObjectPtr pseudoConstructor(); \
80 \
81 \
82 \
83 static OdSmartPtr<ClassName> createObject() \
84 { if (desc()) return desc()->create(); throw OdError("OdDb" #ClassName "is not loaded"); } \
85 \
86 \
87 static void rxInit(); \
88 static void rxInit(AppNameChangeFuncPtr appNameChangeFunc); \
89 \
90/* Unregisters ClassName with the Drawings. **/ \
91 static void rxUninit()
92
93
94
95
96#endif // _ODDBDWGCLASSDEF_H_INCLUDED_
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
TOOLKIT_EXPORT OdRxClass * oddbDwgClassMapDesc(OdUInt16 nDwgType)
@ kDwgId_OdDbDimension
@ kDwgId_OdDbVertex
@ kDwgId_OdDbProxyEntity
@ kOdDbDwgClassMapSize_WithProxy
@ kDwgId_OdDbProxyObject
@ kOdDbDwgClassMapSize
unsigned short OdUInt16