CFx SDK Documentation  2022 SP0
EdUserIO.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 _ODEDUSERIO_H_INCLUDED_
25 #define _ODEDUSERIO_H_INCLUDED_
26 
27 #include "OdPlatform.h"
28 #include "Gi/GiDrawable.h"
29 #include "OdString.h"
30 #include "SharedPtr.h"
31 #include "RxObject.h"
32 
33 #include "../FxClangExceptionRTTIWorkaround.h"
34 
35 class OdGePoint3d;
36 
37 #include "TD_PackPush.h"
38 
43 namespace OdEd
44 {
46  {
47  kInpDefault = 0x00000000,
50  kInpThrowEmpty = (long)0x80000000,
51  kInpThrowOther = 0x40000000,
52  kInpNonZero = 0x20000000, // Disallow zero input
53  kInpNonNeg = 0x10000000 // Disallow negative input
54  };
55 
57  {
58  kGfpForOpen = 0, // For Open.
59  kGfpForSave = 1, // For Save.
60  kGfpOverwritePrompt = 2 // Enable overwrite prompt displaying when exist file selected for saving.
61  };
62 
64  {
65  kGstDefault = 0, // Spaces disallowed, no KeywordExceptions
66  kGstNoSpaces = 0, // Spaces disallowed
67  kGstAllowSpaces = 1, // The first space character will not terminate the input.
68  kGstNoEmpty = 2 // The first space character will not terminate the input.
69  };
70 
72  {
73  kGptDefault = 0x00000000,
78  kGptNoLimCheck = 0x00000001, // Ignore the LIMMIN and LIMMAX system variables
79  kGptNoUCS = 0x00000002, // Do not project result point onto UCS plane (input point in eye plane)
80  kGptRubberBand = 0x00000004,
81  kGptRectFrame = 0x00000008,
82  kGptBeginDrag = 0x00000010,
83  kGptEndDrag = 0x00000020,
84  kGptNoOSnap = 0x00000040, // Disables object snaps
85  kGanFromLastPoint = 0x00000080,
87  kGanNoAngBase = 0x00000100,
88  kGds2d = 0x00000200, // Restrict (getDistance) to 2D
89  kGdsSignedDist = 0x00000400,
90  kGdsPerpDist = 0x00000800, // is in perpendicular plane to UCS plane
91  kGdsNoZero = 0x00001000,
95  kGdsNoNeg = 0x00002000,
98  };
99 
101  {
102  kSelDefault = 0x00000000,
103  kSelPickLastPoint = 0x00000001, // Use last entered point as first corner of selection box
104  kSelSingleEntity = 0x00000002, // Select single entity
105  kSelIgnorePickFirst = 0x00000004, // Clear previous contents of selection set
106  kSelSinglePass = 0x00000008, // Use single pass for selection
107  // (no pressing Enter is required to finish selection)
108  kSelAllowEmpty = 0x00000010, // Empty selection set is allowed
109  kSelRemove = 0x00000020, // Remove selected entities from current selection set
110  kSelLeaveHighlighted= 0x00000040, // Leave entities highlighted after operation
111  kSelAllowInactSpaces= 0x00000080, // Allow selection of all entities not only in active layout
112 
113  kSelAllowObjects = 0x00000100, // Allow non-entity objects selection
114  kSelAllowPSVP = 0x00000200, // Allow overall Paper Space viewport selection
115  kSelAllowSubents = 0x00000400, // Allow subentities selection
116  kSelAllowLocked = 0x00000800, // Allow selection of entities on locked layers
117 
118  kSelAllowSubentsAlways = 0x00001000, // Allow subentities selection independent on press CTRL
119  };
120 }
121 
122 class OdGsView;
123 class OdGsModel;
124 
125 class OdCmColorBase;
126 
127 //
128 // OdEd_Classes
129 //
130 
139 {
140 public:
142 
143  virtual int addDrawables(OdGsView* pView) = 0;
144  virtual void removeDrawables(OdGsView* pView) = 0;
145 };
146 
148 
149 
158 {
159 public:
161 
162  virtual void setValue(int value) = 0;
163 };
164 
166 
167 
176 {
177 public:
179 
180  virtual void setValue(double value) = 0;
181 };
182 
184 
185 
194 {
195 protected:
197 public:
199 
200  virtual void setValue(const OdString& value) = 0;
201 
202  virtual void setCursor(const bool& bShowCursor)
203  {
204  this->bShowCursor = bShowCursor;
205  }
206 };
207 
209 
210 
215 {
216 public:
218 
219  virtual void setValue(const OdGePoint3d& value) = 0;
220 };
221 
223 
224 
229 {
230 public:
232 
233  virtual OdGePoint3d basePoint() const = 0;
234 };
235 
237 
238 
243 {
244 public:
246 
247  virtual void setValue(const OdCmColorBase& value) = 0;
248 };
249 
251 
252 
253 //
254 // OdEd_Exceptions
255 //
256 
257 #define OdException OdError
258 
259 
267 {
268 protected:
271 
273 };
274 
275 
283 {
284 public:
287 
289 };
290 
291 
299 {
300 public:
301  OdEdKeyword(int nKeyword, const OdString& sKeyword);
302 
303  int keywordIndex() const;
304  const OdString& keyword() const;
305 
307 };
308 
309 
316 {
317 public:
318  OdEdOtherInput(const OdString& sInput);
319  const OdString& string() const;
320 
322 };
323 
324 
331 {
332 public:
334 
336 };
337 
338 
346 {
347 public:
349 
353  virtual bool interactive();
354 
372  virtual int getKeyword(
373  const OdString& prompt,
374  const OdString& keywords,
375  int defVal = -1,
376  int options = OdEd::kInpDefault,
377  OdEdIntegerTracker* pTracker = 0) = 0;
378 
393  virtual int getInt(
394  const OdString& prompt,
395  int options = OdEd::kInpDefault,
396  int defVal = 0,
397  const OdString& keywords = OdString::kEmpty,
398  OdEdIntegerTracker* pTracker = 0) = 0;
399 
414  virtual double getReal(
415  const OdString& prompt,
416  int options = OdEd::kInpDefault,
417  double defVal = 0.0,
418  const OdString& keywords = OdString::kEmpty,
419  OdEdRealTracker* pTracker = 0) = 0;
420 
437  const OdString& prompt,
438  int options = OdEd::kInpDefault,
439  const OdString& defValue = OdString::kEmpty,
440  const OdString& keywords = OdString::kEmpty,
441  OdEdStringTracker* pTracker = 0) = 0;
442 
447  virtual void putString(const OdString& string) = 0;
448 
465  const OdString& prompt,
466  int options = OdEd::kInpDefault,
467  const OdCmColorBase* pDefaultValue = 0,
468  const OdString& keywords = OdString::kEmpty,
469  OdEdColorTracker* pTracker = 0) = 0;
470 
495  const OdString& prompt,
496  int options = OdEd::kGfpForOpen,
497  const OdString& dialogCaption = OdString::kEmpty,
498  const OdString& defExt = OdString::kEmpty,
499  const OdString& fileName = OdString::kEmpty,
500  const OdString& filter = OdString::kEmpty,
501  const OdString& keywords = OdString::kEmpty,
502  OdEdStringTracker* pTracker = 0);
503 
509  virtual void putError(const OdString& errmsg) { putString(errmsg); }
510 };
511 
512 #include "TD_PackPop.h"
513 
514 #endif //#ifndef _ODEDUSERIO_H_INCLUDED_
OdSmartPtr< OdEdColorTracker > OdEdColorTrackerPtr
Definition: EdUserIO.h:250
#define OdException
Definition: EdUserIO.h:257
OdSmartPtr< OdEdPointTracker > OdEdPointTrackerPtr
Definition: EdUserIO.h:222
OdSmartPtr< OdEdStringTracker > OdEdStringTrackerPtr
Definition: EdUserIO.h:208
OdSmartPtr< OdEdRealTracker > OdEdRealTrackerPtr
Definition: EdUserIO.h:183
OdSmartPtr< OdEdIntegerTracker > OdEdIntegerTrackerPtr
Definition: EdUserIO.h:165
OdSmartPtr< OdEdInputTracker > OdEdInputTrackerPtr
Definition: EdUserIO.h:147
OdSmartPtr< OdEdPointDefTracker > OdEdPointDefTrackerPtr
Definition: EdUserIO.h:236
#define ODRX_ABSTRACT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdCancel(OdErrorContext *pErrCtx)
ODRX_DECLARE_MEMBERS(OdEdColorTracker)
virtual void setValue(const OdCmColorBase &value)=0
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdException(OdErrorContext *pErrCtx)
virtual void removeDrawables(OdGsView *pView)=0
ODRX_DECLARE_MEMBERS(OdEdInputTracker)
virtual int addDrawables(OdGsView *pView)=0
virtual void setValue(int value)=0
ODRX_DECLARE_MEMBERS(OdEdIntegerTracker)
int keywordIndex() const
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdKeyword(int nKeyword, const OdString &sKeyword)
const OdString & keyword() const
const OdString & string() const
OdEdOtherInput(const OdString &sInput)
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
virtual OdGePoint3d basePoint() const =0
ODRX_DECLARE_MEMBERS(OdEdPointDefTracker)
ODRX_DECLARE_MEMBERS(OdEdPointTracker)
virtual void setValue(const OdGePoint3d &value)=0
virtual void setValue(double value)=0
ODRX_DECLARE_MEMBERS(OdEdRealTracker)
ODRX_DECLARE_MEMBERS(OdEdStringTracker)
virtual void setValue(const OdString &value)=0
virtual void setCursor(const bool &bShowCursor)
Definition: EdUserIO.h:202
virtual int getInt(const OdString &prompt, int options=OdEd::kInpDefault, int defVal=0, const OdString &keywords=OdString::kEmpty, OdEdIntegerTracker *pTracker=0)=0
virtual void putString(const OdString &string)=0
virtual double getReal(const OdString &prompt, int options=OdEd::kInpDefault, double defVal=0.0, const OdString &keywords=OdString::kEmpty, OdEdRealTracker *pTracker=0)=0
ODRX_DECLARE_MEMBERS(OdEdUserIO)
virtual OdSharedPtr< OdCmColorBase > getCmColor(const OdString &prompt, int options=OdEd::kInpDefault, const OdCmColorBase *pDefaultValue=0, const OdString &keywords=OdString::kEmpty, OdEdColorTracker *pTracker=0)=0
virtual OdString getFilePath(const OdString &prompt, int options=OdEd::kGfpForOpen, const OdString &dialogCaption=OdString::kEmpty, const OdString &defExt=OdString::kEmpty, const OdString &fileName=OdString::kEmpty, const OdString &filter=OdString::kEmpty, const OdString &keywords=OdString::kEmpty, OdEdStringTracker *pTracker=0)
virtual bool interactive()
virtual OdString getString(const OdString &prompt, int options=OdEd::kInpDefault, const OdString &defValue=OdString::kEmpty, const OdString &keywords=OdString::kEmpty, OdEdStringTracker *pTracker=0)=0
virtual int getKeyword(const OdString &prompt, const OdString &keywords, int defVal=-1, int options=OdEd::kInpDefault, OdEdIntegerTracker *pTracker=0)=0
virtual void putError(const OdString &errmsg)
Definition: EdUserIO.h:509
Definition: Gs.h:133
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
Definition: EdUserIO.h:44
GetStringOptions
Definition: EdUserIO.h:64
@ kGstNoSpaces
Definition: EdUserIO.h:66
@ kGstAllowSpaces
Definition: EdUserIO.h:67
@ kGstDefault
Definition: EdUserIO.h:65
@ kGstNoEmpty
Definition: EdUserIO.h:68
GetFilePathFlags
Definition: EdUserIO.h:57
@ kGfpOverwritePrompt
Definition: EdUserIO.h:60
@ kGfpForOpen
Definition: EdUserIO.h:58
@ kGfpForSave
Definition: EdUserIO.h:59
OdDbInputOptions
Definition: EdUserIO.h:72
@ kGptNoUCS
Definition: EdUserIO.h:79
@ kGanNoAngBase
Definition: EdUserIO.h:87
@ kGptBeginDrag
Definition: EdUserIO.h:82
@ kGptEndDrag
Definition: EdUserIO.h:83
@ kGanFromLastPoint
Definition: EdUserIO.h:85
@ kGptRubberBand
Definition: EdUserIO.h:80
@ kGdsNoZero
Definition: EdUserIO.h:91
@ kGdsNoNeg
Definition: EdUserIO.h:95
@ kGptNoLimCheck
Definition: EdUserIO.h:78
@ kGdsSignedDist
Definition: EdUserIO.h:89
@ kGptNoOSnap
Definition: EdUserIO.h:84
@ kGdsDefault
Definition: EdUserIO.h:74
@ kGrlNoNeg
Definition: EdUserIO.h:97
@ kGinNoZero
Definition: EdUserIO.h:92
@ kGptRectFrame
Definition: EdUserIO.h:81
@ kGrlDefault
Definition: EdUserIO.h:76
@ kGinDefault
Definition: EdUserIO.h:75
@ kGinNoNeg
Definition: EdUserIO.h:96
@ kGptDefault
Definition: EdUserIO.h:73
@ kGds2d
Definition: EdUserIO.h:88
@ kGdsFromLastPoint
Definition: EdUserIO.h:86
@ kGdsPerpDist
Definition: EdUserIO.h:90
@ kGanNoZero
Definition: EdUserIO.h:94
@ kGrlNoZero
Definition: EdUserIO.h:93
@ kGanDefault
Definition: EdUserIO.h:77
SelectOptions
Definition: EdUserIO.h:101
@ kSelPickLastPoint
Definition: EdUserIO.h:103
@ kSelIgnorePickFirst
Definition: EdUserIO.h:105
@ kSelAllowInactSpaces
Definition: EdUserIO.h:111
@ kSelRemove
Definition: EdUserIO.h:109
@ kSelAllowSubents
Definition: EdUserIO.h:115
@ kSelDefault
Definition: EdUserIO.h:102
@ kSelLeaveHighlighted
Definition: EdUserIO.h:110
@ kSelAllowSubentsAlways
Definition: EdUserIO.h:118
@ kSelAllowEmpty
Definition: EdUserIO.h:108
@ kSelSinglePass
Definition: EdUserIO.h:106
@ kSelSingleEntity
Definition: EdUserIO.h:104
@ kSelAllowObjects
Definition: EdUserIO.h:113
@ kSelAllowLocked
Definition: EdUserIO.h:116
@ kSelAllowPSVP
Definition: EdUserIO.h:114
CommonInputOptions
Definition: EdUserIO.h:46
@ kInpNonZero
Definition: EdUserIO.h:52
@ kInpDefault
Definition: EdUserIO.h:47
@ kInpNonNeg
Definition: EdUserIO.h:53
@ kInpDisallowOther
Definition: EdUserIO.h:49
@ kInpDisallowEmpty
Definition: EdUserIO.h:48
@ kInpThrowOther
Definition: EdUserIO.h:51
@ kInpThrowEmpty
Definition: EdUserIO.h:50