| 1 | -- Copyright (c) 1993-1999 Matra Datavision |
| 2 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
| 3 | -- |
| 4 | -- The content of this file is subject to the Open CASCADE Technology Public |
| 5 | -- License Version 6.5 (the "License"). You may not use the content of this file |
| 6 | -- except in compliance with the License. Please obtain a copy of the License |
| 7 | -- at http://www.opencascade.org and read it completely before using this file. |
| 8 | -- |
| 9 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
| 10 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
| 11 | -- |
| 12 | -- The Original Code and all software distributed under the License is |
| 13 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
| 14 | -- Initial Developer hereby disclaims all such warranties, including without |
| 15 | -- limitation, any warranties of merchantability, fitness for a particular |
| 16 | -- purpose or non-infringement. Please see the License for the specific terms |
| 17 | -- and conditions governing the rights and limitations under the License. |
| 18 | |
| 19 | class DimensionAspect from Prs3d inherits BasicAspect from Prs3d |
| 20 | |
| 21 | ---Purpose: defines the attributes when drawing a Length Presentation. |
| 22 | uses |
| 23 | DimensionTextHorizontalPosition from Prs3d, |
| 24 | DimensionTextVerticalPosition from Prs3d, |
| 25 | DimensionArrowOrientation from Prs3d, |
| 26 | AspectLine3d from Graphic3d, |
| 27 | ArrowAspect from Prs3d, |
| 28 | LineAspect from Prs3d, |
| 29 | TextAspect from Prs3d, |
| 30 | NameOfColor from Quantity, |
| 31 | Color from Quantity, |
| 32 | TypeOfLine from Aspect, |
| 33 | PlaneAngle from Quantity, |
| 34 | TypeOfLine from Aspect |
| 35 | is |
| 36 | |
| 37 | Create returns mutable DimensionAspect from Prs3d; |
| 38 | --- Purpose: Constructs an empty framework to define the display of dimensions. |
| 39 | |
| 40 | LineAspect(me) returns mutable LineAspect from Prs3d; |
| 41 | ---Purpose: Returns the settings for the display of lines used in presentation of dimensions. |
| 42 | |
| 43 | SetLineAspect(me: mutable; theAspect: LineAspect from Prs3d); |
| 44 | ---Purpose: Sets the display attributes of lines used in presentation of dimensions. |
| 45 | |
| 46 | TextAspect(me) returns mutable TextAspect from Prs3d is static; |
| 47 | --- Purpose: Returns the settings for the display of text used in presentation of dimensions. |
| 48 | |
| 49 | SetTextAspect(me:mutable; theAspect: TextAspect from Prs3d) is static; |
| 50 | ---Purpose: Sets the display attributes of text used in presentation of dimensions. |
| 51 | |
| 52 | IsText3d(me) returns Boolean from Standard; |
| 53 | --- Purpose: Check if text for dimension label is 3d. |
| 54 | |
| 55 | MakeText3d (me:mutable; isText3d: Boolean from Standard); |
| 56 | ---Purpose: Sets type of text. |
| 57 | |
| 58 | IsTextShaded (me) returns Boolean from Standard; |
| 59 | --- Purpose: Check if 3d text for dimension label is shaded. |
| 60 | |
| 61 | MakeTextShaded (me: mutable; isTextShaded: Boolean from Standard); |
| 62 | --- Purpose: Turns on/off text shading for 3d text. |
| 63 | |
| 64 | IsArrows3d(me) returns Boolean from Standard; |
| 65 | --- Purpose: Gets type of arrows. |
| 66 | |
| 67 | MakeArrows3d (me:mutable; isArrows3d: Boolean from Standard); |
| 68 | ---Purpose: Sets type of arrows. |
| 69 | |
| 70 | SetArrowOrientation(me: mutable; theArrowOrient: DimensionArrowOrientation from Prs3d); |
| 71 | --- Purpose: Sets orientation of arrows (external or internal). |
| 72 | -- By default orientation is chosen automatically according to situation and text label size. |
| 73 | |
| 74 | ArrowOrientation (me) returns DimensionArrowOrientation from Prs3d; |
| 75 | --- Purpose: Gets orientation of arrows (external or internal). |
| 76 | |
| 77 | SetTextVerticalPosition (me: mutable; thePosition : DimensionTextVerticalPosition from Prs3d); |
| 78 | --- Purpose: Sets vertical text alignment for text label. |
| 79 | |
| 80 | TextVerticalPosition (me) returns DimensionTextVerticalPosition from Prs3d; |
| 81 | --- Purpose: Gets vertical text alignment for text label. |
| 82 | |
| 83 | SetTextHorizontalPosition (me: mutable; thePosition: DimensionTextHorizontalPosition from Prs3d); |
| 84 | --- Purpose: Sets horizontal text alignment for text label. |
| 85 | |
| 86 | TextHorizontalPosition (me) returns DimensionTextHorizontalPosition from Prs3d; |
| 87 | --- Purpose: Gets horizontal text alignment for text label. |
| 88 | |
| 89 | ArrowAspect(me) returns mutable ArrowAspect from Prs3d is static; |
| 90 | --- Purpose: Returns the settings for displaying arrows. |
| 91 | |
| 92 | SetArrowAspect(me: mutable; theAspect: ArrowAspect from Prs3d) is static; |
| 93 | ---Purpose: Sets the display attributes of arrows used in presentation of dimensions. |
| 94 | |
| 95 | SetCommonColor(me:mutable; theColor: Color from Quantity) is static; |
| 96 | ---Purpose: Sets the same color for all parts of dimension: lines, arrows and text. |
| 97 | |
| 98 | SetExtensionSize (me : mutable; theSize : Real from Standard) is static; |
| 99 | ---Purpose: Sets extension size. |
| 100 | |
| 101 | ExtensionSize (me) returns Real from Standard; |
| 102 | ---Purpose: Returns extension size. |
| 103 | |
| 104 | fields |
| 105 | |
| 106 | myLineAspect: LineAspect from Prs3d; |
| 107 | ---Purpose: Text style. The size for 3d (or 2d) text is also inside here. |
| 108 | |
| 109 | myTextAspect: TextAspect from Prs3d; |
| 110 | myArrowAspect : ArrowAspect from Prs3d; |
| 111 | myIsText3d : Boolean from Standard; |
| 112 | myIsTextShaded : Boolean from Standard; |
| 113 | myIsArrows3d: Boolean from Standard; |
| 114 | |
| 115 | myArrowOrientation : DimensionArrowOrientation from Prs3d; |
| 116 | ---Purpose: Dimension arrow orientation. |
| 117 | -- By default, it is computed automatically. Its value depends on the text |
| 118 | -- bouning rectangle size and distance between two flyouts. |
| 119 | -- By default, it is "fit" one. |
| 120 | |
| 121 | myTextHPosition : DimensionTextHorizontalPosition from Prs3d; |
| 122 | ---Purpose: Defines horizontal position of text value label, by default it is |
| 123 | -- "fit" - selected automatically depending on label-to-dimension size relation. |
| 124 | |
| 125 | myTextVPosition : DimensionTextVerticalPosition from Prs3d; |
| 126 | ---Purpose: Defines vertical position of text value label, by default it is center. |
| 127 | |
| 128 | myExtensionSize : Real from Standard; |
| 129 | ---Purpose: Size of arrow extensions. |
| 130 | -- The length of arrow tails if arrows are located outside dimension line. |
| 131 | |
| 132 | end DimensionAspect from Prs3d; |