CFx SDK Documentation  2020SP3
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_
OdEdInputTracker
Definition: EdUserIO.h:139
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdEdInputTracker::removeDrawables
virtual void removeDrawables(OdGsView *pView)=0
OdEdEmptyInput::OdEdEmptyInput
OdEdEmptyInput()
OdEd::kGrlNoNeg
@ kGrlNoNeg
Definition: EdUserIO.h:97
OdEdOtherInput::string
const OdString & string() const
OdEd::kInpNonNeg
@ kInpNonNeg
Definition: EdUserIO.h:53
OdString
Definition: OdString.h:95
OdEd::kGstAllowSpaces
@ kGstAllowSpaces
Definition: EdUserIO.h:67
OdException
#define OdException
Definition: EdUserIO.h:257
OdEdStringTracker::bShowCursor
bool bShowCursor
Definition: EdUserIO.h:196
OdEdPointTrackerPtr
OdSmartPtr< OdEdPointTracker > OdEdPointTrackerPtr
Definition: EdUserIO.h:222
OdPlatform.h
OdEd::kGptNoUCS
@ kGptNoUCS
Definition: EdUserIO.h:79
OdEd::kInpThrowOther
@ kInpThrowOther
Definition: EdUserIO.h:51
OdEd::kGfpForOpen
@ kGfpForOpen
Definition: EdUserIO.h:58
OdEd::kInpThrowEmpty
@ kInpThrowEmpty
Definition: EdUserIO.h:50
OdEd::kSelSingleEntity
@ kSelSingleEntity
Definition: EdUserIO.h:104
OdGsView
Definition: Gs.h:133
OdEdRealTrackerPtr
OdSmartPtr< OdEdRealTracker > OdEdRealTrackerPtr
Definition: EdUserIO.h:183
OdEdIntegerTracker
Definition: EdUserIO.h:158
OdEdUserIO::putString
virtual void putString(const OdString &string)=0
OdEd::kSelAllowPSVP
@ kSelAllowPSVP
Definition: EdUserIO.h:114
OdEdPointDefTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdPointDefTracker)
OdEd::kGstNoEmpty
@ kGstNoEmpty
Definition: EdUserIO.h:68
OdEdUserIO
Definition: EdUserIO.h:346
OdEd::kSelRemove
@ kSelRemove
Definition: EdUserIO.h:109
OdEd::kGanDefault
@ kGanDefault
Definition: EdUserIO.h:77
OdEdIntegerTracker::setValue
virtual void setValue(int value)=0
OdSharedPtr
Definition: SharedPtr.h:49
OdEdKeyword::keyword
const OdString & keyword() const
OdRxObject
Definition: RxObject.h:564
OdEd::kSelAllowEmpty
@ kSelAllowEmpty
Definition: EdUserIO.h:108
OdEd::kGfpOverwritePrompt
@ kGfpOverwritePrompt
Definition: EdUserIO.h:60
OdEdStringTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdStringTracker)
OdEd::kSelIgnorePickFirst
@ kSelIgnorePickFirst
Definition: EdUserIO.h:105
OdEdUserIO::getCmColor
virtual OdSharedPtr< OdCmColorBase > getCmColor(const OdString &prompt, int options=OdEd::kInpDefault, const OdCmColorBase *pDefaultValue=0, const OdString &keywords=OdString::kEmpty, OdEdColorTracker *pTracker=0)=0
OdEdCancel::FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEd::kGanFromLastPoint
@ kGanFromLastPoint
Definition: EdUserIO.h:85
TD_PackPop.h
OdEd::kGdsNoNeg
@ kGdsNoNeg
Definition: EdUserIO.h:95
OdEd::kGinNoNeg
@ kGinNoNeg
Definition: EdUserIO.h:96
OdCmColorBase
Definition: CmColorBase.h:1204
OdEdStringTracker::setCursor
virtual void setCursor(const bool &bShowCursor)
Definition: EdUserIO.h:202
OdEd::kGptRectFrame
@ kGptRectFrame
Definition: EdUserIO.h:81
OdEd::OdDbInputOptions
OdDbInputOptions
Definition: EdUserIO.h:72
RxObject.h
OdEdPointDefTrackerPtr
OdSmartPtr< OdEdPointDefTracker > OdEdPointDefTrackerPtr
Definition: EdUserIO.h:236
OdEd::kSelDefault
@ kSelDefault
Definition: EdUserIO.h:102
OdEd::kInpDisallowOther
@ kInpDisallowOther
Definition: EdUserIO.h:49
OdEd::CommonInputOptions
CommonInputOptions
Definition: EdUserIO.h:46
OdEd::SelectOptions
SelectOptions
Definition: EdUserIO.h:101
OdEd::kSelAllowInactSpaces
@ kSelAllowInactSpaces
Definition: EdUserIO.h:111
OdEdException
Definition: EdUserIO.h:267
OdEd
Definition: EdUserIO.h:44
OdEdCancel
Definition: EdUserIO.h:283
OdErrorContext
Definition: OdErrorContext.h:44
OdEdPointTracker::setValue
virtual void setValue(const OdGePoint3d &value)=0
OdEd::kGdsPerpDist
@ kGdsPerpDist
Definition: EdUserIO.h:90
OdString.h
OdEdInputTracker::addDrawables
virtual int addDrawables(OdGsView *pView)=0
OdEdUserIO::interactive
virtual bool interactive()
OdEd::kGstDefault
@ kGstDefault
Definition: EdUserIO.h:65
OdEdPointDefTracker
Definition: EdUserIO.h:229
OdEd::kGinDefault
@ kGinDefault
Definition: EdUserIO.h:75
OdSmartPtr
Definition: SmartPtr.h:58
OdGePoint3d
Definition: GePoint3d.h:55
OdEdException::FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdColorTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdColorTracker)
OdEd::GetStringOptions
GetStringOptions
Definition: EdUserIO.h:64
OdEdUserIO::getKeyword
virtual int getKeyword(const OdString &prompt, const OdString &keywords, int defVal=-1, int options=OdEd::kInpDefault, OdEdIntegerTracker *pTracker=0)=0
OdEd::kSelAllowLocked
@ kSelAllowLocked
Definition: EdUserIO.h:116
OdEd::kGdsNoZero
@ kGdsNoZero
Definition: EdUserIO.h:91
OdEdEmptyInput::FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdException::OdEdException
OdEdException(OdErrorContext *pErrCtx)
OdEd::kGrlNoZero
@ kGrlNoZero
Definition: EdUserIO.h:93
OdEd::kGanNoZero
@ kGanNoZero
Definition: EdUserIO.h:94
OdEd::kSelAllowSubents
@ kSelAllowSubents
Definition: EdUserIO.h:115
OdEd::kGptNoOSnap
@ kGptNoOSnap
Definition: EdUserIO.h:84
OdEdPointTracker
Definition: EdUserIO.h:215
OdEd::kGinNoZero
@ kGinNoZero
Definition: EdUserIO.h:92
OdEd::kSelSinglePass
@ kSelSinglePass
Definition: EdUserIO.h:106
OdEd::kSelPickLastPoint
@ kSelPickLastPoint
Definition: EdUserIO.h:103
SharedPtr.h
OdEdEmptyInput
Definition: EdUserIO.h:331
OdEd::kGfpForSave
@ kGfpForSave
Definition: EdUserIO.h:59
OdEd::kGptNoLimCheck
@ kGptNoLimCheck
Definition: EdUserIO.h:78
OdEdKeyword::FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdUserIO::getFilePath
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)
TD_PackPush.h
OdEdUserIO::getString
virtual OdString getString(const OdString &prompt, int options=OdEd::kInpDefault, const OdString &defValue=OdString::kEmpty, const OdString &keywords=OdString::kEmpty, OdEdStringTracker *pTracker=0)=0
OdEdUserIO::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdUserIO)
OdEd::kGdsFromLastPoint
@ kGdsFromLastPoint
Definition: EdUserIO.h:86
OdEd::GetFilePathFlags
GetFilePathFlags
Definition: EdUserIO.h:57
OdEdPointDefTracker::basePoint
virtual OdGePoint3d basePoint() const =0
OdEdColorTracker::setValue
virtual void setValue(const OdCmColorBase &value)=0
ODRX_ABSTRACT
#define ODRX_ABSTRACT
Definition: OdPlatformSettings.h:117
OdEd::kGdsDefault
@ kGdsDefault
Definition: EdUserIO.h:74
OdEd::kSelLeaveHighlighted
@ kSelLeaveHighlighted
Definition: EdUserIO.h:110
OdEd::kInpDefault
@ kInpDefault
Definition: EdUserIO.h:47
OdEdUserIO::getInt
virtual int getInt(const OdString &prompt, int options=OdEd::kInpDefault, int defVal=0, const OdString &keywords=OdString::kEmpty, OdEdIntegerTracker *pTracker=0)=0
OdEdKeyword::keywordIndex
int keywordIndex() const
OdEdColorTracker
Definition: EdUserIO.h:243
OdEdKeyword
Definition: EdUserIO.h:299
OdEdRealTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdRealTracker)
OdEd::kSelAllowObjects
@ kSelAllowObjects
Definition: EdUserIO.h:113
OdEd::kInpDisallowEmpty
@ kInpDisallowEmpty
Definition: EdUserIO.h:48
OdEdUserIO::getReal
virtual double getReal(const OdString &prompt, int options=OdEd::kInpDefault, double defVal=0.0, const OdString &keywords=OdString::kEmpty, OdEdRealTracker *pTracker=0)=0
OdEdColorTrackerPtr
OdSmartPtr< OdEdColorTracker > OdEdColorTrackerPtr
Definition: EdUserIO.h:250
GiDrawable.h
OdEdInputTrackerPtr
OdSmartPtr< OdEdInputTracker > OdEdInputTrackerPtr
Definition: EdUserIO.h:147
OdEdKeyword::OdEdKeyword
OdEdKeyword(int nKeyword, const OdString &sKeyword)
OdEdStringTrackerPtr
OdSmartPtr< OdEdStringTracker > OdEdStringTrackerPtr
Definition: EdUserIO.h:208
value
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
OdEdCancel::OdEdCancel
OdEdCancel(OdErrorContext *pErrCtx)
OdEd::kGptBeginDrag
@ kGptBeginDrag
Definition: EdUserIO.h:82
OdEdRealTracker::setValue
virtual void setValue(double value)=0
OdEd::kGanNoAngBase
@ kGanNoAngBase
Definition: EdUserIO.h:87
OdEdCancel::OdEdCancel
OdEdCancel()
OdString::kEmpty
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
OdEdOtherInput::OdEdOtherInput
OdEdOtherInput(const OdString &sInput)
OdEd::kGds2d
@ kGds2d
Definition: EdUserIO.h:88
OdEdOtherInput::FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEd::kInpNonZero
@ kInpNonZero
Definition: EdUserIO.h:52
OdEdRealTracker
Definition: EdUserIO.h:176
OdGsModel
Definition: GsModel.h:77
OdEd::kGptEndDrag
@ kGptEndDrag
Definition: EdUserIO.h:83
OdEdStringTracker::setValue
virtual void setValue(const OdString &value)=0
OdEd::kSelAllowSubentsAlways
@ kSelAllowSubentsAlways
Definition: EdUserIO.h:118
OdEdIntegerTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdIntegerTracker)
OdEd::kGstNoSpaces
@ kGstNoSpaces
Definition: EdUserIO.h:66
OdEdUserIO::putError
virtual void putError(const OdString &errmsg)
Definition: EdUserIO.h:509
OdEdStringTracker
Definition: EdUserIO.h:194
OdEd::kGptDefault
@ kGptDefault
Definition: EdUserIO.h:73
OdEd::kGptRubberBand
@ kGptRubberBand
Definition: EdUserIO.h:80
OdEd::kGrlDefault
@ kGrlDefault
Definition: EdUserIO.h:76
OdEdInputTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdInputTracker)
OdEd::kGdsSignedDist
@ kGdsSignedDist
Definition: EdUserIO.h:89
OdEdIntegerTrackerPtr
OdSmartPtr< OdEdIntegerTracker > OdEdIntegerTrackerPtr
Definition: EdUserIO.h:165
OdEdException::OdEdException
OdEdException()
OdEdPointTracker::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdEdPointTracker)
OdEdOtherInput
Definition: EdUserIO.h:316