13 // Windoze XP can't handle the original MAX/MINDOUBLE's
14 #define RS_MAXDOUBLE 1.0E+10
15 #define RS_MINDOUBLE -1.0E+10
18 * Class namespace for various enums along with some simple wrapper methods for
19 * converting the enums to the Qt counterparts.
21 * @author James Hammons
22 * @author Andrew Mustun
24 //change from RS2 to EN (for ENum)
33 /** Flag for Undoables. */
35 /** Entity Visibility. */
37 /** Entity attribute (e.g. color) is defined by layer. */
39 /** Entity attribute (e.g. color) defined by block. */
43 /** Layer frozen by default. */
44 FlagDefFrozen = 1 << 5,
47 /** Used for invalid pens. */
49 /** Entity in current selection. */
50 FlagSelected = 1 << 8,
51 /** Polyline closed? */
53 /** Flag for temporary entities (e.g. hatch) */
55 /** Flag for processed entities (optcontour) */
56 FlagProcessed = 1 << 11,
57 /** Startpoint selected */
58 FlagSelected1 = 1 << 12,
59 /** Endpoint selected */
60 FlagSelected2 = 1 << 13,
61 /** Entity is highlighted temporarily (as a user action feedback) */
62 FlagHighlighted = 1 << 14
66 * Variable types used by VariableDict and Variable.
77 * File types. Used by file dialogs. Note: the extension might not
78 * be enough to distinguish file types.
81 FormatUnknown, /**< Unknown / unsupported format. */
82 FormatDXF1, /**< QCad 1 compatibility DXF format. */
83 FormatDXF, /**< DXF format. 2000. */
84 FormatDXF12, /**< DXF format. R12. */
85 FormatCXF, /**< CAM Expert Font format. */
86 FormatCAM /**< CAM Expert CAM format (NC, CNC, D, ..) */
90 * Entity types returned by the rtti() method
93 EntityUnknown, /**< Unknown */
94 EntityContainer, /**< Container */
95 EntityBlock, /**< Block (Group definition) */
96 EntityFontChar, /**< Font character */
97 EntityInsert, /**< Insert (Group instance) */
98 EntityGraphic, /**< Graphic with layers */
99 EntityPoint, /**< Point */
100 EntityLine, /**< Line */
101 EntityPolyline, /**< Polyline */
102 EntityVertex, /**< Vertex (part of a polyline) */
103 EntityArc, /**< Arc */
104 EntityCircle, /**< Circle */
105 EntityEllipse, /**< Ellipse */
106 EntitySolid, /**< Ellipse */
107 EntityConstructionLine, /**< Construction line */
108 EntityText, /**< Text */
109 EntityDimAligned, /**< Aligned Dimension */
110 EntityDimLinear, /**< Linear Dimension */
111 EntityDimRadial, /**< Radial Dimension */
112 EntityDimDiametric, /**< Diametric Dimension */
113 EntityDimAngular, /**< Angular Dimension */
114 EntityDimLeader, /**< Leader Dimension */
115 EntityHatch, /**< Hatch */
116 EntityImage, /**< Image */
117 EntitySpline /**< Spline */
121 * Action types used by action factories.
124 ActionNone, /**< Invalid action id. */
135 ActionFilePrintPreview,
143 ActionEditCutNoSelect,
145 ActionEditCopyNoSelect,
151 ActionViewCommandLine,
152 ActionViewOptionToolbar,
167 ActionDeselectWindow,
170 ActionSelectIntersected,
171 ActionDeselectIntersected,
178 ActionDrawArcParallel,
179 ActionDrawArcTangential,
184 ActionDrawCircleParallel,
185 ActionDrawEllipseArcAxis,
186 ActionDrawEllipseAxis,
188 ActionDrawHatchNoSelect,
192 ActionDrawLineBisector,
194 ActionDrawLineHorVert,
195 ActionDrawLineHorizontal,
196 ActionDrawLineOrthogonal,
197 ActionDrawLineParallel,
198 ActionDrawLineParallelThrough,
199 ActionDrawLinePolygon,
200 ActionDrawLinePolygon2,
201 ActionDrawLineRectangle,
202 ActionDrawLineRelAngle,
203 ActionDrawLineTangent1,
204 ActionDrawLineTangent2,
205 ActionDrawLineVertical,
212 ActionPolylineAppend,
214 ActionPolylineDelBetween,
226 ActionModifyAttributes,
227 ActionModifyAttributesNoSelect,
229 ActionModifyDeleteNoSelect,
230 ActionModifyDeleteQuick,
231 ActionModifyDeleteFree,
233 ActionModifyMoveNoSelect,
235 ActionModifyRotateNoSelect,
237 ActionModifyScaleNoSelect,
239 ActionModifyMirrorNoSelect,
240 ActionModifyMoveRotate,
241 ActionModifyMoveRotateNoSelect,
243 ActionModifyRotate2NoSelect,
247 ActionModifyTrimAmount,
260 ActionSnapIntersection,
261 ActionSnapIntersectionManual,
263 ActionRestrictNothing,
264 ActionRestrictOrthogonal,
265 ActionRestrictHorizontal,
266 ActionRestrictVertical,
268 ActionSetRelativeZero,
269 ActionLockRelativeZero,
270 ActionUnlockRelativeZero,
276 ActionInfoTotalLength,
277 ActionInfoTotalLengthNoSelect,
280 ActionLayersDefreezeAll,
281 ActionLayersFreezeAll,
285 ActionLayersToggleView,
286 ActionLayersToggleLock,
288 ActionBlocksDefreezeAll,
289 ActionBlocksFreezeAll,
292 ActionBlocksAttributes,
295 ActionBlocksToggleView,
297 ActionBlocksCreateNoSelect,
299 ActionBlocksExplodeNoSelect,
301 ActionModifyExplodeText,
302 ActionModifyExplodeTextNoSelect,
306 ActionOptionsGeneral,
307 ActionOptionsDrawing,
309 ActionToolRegenerateDimensions,
314 #ifndef RS_NO_COMPLEX_ENTITIES
315 ActionPARISDebugCreateContainer,
323 /** Needed to loop through all actions */
328 * Entity ending. Used for returning which end of an entity is ment.
331 EndingStart, /**< Start point. */
332 EndingEnd, /**< End point. */
333 EndingNone /**< Neither. */
337 * Update mode for non-atomic entities that need to be updated when
338 * they change. e.g. texts, inserts, ...
341 NoUpdate, /**< No automatic updates. */
342 Update, /**< Always update automatically when modified. */
343 PreviewUpdate /**< Update automatically but only for previews (quick update) */
350 ModeFull, /**< Draw everything always detailed (default) */
351 ModeAuto, /**< Draw details when reasonable */
352 ModePreview, /**< Draw only in black/white without styles */
353 ModeXOR, /**< XOR mode for moving previews */
354 ModeBW /**< Black/white. Can be used for printing. */
361 UndoableUnknown, /**< Unknown undoable */
362 UndoableEntity, /**< Entity */
363 UndoableLayer /**< Layer */
370 ToolBarMain, /**< Main (menu). */
371 ToolBarPoints, /**< Points. */
372 ToolBarLines, /**< Lines. */
373 ToolBarArcs, /**< Arcs. */
374 ToolBarCircles, /**< Circles. */
375 ToolBarEllipses, /**< Ellipses. */
376 ToolBarSplines, /**< Splines. */
377 ToolBarPolylines, /**< Polylines. */
378 ToolBarText, /**< Text. */
379 ToolBarDim, /**< Dimensions. */
380 ToolBarSnap, /**< Snap. */
381 ToolBarModify, /**< Modify. */
382 ToolBarSelect, /**< Select. */
383 ToolBarInfo /**< Information */
390 None = 0, /**< No unit (unit from parent) */
391 Inch = 1, /**< Inch */
392 Foot = 2, /**< Foot: 12 Inches */
393 Mile = 3, /**< Mile: 1760 Yards = 1609 m */
394 Millimeter = 4, /**< Millimeter: 0.001m */
395 Centimeter = 5, /**< Centimeter: 0.01m */
396 Meter = 6, /**< Meter */
397 Kilometer = 7, /**< Kilometer: 1000m */
398 Microinch = 8, /**< Microinch: 0.000001 */
399 Mil = 9, /**< Mil = 0.001 Inch*/
400 Yard = 10, /**< Yard: 3 Feet */
401 Angstrom = 11, /**< Angstrom: 10^-10m */
402 Nanometer = 12, /**< Nanometer: 10^-9m */
403 Micron = 13, /**< Micron: 10^-6m */
404 Decimeter = 14, /**< Decimeter: 0.1m */
405 Decameter = 15, /**< Decameter: 10m */
406 Hectometer = 16, /**< Hectometer: 100m */
407 Gigameter = 17, /**< Gigameter: 1000000m */
408 Astro = 18, /**< Astro: 149.6 x 10^9m */
409 Lightyear = 19, /**< Lightyear: 9460731798 x 10^6m */
410 Parsec = 20, /**< Parsec: 30857 x 10^12 */
412 LastUnit = 21 /**< Used to iterate through units */
417 * Format for length values.
420 /** Scientific (e.g. 2.5E+05) */
422 /** Decimal (e.g. 9.5)*/
424 /** Engineering (e.g. 7' 11.5")*/
426 /** Architectural (e.g. 7'-9 1/8")*/
428 /** Fractional (e.g. 7 9 1/8) */
442 * Display formats for angles.
445 /** Degrees with decimal point (e.g. 24.5°) */
447 /** Degrees, Minutes and Seconds (e.g. 24°30'5") */
448 DegreesMinutesSeconds,
449 /** Gradians with decimal point (e.g. 390.5)*/
451 /** Radians with decimal point (e.g. 1.57)*/
453 /** Surveyor's units */
458 * Enum of levels of resolving when iterating through an entity tree.
461 /** Groups are not resolved */
464 * Resolve all but not Inserts.
466 ResolveAllButInserts,
468 * all Entity Containers are resolved
469 * (including Texts, Polylines, ...)
475 * Direction used for scrolling actions.
478 Up, Left, Right, Down
482 * Vertical alignments.
485 VAlignTop, /**< Top. */
486 VAlignMiddle, /**< Middle */
487 VAlignBottom /**< Bottom */
491 * Horizontal alignments.
494 HAlignLeft, /**< Left */
495 HAlignCenter, /**< Centered */
496 HAlignRight /**< Right */
500 * Text drawing direction.
502 enum TextDrawingDirection {
503 LeftToRight, /**< Left to right */
504 TopToBottom, /**< Top to bottom */
505 ByStyle /**< Inherited from associated text style */
509 * Line spacing style for texts.
511 enum TextLineSpacingStyle {
512 AtLeast, /**< Taller characters will override */
513 Exact /**< Taller characters will not override */
519 enum LeaderPathType {
520 Straight, /**< Straight line segments */
521 Spline /**< Splines */
525 * Direction for zooming actions.
532 * Axis specification for zooming actions.
542 SnapFree, /**< Free positioning */
543 SnapGrid, /**< Snap to grid points */
544 SnapEndpoint, /**< Snap to endpoints */
545 SnapMiddle, /**< Snap to middle points */
546 SnapCenter, /**< Snap to centers */
547 SnapOnEntity, /**< Snap to the next point on an entity */
548 SnapDist, /**< Snap to points with a distance to an endpoint */
549 SnapIntersection, /**< Snap to intersection */
550 SnapIntersectionManual /**< Snap to intersection manually */
556 enum SnapRestriction {
557 RestrictNothing, /**< No restriction to snap mode */
558 RestrictOrthogonal, /**< Restrict to 90,180,270,0 degrees */
559 RestrictHorizontal, /**< Restrict to 0,180 degrees */
560 RestrictVertical /**< Restrict to 90,270 degrees */
564 * Enum of line styles:
567 NoPen = 0, /**< No line at all. */
568 SolidLine = 1, /**< Normal line. */
570 DotLine = 2, /**< Dotted line. */
571 DotLine2 = 3, /**< Dotted line small. */
572 DotLineX2 = 4, /**< Dotted line large. */
574 DashLine = 5, /**< Dashed line. */
575 DashLine2 = 6, /**< Dashed line small. */
576 DashLineX2 = 7, /**< Dashed line large. */
578 DashDotLine = 8, /**< Alternate dots and dashes. */
579 DashDotLine2 = 9, /**< Alternate dots and dashes small. */
580 DashDotLineX2 = 10, /**< Alternate dots and dashes large. */
582 DivideLine = 11, /**< dash, dot, dot. */
583 DivideLine2 = 12, /**< dash, dot, dot small. */
584 DivideLineX2 = 13, /**< dash, dot, dot large. */
586 CenterLine = 14, /**< dash, small dash. */
587 CenterLine2 = 15, /**< dash, small dash small. */
588 CenterLineX2 = 16, /**< dash, small dash large. */
590 BorderLine = 17, /**< dash, dash, dot. */
591 BorderLine2 = 18, /**< dash, dash, dot small. */
592 BorderLineX2 = 19, /**< dash, dash, dot large. */
594 LineByLayer = -1, /**< Line type defined by layer not entity */
595 LineByBlock = -2 /**< Line type defined by block not entity */
599 * \brief Struct that stores a line type pattern (e.g. dash dot dot).
601 struct LineTypePatternStruct
609 * Enum of line widths:
612 Width00 = 0, /**< Width 1. (0.00mm) */
613 Width01 = 5, /**< Width 2. (0.05mm) */
614 Width02 = 9, /**< Width 3. (0.09mm) */
615 Width03 = 13, /**< Width 4. (0.13mm) */
616 Width04 = 15, /**< Width 5. (0.15mm) */
617 Width05 = 18, /**< Width 6. (0.18mm) */
618 Width06 = 20, /**< Width 7. (0.20mm) */
619 Width07 = 25, /**< Width 8. (0.25mm) */
620 Width08 = 30, /**< Width 9. (0.30mm) */
621 Width09 = 35, /**< Width 10. (0.35mm) */
622 Width10 = 40, /**< Width 11. (0.40mm) */
623 Width11 = 50, /**< Width 12. (0.50mm) */
624 Width12 = 53, /**< Width 13. (0.53mm) */
625 Width13 = 60, /**< Width 14. (0.60mm) */
626 Width14 = 70, /**< Width 15. (0.70mm) */
627 Width15 = 80, /**< Width 16. (0.80mm) */
628 Width16 = 90, /**< Width 17. (0.90mm) */
629 Width17 = 100, /**< Width 18. (1.00mm) */
630 Width18 = 106, /**< Width 19. (1.06mm) */
631 Width19 = 120, /**< Width 20. (1.20mm) */
632 Width20 = 140, /**< Width 21. (1.40mm) */
633 Width21 = 158, /**< Width 22. (1.58mm) */
634 Width22 = 200, /**< Width 23. (2.00mm) */
635 Width23 = 211, /**< Width 24. (2.11mm) */
636 WidthByLayer = -1, /**< Line width defined by layer not entity. */
637 WidthByBlock = -2, /**< Line width defined by block not entity. */
638 WidthDefault = -3 /**< Line width defaults to the predefined line width. */
642 * Enum of cursor types.
645 ArrowCursor, /**< ArrowCursor - standard arrow cursor. */
646 UpArrowCursor, /**< UpArrowCursor - upwards arrow. */
647 CrossCursor, /**< CrossCursor - crosshair. */
648 WaitCursor, /**< WaitCursor - hourglass/watch. */
649 IbeamCursor, /**< IbeamCursor - ibeam/text entry. */
650 SizeVerCursor, /**< SizeVerCursor - vertical resize. */
651 SizeHorCursor, /**< SizeHorCursor - horizontal resize. */
652 SizeBDiagCursor, /**< SizeBDiagCursor - diagonal resize (/). */
653 SizeFDiagCursor, /**< SizeFDiagCursor - diagonal resize (\). */
654 SizeAllCursor, /**< SizeAllCursor - all directions resize. */
655 BlankCursor, /**< BlankCursor - blank/invisible cursor. */
656 SplitVCursor, /**< SplitVCursor - vertical splitting. */
657 SplitHCursor, /**< SplitHCursor - horziontal splitting. */
658 PointingHandCursor, /**< PointingHandCursor - a pointing hand. */
659 ForbiddenCursor, /**< ForbiddenCursor - a slashed circle. */
660 WhatsThisCursor, /**< WhatsThisCursor - an arrow with a ?. */
661 CadCursor, /**< CadCursor - a bigger cross. */
662 DelCursor, /**< DelCursor - cursor for choosing entities */
663 SelectCursor, /**< SelectCursor - for selecting single entities */
664 MagnifierCursor, /**< MagnifierCursor - a magnifying glass. */
665 MovingHandCursor /**< Moving hand - a little flat hand. */
707 * Wrappers for Qt (ICK)
709 static Qt::PenStyle rsToQtLineType(RS2::LineType t);
710 static RS2::LineType qtToRsPenStyle(Qt::PenStyle s);
711 static RS2::LineWidth intToLineWidth(int w);
712 static Qt::CursorShape rsToQtCursorType(RS2::CursorType t);
713 static QPrinter::PageSize rsToQtPaperFormat(RS2::PaperFormat f);
716 #endif // __ENUMS_H__