0022627: Change OCCT memory management defaults
[occt.git] / src / MeshVS / MeshVS_VectorPrsBuilder.cdl
1 -- File     : MeshVS_VectorPrsBuilder.cdl
2 -- Created  : 13 October 2003
3 -- Author   : Alexander SOLOVYOV
4 ---Copyright: Open CASCADE 2003
5
6 class VectorPrsBuilder from MeshVS inherits PrsBuilder from MeshVS
7
8         ---Purpose: This class provides methods to create vector data presentation.
9         -- It store map of vectors assigned with nodes or elements.
10         -- In simplified mode vectors draws with thickened ends instead of arrows
11         
12 uses
13   Real    from Standard,
14   Boolean from Standard,
15   Integer from Standard,
16
17   Color from Quantity,
18
19   Presentation from Prs3d,
20
21   Trsf from gp,
22   Pnt  from gp,
23   Vec  from gp,
24
25   ArrayOfPrimitives from Graphic3d,
26
27   Array1OfPnt from TColgp,
28
29   Mesh                    from MeshVS,
30   MeshPtr                 from MeshVS,
31   DataSource              from MeshVS,
32   DisplayModeFlags        from MeshVS,
33   DataMapOfIntegerVector  from MeshVS,
34   BuilderPriority         from MeshVS,
35   PackedMapOfInteger      from TColStd
36
37 is
38
39   Create ( Parent       : Mesh from MeshVS;
40            MaxLength    : Real;
41            VectorColor  : Color from Quantity;
42            Flags        : DisplayModeFlags from MeshVS = MeshVS_DMF_VectorDataPrs;
43            DS           : DataSource from MeshVS = 0;
44            Id           : Integer = -1;
45            Priority     : BuilderPriority from MeshVS = MeshVS_BP_Vector;
46            IsSimplePrs  : Boolean = Standard_False ) returns mutable VectorPrsBuilder from MeshVS;
47
48   Build   ( me; Prs        : Presentation from Prs3d;
49             IDs            : PackedMapOfInteger;
50             IDsToExclude   : in out PackedMapOfInteger;
51             IsElement      : Boolean;
52             theDisplayMode : Integer ) is virtual;
53         ---Purpose: Builds vector data presentation
54
55
56   DrawVector ( me; theTrsf : Trsf from gp;
57                Length      : Real;
58                MaxLength   : Real;
59                ArrowPoints : Array1OfPnt from TColgp;
60                Lines       : ArrayOfPrimitives from Graphic3d;
61                ArrowLines  : ArrayOfPrimitives from Graphic3d;
62                Triangles   : ArrayOfPrimitives from Graphic3d );
63         ---Purpose: Adds to array of polygons and polylines some primitive representing single vector
64
65   calculateArrow ( myclass; Points  : out Array1OfPnt from TColgp;
66                    Length      : Real;
67                    ArrowPart   : Real   ) returns Real;
68         ---Purpose: Calculates points of arrow presentation
69
70   GetVectors ( me; IsElement : Boolean ) returns DataMapOfIntegerVector from MeshVS;
71         ---C++: return const &
72         ---Purpose: Returns map of vectors assigned with nodes or elements
73
74   SetVectors ( me : mutable;
75                IsElement     : Boolean;
76                Map           : DataMapOfIntegerVector from MeshVS );
77         ---Purpose: Sets map of vectors assigned with nodes or elements
78
79   HasVectors ( me; IsElement : Boolean )     returns Boolean;
80         ---Purpose: Returns true, if map isn't empty
81
82   GetVector  ( me; IsElement : Boolean;
83                ID            : Integer;
84                Vect          : out Vec from gp )     returns Boolean;
85         ---Purpose: Returns vector assigned with certain node or element
86
87   SetVector  ( me : mutable;
88                IsElement     : Boolean;
89                ID            : Integer;
90                Vect          : Vec from gp     );
91         ---Purpose: Sets vector assigned with certain node or element
92
93   GetMinMaxVectorValue ( me; IsElement : Boolean;
94                          MinValue : out Real;
95                          MaxValue : out Real );
96         ---Purpose: Calculates minimal and maximal length of vectors in map
97         -- ( nodal, if IsElement = False or elemental, if IsElement = True )
98
99   SetSimplePrsMode  ( me : mutable;
100                       IsSimpleArrow : Boolean );
101         ---Purpose: Sets flag that indicates is simple vector arrow mode uses or not
102         -- default value is False
103         
104   SetSimplePrsParams ( me : mutable;
105                        theLineWidthParam : Real;
106                        theStartParam, theEndParam : Real );
107         ---Purpose: Sets parameters of simple vector arrwo presentation
108         -- theLineWidthParam - coefficient of vector line width (to draw line instead of arrow)
109         -- theStartParam and theEndParam parameters of start and end of thickened ends
110         -- position of thickening calculates according to parameters and maximum vector length
111         -- default values are:
112         --   theLineWidthParam = 2.5
113         --   theStartParam     = 0.85
114         --   theEndParam       = 0.95
115         
116 fields
117   myIsSimplePrs         : Boolean;
118   mySimpleWidthPrm      : Real;
119   mySimpleStartPrm      : Real;
120   mySimpleEndPrm        : Real;
121   myNodeVectorMap       : DataMapOfIntegerVector from MeshVS;
122   myElemVectorMap       : DataMapOfIntegerVector from MeshVS;
123
124 end VectorPrsBuilder;