1 -- File : MeshVS_VectorPrsBuilder.cdl
2 -- Created : 13 October 2003
3 -- Author : Alexander SOLOVYOV
4 ---Copyright: Open CASCADE 2003
6 class VectorPrsBuilder from MeshVS inherits PrsBuilder from MeshVS
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
14 Boolean from Standard,
15 Integer from Standard,
19 Presentation from Prs3d,
25 ArrayOfPrimitives from Graphic3d,
27 Array1OfPnt from TColgp,
31 DataSource from MeshVS,
32 DisplayModeFlags from MeshVS,
33 DataMapOfIntegerVector from MeshVS,
34 BuilderPriority from MeshVS,
35 PackedMapOfInteger from TColStd
39 Create ( Parent : Mesh from MeshVS;
41 VectorColor : Color from Quantity;
42 Flags : DisplayModeFlags from MeshVS = MeshVS_DMF_VectorDataPrs;
43 DS : DataSource from MeshVS = 0;
45 Priority : BuilderPriority from MeshVS = MeshVS_BP_Vector;
46 IsSimplePrs : Boolean = Standard_False ) returns mutable VectorPrsBuilder from MeshVS;
48 Build ( me; Prs : Presentation from Prs3d;
49 IDs : PackedMapOfInteger;
50 IDsToExclude : in out PackedMapOfInteger;
52 theDisplayMode : Integer ) is virtual;
53 ---Purpose: Builds vector data presentation
56 DrawVector ( me; theTrsf : Trsf from gp;
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
65 calculateArrow ( myclass; Points : out Array1OfPnt from TColgp;
67 ArrowPart : Real ) returns Real;
68 ---Purpose: Calculates points of arrow presentation
70 GetVectors ( me; IsElement : Boolean ) returns DataMapOfIntegerVector from MeshVS;
71 ---C++: return const &
72 ---Purpose: Returns map of vectors assigned with nodes or elements
74 SetVectors ( me : mutable;
76 Map : DataMapOfIntegerVector from MeshVS );
77 ---Purpose: Sets map of vectors assigned with nodes or elements
79 HasVectors ( me; IsElement : Boolean ) returns Boolean;
80 ---Purpose: Returns true, if map isn't empty
82 GetVector ( me; IsElement : Boolean;
84 Vect : out Vec from gp ) returns Boolean;
85 ---Purpose: Returns vector assigned with certain node or element
87 SetVector ( me : mutable;
91 ---Purpose: Sets vector assigned with certain node or element
93 GetMinMaxVectorValue ( me; IsElement : Boolean;
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 )
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
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
117 myIsSimplePrs : Boolean;
118 mySimpleWidthPrm : Real;
119 mySimpleStartPrm : Real;
120 mySimpleEndPrm : Real;
121 myNodeVectorMap : DataMapOfIntegerVector from MeshVS;
122 myElemVectorMap : DataMapOfIntegerVector from MeshVS;
124 end VectorPrsBuilder;