b311480e |
1 | -- Created on: 2003-10-13 |
2 | -- Created by: Alexander SOLOVYOV |
973c2be1 |
3 | -- Copyright (c) 2003-2014 OPEN CASCADE SAS |
b311480e |
4 | -- |
973c2be1 |
5 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
6 | -- |
d5f74e42 |
7 | -- This library is free software; you can redistribute it and/or modify it under |
8 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | -- by the Free Software Foundation, with special exception defined in the file |
10 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | -- |
973c2be1 |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | class VectorPrsBuilder from MeshVS inherits PrsBuilder from MeshVS |
17 | |
18 | ---Purpose: This class provides methods to create vector data presentation. |
19 | -- It store map of vectors assigned with nodes or elements. |
20 | -- In simplified mode vectors draws with thickened ends instead of arrows |
21 | |
22 | uses |
23 | Real from Standard, |
24 | Boolean from Standard, |
25 | Integer from Standard, |
26 | |
27 | Color from Quantity, |
28 | |
29 | Presentation from Prs3d, |
30 | |
31 | Trsf from gp, |
32 | Pnt from gp, |
33 | Vec from gp, |
34 | |
35 | ArrayOfPrimitives from Graphic3d, |
36 | |
37 | Array1OfPnt from TColgp, |
38 | |
39 | Mesh from MeshVS, |
40 | MeshPtr from MeshVS, |
41 | DataSource from MeshVS, |
42 | DisplayModeFlags from MeshVS, |
43 | DataMapOfIntegerVector from MeshVS, |
44 | BuilderPriority from MeshVS, |
45 | PackedMapOfInteger from TColStd |
46 | |
47 | is |
48 | |
49 | Create ( Parent : Mesh from MeshVS; |
50 | MaxLength : Real; |
51 | VectorColor : Color from Quantity; |
52 | Flags : DisplayModeFlags from MeshVS = MeshVS_DMF_VectorDataPrs; |
53 | DS : DataSource from MeshVS = 0; |
54 | Id : Integer = -1; |
55 | Priority : BuilderPriority from MeshVS = MeshVS_BP_Vector; |
6e33d3ce |
56 | IsSimplePrs : Boolean = Standard_False ) returns VectorPrsBuilder from MeshVS; |
7fd59977 |
57 | |
58 | Build ( me; Prs : Presentation from Prs3d; |
59 | IDs : PackedMapOfInteger; |
60 | IDsToExclude : in out PackedMapOfInteger; |
61 | IsElement : Boolean; |
62 | theDisplayMode : Integer ) is virtual; |
63 | ---Purpose: Builds vector data presentation |
64 | |
65 | |
66 | DrawVector ( me; theTrsf : Trsf from gp; |
67 | Length : Real; |
68 | MaxLength : Real; |
69 | ArrowPoints : Array1OfPnt from TColgp; |
70 | Lines : ArrayOfPrimitives from Graphic3d; |
71 | ArrowLines : ArrayOfPrimitives from Graphic3d; |
72 | Triangles : ArrayOfPrimitives from Graphic3d ); |
73 | ---Purpose: Adds to array of polygons and polylines some primitive representing single vector |
74 | |
75 | calculateArrow ( myclass; Points : out Array1OfPnt from TColgp; |
76 | Length : Real; |
77 | ArrowPart : Real ) returns Real; |
78 | ---Purpose: Calculates points of arrow presentation |
79 | |
80 | GetVectors ( me; IsElement : Boolean ) returns DataMapOfIntegerVector from MeshVS; |
81 | ---C++: return const & |
82 | ---Purpose: Returns map of vectors assigned with nodes or elements |
83 | |
84 | SetVectors ( me : mutable; |
85 | IsElement : Boolean; |
86 | Map : DataMapOfIntegerVector from MeshVS ); |
87 | ---Purpose: Sets map of vectors assigned with nodes or elements |
88 | |
89 | HasVectors ( me; IsElement : Boolean ) returns Boolean; |
90 | ---Purpose: Returns true, if map isn't empty |
91 | |
92 | GetVector ( me; IsElement : Boolean; |
93 | ID : Integer; |
94 | Vect : out Vec from gp ) returns Boolean; |
95 | ---Purpose: Returns vector assigned with certain node or element |
96 | |
97 | SetVector ( me : mutable; |
98 | IsElement : Boolean; |
99 | ID : Integer; |
100 | Vect : Vec from gp ); |
101 | ---Purpose: Sets vector assigned with certain node or element |
102 | |
103 | GetMinMaxVectorValue ( me; IsElement : Boolean; |
104 | MinValue : out Real; |
105 | MaxValue : out Real ); |
106 | ---Purpose: Calculates minimal and maximal length of vectors in map |
107 | -- ( nodal, if IsElement = False or elemental, if IsElement = True ) |
108 | |
109 | SetSimplePrsMode ( me : mutable; |
110 | IsSimpleArrow : Boolean ); |
111 | ---Purpose: Sets flag that indicates is simple vector arrow mode uses or not |
112 | -- default value is False |
113 | |
114 | SetSimplePrsParams ( me : mutable; |
115 | theLineWidthParam : Real; |
116 | theStartParam, theEndParam : Real ); |
117 | ---Purpose: Sets parameters of simple vector arrwo presentation |
118 | -- theLineWidthParam - coefficient of vector line width (to draw line instead of arrow) |
119 | -- theStartParam and theEndParam parameters of start and end of thickened ends |
120 | -- position of thickening calculates according to parameters and maximum vector length |
121 | -- default values are: |
122 | -- theLineWidthParam = 2.5 |
123 | -- theStartParam = 0.85 |
124 | -- theEndParam = 0.95 |
125 | |
126 | fields |
127 | myIsSimplePrs : Boolean; |
128 | mySimpleWidthPrm : Real; |
129 | mySimpleStartPrm : Real; |
130 | mySimpleEndPrm : Real; |
131 | myNodeVectorMap : DataMapOfIntegerVector from MeshVS; |
132 | myElemVectorMap : DataMapOfIntegerVector from MeshVS; |
133 | |
134 | end VectorPrsBuilder; |