zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
#ifndef __GE_VARIANT_H__
#define __GE_VARIANT_H__
 
#include "Tf/TfExport.h"
 
#include "Ge/GeCurveBoundary.h"
#include "Ge/GeEntity2d.h"
#include "Ge/GeEntity3d.h"
#include "Ge/GeExtents2d.h"
#include "Ge/GeExtents3d.h"
#include "Ge/GeInterval.h"
#include "Ge/GeKnotVector.h"
#include "Ge/GeMatrix2d.h"
#include "Ge/GeMatrix3d.h"
#include "Ge/GePoint2d.h"
#include "Ge/GePoint3d.h"
#include "Ge/GeQuaternion.h"
#include "Ge/GeScale2d.h"
#include "Ge/GeScale3d.h"
#include "Ge/GeVector2d.h"
#include "Ge/GeVector3d.h"
 
/** \details
  Library: TD_Ge
  <group OdGe_Classes>
*/
class TFCORE_EXPORT OdGeVariant {
public:
  typedef enum {
    kEmpty,
    kGeCurveBoundary,
    kGeEntity2d,
    kGeEntity3d,
    kGeExtents2d,
    kGeExtents3d,
    kGeInterval,
    kGeKnotVector,
    kGeMatrix2d,
    kGeMatrix3d,
    kGePoint2d,
    kGePoint3d,
    kGeQuaternion,
    kGeScale2d,
    kGeScale3d,
    kGeVector2d,
    kGeVector3d
  } Type;
 
private:
  int m_type;
  void* m_data;
 
  virtual void setVarType(int newType, int& type, void*& data);
public:
  struct TypeFactory {
    virtual void construct(void*& data) const = 0;
    virtual void destroy(void*& data) const = 0;
  };
  static const TypeFactory* typeFactory(int type);
 
  void makeEmpty();
 
  virtual ~OdGeVariant();
 
  /** \details
    Returns the type of this GeVariant object.
  */
  int  varType() const { return m_type; }
  /** \details
    Returns the type of this GeVariant object.
  */
  Type type()    const { return Type(m_type); }
 
  OdGeVariant();
  OdGeVariant(const OdGeVariant&);
  OdGeVariant(const OdGeCurveBoundary& value);
  OdGeVariant(const OdGeEntity2d& value);
  OdGeVariant(const OdGeEntity3d& value);
  OdGeVariant(const OdGeExtents2d& value);
  OdGeVariant(const OdGeExtents3d& value);
  OdGeVariant(const OdGeInterval& value);
  OdGeVariant(const OdGeKnotVector& value);
  OdGeVariant(const OdGeMatrix2d& value);
  OdGeVariant(const OdGeMatrix3d& value);
  OdGeVariant(const OdGePoint2d& value);
  OdGeVariant(const OdGePoint3d& value);
  OdGeVariant(const OdGeQuaternion& value);
  OdGeVariant(const OdGeScale2d& value);
  OdGeVariant(const OdGeScale3d& value);
  OdGeVariant(const OdGeVector2d& value);
  OdGeVariant(const OdGeVector3d& value);
  
  OdGeVariant& operator =(const OdGeVariant&);
  operator OdGeCurveBoundary() const;
  operator OdGeExtents2d() const;
  operator OdGeExtents3d() const;
  operator OdGeInterval() const;
  operator OdGeKnotVector() const;
  operator OdGeMatrix2d() const;
  operator OdGeMatrix3d() const;
  operator OdGePoint2d() const;
  operator OdGePoint3d() const;
  operator OdGeQuaternion() const;
  operator OdGeScale3d() const;
  operator OdGeVector2d() const;
  operator OdGeVector3d() const;
  
  void setGeCurveBoundary(const OdGeCurveBoundary& value);
  void setGeEntity2d(const OdGeEntity2d& value);
  void setGeEntity3d(const OdGeEntity3d& value);
  void setGeExtents2d(const OdGeExtents2d& value);
  void setGeExtents3d(const OdGeExtents3d& value);
  void setGeInterval(const OdGeInterval& value);
  void setGeKnotVector(const OdGeKnotVector& value);
  void setGeMatrix2d(const OdGeMatrix2d& value);
  void setGeMatrix3d(const OdGeMatrix3d& value);
  void setGePoint2d(const OdGePoint2d& value);
  void setGePoint3d(const OdGePoint3d& value);
  void setGeQuaternion(const OdGeQuaternion& value);
  void setGeScale2d(const OdGeScale2d& value);
  void setGeScale3d(const OdGeScale3d& value);
  void setGeVector2d(const OdGeVector2d& value);
  void setGeVector3d(const OdGeVector3d& value);
  
  const OdGeCurveBoundary& getGeCurveBoundary() const;
  const OdGeEntity2d& getGeEntity2d() const;
  const OdGeEntity3d& getGeEntity3d() const;
  const OdGeExtents2d& getGeExtents2d() const;
  const OdGeExtents3d& getGeExtents3d() const;
  const OdGeInterval& getGeInterval() const;
  const OdGeKnotVector& getGeKnotVector() const;
  const OdGeMatrix2d& getGeMatrix2d() const;
  const OdGeMatrix3d& getGeMatrix3d() const;
  const OdGePoint2d& getGePoint2d() const;
  const OdGePoint3d& getGePoint3d() const;
  const OdGeQuaternion& getGeQuaternion() const;
  const OdGeScale2d& getGeScale2d() const;
  const OdGeScale3d& getGeScale3d() const;
  const OdGeVector2d& getGeVector2d() const;
  const OdGeVector3d& getGeVector3d() const;
};
  
#endif // __GE_VARIANT_H__