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