0024133: Development of improvement of dimensions implementation; new length, radius...
[occt.git] / src / Prs3d / Prs3d_Drawer.cdl
1 -- Created on: 1992-09-18
2 -- Created by: Jean Louis FRENKEL
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class Drawer from Prs3d inherits TShared from MMgt
24
25         ---Purpose: A graphic attribute manager which governs how
26         -- objects such as color, width, line thickness and
27         -- deflection are displayed.
28         -- Prs3d_Drawer is the mother class of AIS_Drawer.
29         -- As such, it is its set functions which are called to
30         -- modify display parameters. In the example below we
31         -- can see that the AIS_Drawer is modified to set the
32         -- value of the deviation coefficient using a method
33         -- inherited from Prs3d_Drawer.
34         
35 uses
36     DatumAspect from Prs3d,
37     LineAspect from Prs3d,
38     TextAspect from Prs3d,
39     PointAspect from Prs3d,
40     ShadingAspect from Prs3d,
41     IsoAspect from Prs3d,
42     DimensionAspect from Prs3d,
43     PlaneAspect from Prs3d,
44     ArrowAspect from Prs3d,
45     TypeOfDeflection from Aspect,
46     NameOfColor from Quantity,
47     PlaneAngle from Quantity,
48     Length from Quantity,
49     TypeOfHLR from Prs3d
50
51 is
52     Create returns mutable Drawer from Prs3d;
53
54 ---Category: deviation definition.
55 -- 
56 -- All drawings of curves or patches are made with respect to a maximal 
57 -- chordial deviation. This deviation is absolute and given through
58 -- the method: SetMaximalChordialDeviation.
59 -- 
60 -- In the case of drawing shapes, it is allowed to ask for a relative
61 -- deviation.
62 -- This deviation will be: SizeOfObject * DeviationCoefficient where
63 -- DeviationCoefficient can be set through the method: SetDeviationCoefficient.
64 -- 
65 --
66 -- For drawing algorithms using discretisation, a default number of
67 -- points has been set to 17. It is possible to use the method SetDiscret
68 -- to change this number.
69 --
70
71
72     SetTypeOfDeflection (me:mutable; 
73                         aTypeOfDeflection: TypeOfDeflection from  Aspect)  
74         ---Purpose: Sets the type of chordal deflection.
75         -- This indicates whether the deflection value is absolute
76         -- or relative to the size of the object.         
77     is virtual;
78     
79     TypeOfDeflection(me) returns TypeOfDeflection from Aspect
80     is virtual;
81         --- Purpose: Returns the type of chordal deflection.
82         -- This indicates whether the deflection value is absolute
83         -- or relative to the size of the object.   
84     
85     SetMaximalChordialDeviation (me: mutable; 
86                                aChordialDeviation: Length from Quantity)
87         ---Purpose: Defines the maximal chordial deviation when drawing any curve;
88         --          Even if the type of deviation is set to TOD_Relative,
89         --          this value is used by:
90         --          
91         --                   Prs3d_DeflectionCurve
92         --                   Prs3d_WFDeflectionSurface
93         --                   Prs3d_WFDeflectionRestrictedFace
94     is virtual;
95     
96     MaximalChordialDeviation (me) returns Length from Quantity
97         ---Purpose: returns the maximal chordial deviation. Default value is 0.1
98     is virtual;
99             
100     SetDeviationCoefficient(me: mutable; aCoefficient: Real from Standard)
101         ---Purpose: Sets the deviation coefficient aCoefficient.
102     is virtual;
103
104     DeviationCoefficient(me) returns Real from Standard 
105     is virtual;
106         ---Purpose: Returns the deviation coefficient.
107     SetHLRDeviationCoefficient(me: mutable; aCoefficient: Real from Standard)
108         ---Purpose: Sets the deviation coefficient aCoefficient for removal
109         -- of hidden lines created by different viewpoints in
110         -- different presentations. The Default value is 0.02.
111     is virtual;
112
113     HLRDeviationCoefficient(me) returns Real from Standard 
114     is virtual;
115         ---Purpose: Returns the real number value of the hidden line
116         -- removal deviation coefficient.   
117     SetHLRAngle(me: mutable; anAngle: Real from Standard)
118         ---Purpose: Sets anAngle, the angle of maximum chordal
119         -- deviation for removal of hidden lines created by
120         -- different viewpoints in different presentations. The
121         -- default value is 20*PI/180.
122     is virtual;
123
124     HLRAngle(me) returns Real from Standard 
125     is virtual;
126         ---Purpose: Returns the real number value of the deviation angle
127         -- in hidden line removal views. The default value is 20*PI/180.
128     
129     SetDeviationAngle(me: mutable; anAngle: Real from Standard)
130         ---Purpose: Sets deviation angle
131     is virtual;
132
133     DeviationAngle(me) returns Real from Standard
134         ---Purpose: Returns the value for deviation angle.
135     is virtual;
136
137     SetDiscretisation(me: mutable; d: Integer from Standard)
138         ---Purpose: Sets the discretisation parameter d.
139     is virtual;
140
141     Discretisation(me) returns Integer from Standard
142     is virtual;
143         ---Purpose: Returns the discretisation setting.
144     SetMaximalParameterValue(me: mutable; Value: Real from Standard)
145         ---Purpose: defines the maximum value allowed  for the first and last
146         --          parameters of an infinite curve. Default value: 500. 
147     is virtual;
148     
149     MaximalParameterValue(me) returns Real from Standard
150     is virtual;
151         --- Purpose: Sets the maximum value allowed for the first and last
152         -- parameters of an infinite curve. By default, this value is 500000. 
153
154     SetIsoOnPlane (me: mutable; OnOff: Boolean from Standard)
155         ---Purpose: Sets IsoOnPlane on or off   by setting the parameter
156         -- OnOff to true or false.
157     is virtual;
158     
159     IsoOnPlane(me) returns Boolean from Standard 
160         ---Purpose: Returns True if the drawing of isos on planes is enabled.
161     is virtual;
162     
163     SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d)
164     is virtual;
165     ---Purpose: Sets the type of HLR algorithm
166     --          used by drawer's interactive objects
167     
168     TypeOfHLR(me) returns TypeOfHLR from Prs3d
169     is virtual;
170      ---Purpose: Gets the myTypeOfHLR value
171
172
173 -- 
174 -- Attributes for the U Isoparametric lines of patches.
175 --    
176     UIsoAspect (me:mutable) returns mutable IsoAspect from Prs3d
177         ---Purpose: Defines the attributes which are used when drawing an 
178         --          U isoparametric curve of a face. Defines the number
179         --          of U isoparametric curves to be drawn for a single face.
180         --          The LineAspect for U isoparametric lines can be edited
181         --          (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
182         --          The default values are:
183         --          COLOR       : Quantity_NOC_GRAY75
184         --          TYPE OF LINE: Aspect_TOL_SOLID
185         --          WIDTH       : 0.5
186         --          
187         --         
188         --          These attributes are used by the following algorithms:
189         --          Prs3d_WFDeflectionSurface 
190         --          Prs3d_WFDeflectionRestrictedFace
191
192
193     is virtual;    
194     
195     SetUIsoAspect (me:mutable; anAspect: IsoAspect from Prs3d) 
196     is virtual;
197
198 -- Attributes for the V Isoparametric line of patches.
199
200
201     VIsoAspect (me:mutable) returns mutable IsoAspect from Prs3d
202         ---Purpose: Defines the attributes which are used when drawing an 
203         --          V isoparametric curve of a face. Defines the number
204         --          of V isoparametric curves to be drawn for a single face.
205         --          The LineAspect for V isoparametric lines can be edited
206         --          (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
207         --          The default values are:
208         --          COLOR       : Quantity_NOC_GRAY82
209         --          TYPE OF LINE: Aspect_TOL_SOLID
210         --          WIDTH       : 0.5
211         --          
212         --         
213         --          These attributes are used by the following algorithms:
214         --          Prs3d_WFDeflectionSurface 
215         --          Prs3d_WFDeflectionRestrictedFace
216     is virtual;    
217     
218     SetVIsoAspect (me:mutable;anAspect: IsoAspect from Prs3d)
219     is virtual;
220         ---Purpose: Sets the appearance of V isoparameters - anAspect.
221
222     FreeBoundaryAspect (me:mutable) returns mutable LineAspect from Prs3d
223         ---Purpose:  Stores the values for presentation of free boundaries,
224         -- in other words, boundaries which are not shared.
225         --          The LineAspect for the  free boundaries can be edited.
226         --          The default values are:
227         --          Color: Quantity_NOC_GREEN
228         --          Type of line: Aspect_TOL_SOLID
229         --          Width: 1.
230         --          These attributes are used by the algorithm Prs3d_WFShape
231     is virtual;
232     
233     SetFreeBoundaryAspect(me:mutable;anAspect: LineAspect from Prs3d)
234     is virtual;
235         --- Purpose: Sets the parameter anAspect for the display of free boundaries.
236     
237     SetFreeBoundaryDraw (me: mutable; OnOff: Boolean from Standard)
238         ---Purpose: Sets free boundary drawing on or off by setting the
239         -- parameter OnOff to true or false.
240     
241     is virtual;
242     
243     FreeBoundaryDraw(me) returns Boolean from Standard 
244         ---Purpose: Returns True if the drawing of the shared boundaries
245         -- is disabled. True is the default setting.
246     is virtual;
247     
248
249 -- Attributes for the wires
250
251     WireAspect (me:mutable) returns mutable LineAspect from Prs3d
252         ---Purpose: Returns wire aspect settings.
253         --          The LineAspect for the wire can be edited.
254         --          The default values are:
255         --          Color: Quantity_NOC_RED
256         --          Type of line: Aspect_TOL_SOLID
257         --          Width: 1.           
258         --          These attributes are used by the algorithm Prs3d_WFShape
259     is virtual;    
260
261     SetWireAspect(me:mutable;anAspect: LineAspect from Prs3d)
262     is virtual;
263
264         --- Purpose: Sets the parameter anAspect for display of wires.
265         
266     SetWireDraw (me: mutable; OnOff: Boolean from Standard)
267         ---Purpose: Sets WireDraw on or off   by setting the parameter
268         -- OnOff to true or false.
269     
270     is virtual;
271     
272     WireDraw(me) returns Boolean from Standard 
273         ---Purpose: returns True if the drawing of the wire is enabled.
274     is virtual;
275     
276
277 -- Attributes for the unfree boundaries
278
279     UnFreeBoundaryAspect (me:mutable) returns mutable LineAspect from Prs3d
280         ---Purpose: Returns settings for shared boundary line aspects.
281         --          The LineAspect for the unfree boundaries can be edited.
282         --          The default values are:
283         --          Color: Quantity_NOC_YELLOW
284         --          Type of line: Aspect_TOL_SOLID
285         --          Width: 1.
286         --          These attributes are used by the algorithm Prs3d_WFShape
287     is virtual;
288
289     SetUnFreeBoundaryAspect(me:mutable; anAspect: LineAspect from Prs3d)
290     is virtual;
291         --- Purpose: Sets the parameter anAspect for the display of shared boundaries.   
292     SetUnFreeBoundaryDraw (me: mutable; OnOff: Boolean from Standard)
293         ---Purpose: Sets FreeBoundaryDraw on or off by setting the
294         -- parameter OnOff to true or false.
295         --          By default the unfree boundaries  are drawn.
296     
297     is virtual;
298     
299     UnFreeBoundaryDraw(me) returns Boolean from Standard 
300         ---Purpose: Returns True if the drawing of the shared boundaries is enabled.
301         -- True is the default setting.
302     is virtual;
303     
304
305 -- 
306 --  Attributes for the lines.
307 -- 
308
309     LineAspect(me:mutable) returns mutable LineAspect from Prs3d
310         ---Purpose:   Returns settings for line aspects.
311         -- These settings can be edited. The default values are:       
312         --          Color: Quantity_NOC_YELLOW
313         --          Type of line: Aspect_TOL_SOLID
314         --          Width: 1.
315         --          These attributes are used by the following algorithms:
316         --          Prs3d_Curve
317         --          Prs3d_Line
318         --          Prs3d_HLRShape
319
320     is virtual;
321     
322     SetLineAspect(me:mutable; anAspect: LineAspect from Prs3d)
323     is virtual;
324         --- Purpose: Sets the parameter anAspect for display attributes of lines.
325
326     TextAspect(me:mutable) returns mutable TextAspect from Prs3d
327         --- Purpose: Returns settings for text aspect.
328         -- These settings can be edited. The default value is:
329         -- -   Color: Quantity_NOC_YELLOW
330   
331     is virtual;
332     
333     SetTextAspect(me:mutable; anAspect: TextAspect from Prs3d)
334     is virtual;
335         --- Purpose: Sets the parameter anAspect for display attributes of text.   
336     
337     SetLineArrowDraw (me: mutable; OnOff: Boolean from Standard)
338         ---Purpose: enables the drawing of an arrow at the end of each line.
339         --          By default the arrows are not drawn.
340     
341     is virtual;
342     
343     LineArrowDraw(me) returns Boolean from Standard 
344         ---Purpose: Sets LineArrowDraw on or off by setting the
345         -- parameter OnOff to true or false.
346     is virtual;
347     
348     ArrowAspect(me:mutable) returns mutable ArrowAspect from Prs3d 
349     is virtual;
350         ---Purpose: Returns the attributes for display of arrows.    
351     
352     SetArrowAspect(me:mutable; anAspect: ArrowAspect from Prs3d)
353     is virtual ;
354         ---Purpose: Sets the parameter anAspect for display attributes of arrows.
355         
356     PointAspect(me:mutable) returns mutable PointAspect from Prs3d
357         ---Purpose: Returns the point aspect setting. The default values are
358         --        Color: Quantity_NOC_YELLOW
359         --          Type of marker: Aspect_TOM_PLUS
360         --          Scale: 1.          
361         --          These attributes are used by the algorithms Prs3d_Point.
362     is virtual;
363     
364     SetPointAspect(me:mutable; anAspect: PointAspect from Prs3d) 
365     is virtual;
366         --- Purpose: Sets the parameter anAspect for display attributes of points
367         
368     ShadingAspect (me:mutable) returns mutable ShadingAspect from Prs3d
369    is virtual;
370         ---Purpose: Returns settings for shading aspects.
371         -- These settings can be edited. The default values are:
372         -- -   Color: Quantity_NOC_YELLOW
373         -- -   Material: Graphic3d_NOM_BRASS
374         --   Shading aspect is obtained through decomposition of
375         -- 3d faces into triangles, each side of each triangle
376         -- being a chord of the corresponding curved edge in
377         -- the face. Reflection of light in each projector
378         -- perspective is then calculated for each of the
379         -- resultant triangular planes.
380     
381
382     SetShadingAspect(me:mutable; anAspect: ShadingAspect from Prs3d) 
383     is virtual;
384         ---Purpose: Sets the parameter anAspect for display attributes of shading.
385         
386     SetShadingAspectGlobal(me: mutable; aValue: Boolean from Standard) 
387         ---Purpose: indicates that the ShadingAspect will be apply
388         --          to the whole presentation. This allows to modify
389         --          the aspect without recomputing the content of the presentation.
390     is virtual;
391     
392     ShadingAspectGlobal(me) returns Boolean from Standard
393     is virtual;  
394 --
395 --  Attributes for hidden lines removal. These attributes are used when
396 --  using an algorithm such Prs3d_HLRShape for example.
397 --  
398
399     DrawHiddenLine(me) returns Boolean from Standard 
400         ---Purpose: returns Standard_True if the hidden lines are to be drawn.
401         --          By default the hidden lines are not drawn.
402     is virtual;
403     
404     EnableDrawHiddenLine(me: mutable)
405         ---Purpose: Enables the DrawHiddenLine function.
406     is virtual;
407
408     DisableDrawHiddenLine(me: mutable)
409         ---Purpose:  Disables the DrawHiddenLine function.
410     is virtual;
411
412     HiddenLineAspect(me:mutable) returns mutable LineAspect from Prs3d
413         ---Purpose: Returns settings for hidden line aspects.
414         -- These settings can be edited. The default values are:
415         --          Color: Quantity_NOC_YELLOW
416         --          Type of line: Aspect_TOL_DASH
417         --          Width: 1.
418     is virtual;
419
420     SetHiddenLineAspect(me:mutable; anAspect: LineAspect from Prs3d) 
421     is virtual;
422         ---Purpose: Sets the parameter anAspect for the display of
423         -- hidden lines in hidden line removal mode.   
424     
425     SeenLineAspect(me:mutable) returns mutable LineAspect from Prs3d
426         ---Purpose: Returns settings for seen line aspects.
427         -- These settings can be edited. The default values are:
428         --          Color: Quantity_NOC_YELLOW
429         --          Type of line: Aspect_TOL_SOLID
430         --          Width: 1.
431     is virtual;
432
433     SetSeenLineAspect(me:mutable; anAspect: LineAspect from Prs3d) 
434     is virtual;
435         --- Purpose: Sets the parameter anAspect for the display of seen
436         -- lines in hidden line removal mode.
437
438     PlaneAspect(me:mutable) returns mutable PlaneAspect from Prs3d
439     is virtual;
440         ---Purpose: Returns settings for the appearance of planes.
441     
442     SetPlaneAspect(me:mutable; anAspect: PlaneAspect from Prs3d)
443     is virtual;
444         ---Purpose: Sets the parameter anAspect for the display of planes.
445
446     VectorAspect(me:mutable) returns mutable LineAspect from Prs3d
447         ---Purpose: Returns settings for the appearance of vectors.
448         -- These settings can be edited. The default values are:
449         --          Color: Quantity_NOC_SKYBLUE
450         --          Type of line: Aspect_TOL_SOLID
451         --          Width: 1.
452     is virtual;
453
454     SetVectorAspect(me:mutable; anAspect: LineAspect from Prs3d) 
455     is virtual;
456         ---Purpose: Sets the modality anAspect for the display of vectors.    
457
458 --
459 --  Attributes for the presentation of a Datum.
460 --  
461
462     DatumAspect(me:mutable) returns mutable DatumAspect from Prs3d
463         ---Purpose: Returns settings for the appearance of datums.
464         -- These settings can be edited. The default values for
465         -- the three axes are:
466         --          Color: Quantity_NOC_PEACHPUFF
467         --          Type of line: Aspect_TOL_SOLID
468         --          Width: 1.
469     is virtual;
470
471     SetDatumAspect(me:mutable; anAspect: DatumAspect from Prs3d)
472     is virtual;
473         ---Purpose: Sets the modality anAspect for the display of datums.
474
475     DimensionAspect(me:mutable) returns mutable DimensionAspect from Prs3d
476         ---Purpose: Returns settings for the appearance of dimensions.
477     is virtual;
478
479     SetDimensionAspect(me:mutable; theAspect: DimensionAspect from Prs3d) 
480     is virtual;
481         ---Purpose: Sets the modality anAspect for display of dimensions.
482
483     SectionAspect (me:mutable) returns mutable LineAspect from Prs3d
484         ---Purpose: The LineAspect for the wire can be edited.
485         --          The default values are:
486         --          Color: Quantity_NOC_ORANGE
487         --          Type of line: Aspect_TOL_SOLID
488         --          Width: 1.
489         --          These attributes are used by the algorithm Prs3d_WFShape
490     is virtual;    
491
492     SetSectionAspect(me:mutable;anAspect: LineAspect from Prs3d)
493     is virtual;
494         ---Purpose: Sets the parameter anAspect for display attributes of sections.
495     
496     SetFaceBoundaryDraw (me           : mutable;
497                          theIsEnabled : Boolean from Standard)
498     is virtual;
499         ---Purpose: Enables or disables face boundary drawing for shading presentations.
500         -- theIsEnabled is a boolean flag indicating whether the face boundaries should be
501         -- drawn or not.
502
503     IsFaceBoundaryDraw (me) returns Boolean from Standard
504     is virtual;
505         ---Purpose: Checks whether the face boundary drawing is enabled or not.
506
507     SetFaceBoundaryAspect (me        : mutable;
508                            theAspect : LineAspect from Prs3d)
509     is virtual;
510         ---Purpose: Sets line aspect for face boundaries.
511         -- theAspect is the line aspect that determines the look of the face boundaries.
512
513     FaceBoundaryAspect (me : mutable) returns mutable LineAspect from Prs3d
514     is virtual;
515         ---Purpose: Returns line aspect of face boundaries.
516
517 fields
518             myUIsoAspect: IsoAspect from Prs3d is protected;
519             myVIsoAspect: IsoAspect from Prs3d is protected;
520             myNbPoints  : Integer   from Standard is protected;
521             myIsoOnPlane: Boolean from Standard is protected;
522             myFreeBoundaryAspect: LineAspect from Prs3d is protected;
523             myFreeBoundaryDraw: Boolean from Standard is protected;
524             myUnFreeBoundaryAspect: LineAspect from Prs3d is protected;
525             myUnFreeBoundaryDraw: Boolean from Standard is protected;
526             myWireAspect: LineAspect from Prs3d is protected;
527             myWireDraw: Boolean from Standard is protected;
528             myLineAspect: LineAspect from Prs3d is protected;
529             myTextAspect: TextAspect from Prs3d is protected;
530             myShadingAspect: ShadingAspect from Prs3d is protected;
531             myShadingAspectGlobal: Boolean from Standard is protected;
532             myChordialDeviation: Length from Quantity is protected;
533             myTypeOfDeflection: TypeOfDeflection from Aspect is protected;
534             myMaximalParameterValue: Real from Standard is protected;
535             
536             myDeviationCoefficient: Real from Standard is protected;
537             myHLRDeviationCoefficient: Real from Standard is protected;
538
539             myDeviationAngle: Real from Standard is protected;
540             myHLRAngle:       Real from Standard is protected;
541             
542             myPointAspect: PointAspect from Prs3d is protected;
543             myPlaneAspect: PlaneAspect from Prs3d is protected;
544             myArrowAspect: ArrowAspect from Prs3d is protected;
545             myLineDrawArrow: Boolean from Standard is protected;
546             myDrawHiddenLine: Boolean from Standard is protected;
547             myHiddenLineAspect: LineAspect from Prs3d is protected;
548             mySeenLineAspect: LineAspect from Prs3d is protected;
549             myVectorAspect: LineAspect from Prs3d is protected;
550             myDatumAspect: DatumAspect from Prs3d is protected;
551             myDatumScale: Real from Standard is protected;
552             myDimensionAspect: DimensionAspect from Prs3d is protected;
553       mySectionAspect: LineAspect from Prs3d is protected;
554       myFaceBoundaryDraw    : Boolean from Standard is protected;
555       myFaceBoundaryAspect  : LineAspect from Prs3d is protected;
556       myTypeOfHLR           : TypeOfHLR from Prs3d is protected;
557 end Drawer;