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