CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
EdUserIO.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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
34
35class OdGePoint3d;
36
37#include "TD_PackPush.h"
38
43namespace 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
55 };
56
58 {
59 kGfpForOpen = 0, // For Open.
60 kGfpForSave = 1, // For Save.
61 kGfpOverwritePrompt = 2 // Enable overwrite prompt displaying when exist file selected for saving.
62 };
63
65 {
66 kGstDefault = 0, // Spaces disallowed, no KeywordExceptions
67 kGstNoSpaces = 0, // Spaces disallowed
68 kGstAllowSpaces = 1, // The first space character will not terminate the input.
69 kGstNoEmpty = 2 // The first space character will not terminate the input.
70 };
71
73 {
74 kGptDefault = 0x00000000,
79 kGptNoLimCheck = 0x00000001, // Ignore the LIMMIN and LIMMAX system variables
80 kGptNoUCS = 0x00000002, // Do not project result point onto UCS plane (input point in eye plane)
81 kGptRubberBand = 0x00000004,
82 kGptRectFrame = 0x00000008,
83 kGptBeginDrag = 0x00000010,
84 kGptEndDrag = 0x00000020,
85 kGptNoOSnap = 0x00000040, // Disables object snaps
86 kGanFromLastPoint = 0x00000080,
88 kGanNoAngBase = 0x00000100,
89 kGds2d = 0x00000200, // Restrict (getDistance) to 2D
90 kGdsSignedDist = 0x00000400,
91 kGdsPerpDist = 0x00000800, // is in perpendicular plane to UCS plane
92 kGdsNoZero = 0x00001000,
96 kGdsNoNeg = 0x00002000,
99 };
100
102 {
103 kSelDefault = 0x00000000,
104 kSelPickLastPoint = 0x00000001, // Use last entered point as first corner of selection box
105 kSelSingleEntity = 0x00000002, // Select single entity
106 kSelIgnorePickFirst = 0x00000004, // Clear previous contents of selection set
107 kSelSinglePass = 0x00000008, // Use single pass for selection
108 // (no pressing Enter is required to finish selection)
109 kSelAllowEmpty = 0x00000010, // Empty selection set is allowed
110 kSelRemove = 0x00000020, // Remove selected entities from current selection set
111 kSelLeaveHighlighted= 0x00000040, // Leave entities highlighted after operation
112 kSelAllowInactSpaces= 0x00000080, // Allow selection of all entities not only in active layout
113
114 kSelAllowObjects = 0x00000100, // Allow non-entity objects selection
115 kSelAllowPSVP = 0x00000200, // Allow overall Paper Space viewport selection
116 kSelAllowSubents = 0x00000400, // Allow subentities selection
117 kSelAllowLocked = 0x00000800, // Allow selection of entities on locked layers
118
119 kSelAllowSubentsAlways = 0x00001000, // Allow subentities selection independent on press CTRL
120 };
121}
122
123class OdGsView;
124class OdGsModel;
125
126class OdCmColorBase;
127
128//
129// OdEd_Classes
130//
131
140{
141public:
143
144 virtual int addDrawables(OdGsView* pView);
145 virtual void removeDrawables(OdGsView* pView);
146};
147
152
153
173
178
179
199
204
205
214{
215protected:
216 bool bShowCursor = false;
217public:
219
223 using argument_type = const OdString&;
224
225 virtual void setValue(argument_type value) = 0;
226
227 virtual void setCursor(const bool& showCursor)
228 {
229 this->bShowCursor = showCursor;
230 }
231};
232
237
238
254
259
260
271
276
277
293
298
299
300//
301// OdEd_Exceptions
302//
303
304#define OdException OdError
305
306
321
322
330{
331public:
332
337
344
346};
347
348
356{
357public:
358
365 OdEdKeyword(int nKeyword, const OdString& sKeyword);
366
367 int keywordIndex() const;
368 const OdString& keyword() const;
369
371};
372
373
380{
381public:
382
388 OdEdOtherInput(const OdString& sInput);
389 const OdString& string() const;
390
392};
393
394
401{
402public:
403
408
410};
411
412
419class ODRX_ABSTRACT FIRSTDLL_EXPORT OdEdUserIO : public OdRxObject
420{
421public:
423
427 virtual bool interactive();
428
446 virtual int getKeyword(
447 const OdString& prompt,
448 const OdString& keywords,
449 int defVal = -1,
450 int options = OdEd::kInpDefault,
451 OdEdIntegerTracker* pTracker = 0) = 0;
452
467 virtual int getInt(
468 const OdString& prompt,
469 int options = OdEd::kInpDefault,
470 int defVal = 0,
471 const OdString& keywords = OdString::kEmpty,
472 OdEdIntegerTracker* pTracker = 0) = 0;
473
488 virtual double getReal(
489 const OdString& prompt,
490 int options = OdEd::kInpDefault,
491 double defVal = 0.0,
492 const OdString& keywords = OdString::kEmpty,
493 OdEdRealTracker* pTracker = 0) = 0;
494
511 const OdString& prompt,
512 int options = OdEd::kInpDefault,
513 const OdString& defValue = OdString::kEmpty,
514 const OdString& keywords = OdString::kEmpty,
515 OdEdStringTracker* pTracker = 0) = 0;
516
521 virtual void putString(const OdString& string) = 0;
522
539 const OdString& prompt,
540 int options = OdEd::kInpDefault,
541 const OdCmColorBase* pDefaultValue = 0,
542 const OdString& keywords = OdString::kEmpty,
543 OdEdColorTracker* pTracker = 0) = 0;
544
569 const OdString& prompt,
570 int options = OdEd::kGfpForOpen,
571 const OdString& dialogCaption = OdString::kEmpty,
572 const OdString& defExt = OdString::kEmpty,
573 const OdString& fileName = OdString::kEmpty,
574 const OdString& filter = OdString::kEmpty,
575 const OdString& keywords = OdString::kEmpty,
576 OdEdStringTracker* pTracker = 0);
577
583 virtual void putError(const OdString& errmsg) { putString(errmsg); }
584};
585
586#include "TD_PackPop.h"
587
588#endif //#ifndef _ODEDUSERIO_H_INCLUDED_
OdSmartPtr< OdEdColorTracker > OdEdColorTrackerPtr
Definition EdUserIO.h:297
#define OdException
Definition EdUserIO.h:304
OdSmartPtr< OdEdPointTracker > OdEdPointTrackerPtr
Definition EdUserIO.h:258
OdSmartPtr< OdEdStringTracker > OdEdStringTrackerPtr
Definition EdUserIO.h:236
OdSmartPtr< OdEdRealTracker > OdEdRealTrackerPtr
Definition EdUserIO.h:203
OdSmartPtr< OdEdIntegerTracker > OdEdIntegerTrackerPtr
Definition EdUserIO.h:177
OdSmartPtr< OdEdInputTracker > OdEdInputTrackerPtr
Definition EdUserIO.h:151
OdSmartPtr< OdEdPointDefTracker > OdEdPointDefTrackerPtr
Definition EdUserIO.h:275
#define ODRX_ABSTRACT
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdCancel(OdErrorContext *pErrCtx)
virtual void setValue(argument_type value)=0
ODRX_DECLARE_MEMBERS(OdEdColorTracker)
const OdCmColorBase & argument_type
Definition EdUserIO.h:289
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdException(OdErrorContext *pErrCtx)
ODRX_DECLARE_MEMBERS(OdEdInputTracker)
virtual int addDrawables(OdGsView *pView)
virtual void removeDrawables(OdGsView *pView)
virtual void setValue(argument_type value)=0
ODRX_DECLARE_MEMBERS(OdEdIntegerTracker)
const OdString & keyword() const
int keywordIndex() const
FX_DECLARE_CLANG_RTTI_EXCEPTION_WORKAROUND()
OdEdKeyword(int nKeyword, const OdString &sKeyword)
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(argument_type value)=0
const OdGePoint3d & argument_type
Definition EdUserIO.h:250
virtual void setValue(argument_type value)=0
ODRX_DECLARE_MEMBERS(OdEdRealTracker)
double argument_type
Definition EdUserIO.h:195
const OdString & argument_type
Definition EdUserIO.h:223
virtual void setValue(argument_type value)=0
ODRX_DECLARE_MEMBERS(OdEdStringTracker)
virtual void setCursor(const bool &showCursor)
Definition EdUserIO.h:227
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 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 OdSharedPtr< OdCmColorBase > getCmColor(const OdString &prompt, int options=OdEd::kInpDefault, const OdCmColorBase *pDefaultValue=0, const OdString &keywords=OdString::kEmpty, OdEdColorTracker *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:583
Definition Gs.h:141
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition OdString.h:100
GLsizei const GLfloat * value
Definition gles2_ext.h:302
GetStringOptions
Definition EdUserIO.h:65
@ kGstNoSpaces
Definition EdUserIO.h:67
@ kGstAllowSpaces
Definition EdUserIO.h:68
@ kGstDefault
Definition EdUserIO.h:66
@ kGstNoEmpty
Definition EdUserIO.h:69
GetFilePathFlags
Definition EdUserIO.h:58
@ kGfpOverwritePrompt
Definition EdUserIO.h:61
@ kGfpForOpen
Definition EdUserIO.h:59
@ kGfpForSave
Definition EdUserIO.h:60
OdDbInputOptions
Definition EdUserIO.h:73
@ kGptNoUCS
Definition EdUserIO.h:80
@ kGanNoAngBase
Definition EdUserIO.h:88
@ kGptBeginDrag
Definition EdUserIO.h:83
@ kGptEndDrag
Definition EdUserIO.h:84
@ kGanFromLastPoint
Definition EdUserIO.h:86
@ kGptRubberBand
Definition EdUserIO.h:81
@ kGdsNoZero
Definition EdUserIO.h:92
@ kGdsNoNeg
Definition EdUserIO.h:96
@ kGptNoLimCheck
Definition EdUserIO.h:79
@ kGdsSignedDist
Definition EdUserIO.h:90
@ kGptNoOSnap
Definition EdUserIO.h:85
@ kGdsDefault
Definition EdUserIO.h:75
@ kGrlNoNeg
Definition EdUserIO.h:98
@ kGinNoZero
Definition EdUserIO.h:93
@ kGptRectFrame
Definition EdUserIO.h:82
@ kGrlDefault
Definition EdUserIO.h:77
@ kGinDefault
Definition EdUserIO.h:76
@ kGinNoNeg
Definition EdUserIO.h:97
@ kGptDefault
Definition EdUserIO.h:74
@ kGds2d
Definition EdUserIO.h:89
@ kGdsFromLastPoint
Definition EdUserIO.h:87
@ kGdsPerpDist
Definition EdUserIO.h:91
@ kGanNoZero
Definition EdUserIO.h:95
@ kGrlNoZero
Definition EdUserIO.h:94
@ kGanDefault
Definition EdUserIO.h:78
SelectOptions
Definition EdUserIO.h:102
@ kSelPickLastPoint
Definition EdUserIO.h:104
@ kSelIgnorePickFirst
Definition EdUserIO.h:106
@ kSelAllowInactSpaces
Definition EdUserIO.h:112
@ kSelRemove
Definition EdUserIO.h:110
@ kSelAllowSubents
Definition EdUserIO.h:116
@ kSelDefault
Definition EdUserIO.h:103
@ kSelLeaveHighlighted
Definition EdUserIO.h:111
@ kSelAllowSubentsAlways
Definition EdUserIO.h:119
@ kSelAllowEmpty
Definition EdUserIO.h:109
@ kSelSinglePass
Definition EdUserIO.h:107
@ kSelSingleEntity
Definition EdUserIO.h:105
@ kSelAllowObjects
Definition EdUserIO.h:114
@ kSelAllowLocked
Definition EdUserIO.h:117
@ kSelAllowPSVP
Definition EdUserIO.h:115
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
@ kInpThrowEmptyInQuotes
Definition EdUserIO.h:54
@ kInpDisallowEmpty
Definition EdUserIO.h:48
@ kInpThrowOther
Definition EdUserIO.h:51
@ kInpThrowEmpty
Definition EdUserIO.h:50