b311480e |
1 | -- Created on: 2003-10-10 |
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 MeshPrsBuilder from MeshVS inherits PrsBuilder from MeshVS |
17 | |
18 | ---Purpose: This class provides methods to compute base mesh presentation |
19 | |
20 | uses |
21 | Integer from Standard, |
22 | Boolean from Standard, |
23 | |
24 | Presentation from Prs3d, |
25 | |
26 | PrsBuilder from MeshVS, |
27 | Mesh from MeshVS, |
28 | MeshPtr from MeshVS, |
29 | DisplayModeFlags from MeshVS, |
30 | DataSource from MeshVS, |
31 | BuilderPriority from MeshVS, |
32 | Drawer from MeshVS, |
33 | HArray1OfSequenceOfInteger from MeshVS, |
34 | MaterialAspect from Graphic3d, |
35 | AspectFillArea3d from Graphic3d, |
36 | AspectLine3d from Graphic3d, |
37 | AspectMarker3d from Graphic3d, |
38 | Array1OfReal from TColStd, |
39 | ArrayOfPolylines from Graphic3d, |
37ac4a67 |
40 | ArrayOfSegments from Graphic3d, |
7fd59977 |
41 | ArrayOfPolygons from Graphic3d, |
42 | ArrayOfPrimitives from Graphic3d, |
37ac4a67 |
43 | ArrayOfTriangles from Graphic3d, |
7fd59977 |
44 | PackedMapOfInteger from TColStd |
45 | |
46 | is |
47 | |
48 | Create ( Parent : Mesh from MeshVS; |
49 | Flags : DisplayModeFlags from MeshVS = MeshVS_DMF_OCCMask; |
50 | DS : DataSource from MeshVS = 0; |
51 | Id : Integer = -1; |
6e33d3ce |
52 | Priority : BuilderPriority from MeshVS = MeshVS_BP_Mesh ) returns MeshPrsBuilder from MeshVS; |
7fd59977 |
53 | ---Purpose: Creates builder with certain display mode flags, data source, ID and priority |
54 | |
55 | Build ( me; Prs : Presentation from Prs3d; |
56 | IDs : PackedMapOfInteger; |
57 | IDsToExclude: in out PackedMapOfInteger; |
58 | IsElement : Boolean; |
59 | DisplayMode : Integer ) is virtual; |
60 | ---Purpose: Builds base mesh presentation by calling the methods below |
61 | |
62 | BuildNodes ( me; Prs : Presentation from Prs3d; |
63 | IDs : PackedMapOfInteger; |
64 | IDsToExclude: in out PackedMapOfInteger; |
65 | DisplayMode : Integer ) is virtual; |
66 | ---Purpose: Builds nodes presentation |
67 | |
68 | BuildElements ( me; Prs : Presentation from Prs3d; |
69 | IDs : PackedMapOfInteger; |
70 | IDsToExclude: in out PackedMapOfInteger; |
71 | DisplayMode : Integer ) is virtual; |
72 | ---Purpose: Builds elements presentation |
73 | |
74 | BuildHilightPrs ( me; Prs : Presentation from Prs3d; |
75 | IDs : PackedMapOfInteger; |
76 | IsElement : Boolean |
77 | ) is virtual; |
78 | ---Purpose: Builds presentation of hilighted entity |
79 | |
80 | AddLinkPrs ( me; theCoords : Array1OfReal from TColStd; |
37ac4a67 |
81 | theLines : ArrayOfSegments from Graphic3d; |
7fd59977 |
82 | IsShrinked : Boolean; |
83 | ShrinkCoef : Real |
84 | ) is protected; |
85 | ---Purpose: Add to array of polylines some lines representing link |
86 | |
37ac4a67 |
87 | AddFaceWirePrs ( me; |
88 | theCoords : Array1OfReal from TColStd; |
89 | theNbNodes : Integer; |
90 | theLines : ArrayOfSegments from Graphic3d; |
91 | theIsShrinked : Boolean; |
92 | theShrinkingCoef : Real |
7fd59977 |
93 | ) is protected; |
37ac4a67 |
94 | ---Purpose: Add to array of segments representing face's wire |
95 | |
96 | AddFaceSolidPrs ( me; ID : Integer; |
97 | theCoords : Array1OfReal from TColStd; |
98 | theNbNodes : Integer; |
99 | theMaxNodes : Integer; |
100 | theTriangles : ArrayOfTriangles from Graphic3d; |
101 | theIsReflected : Boolean; |
102 | theIsShrinked : Boolean; |
103 | theShrinkCoef : Real; |
104 | theIsMeshSmoothShading : Boolean |
7fd59977 |
105 | ) is protected; |
106 | ---Purpose: Add to array of polygons a polygon representing face |
107 | |
108 | AddVolumePrs ( myclass; Topo : HArray1OfSequenceOfInteger from MeshVS; |
109 | Nodes : Array1OfReal from TColStd; |
110 | NbNodes : Integer; |
111 | Array : ArrayOfPrimitives from Graphic3d; |
112 | IsReflected : Boolean; |
113 | IsShrinked : Boolean; |
114 | IsSelect : Boolean; |
115 | ShrinkCoef : Real ); |
116 | ---Purpose: Add to array polygons or polylines representing volume |
117 | |
118 | HowManyPrimitives( myclass; Topo : HArray1OfSequenceOfInteger from MeshVS; |
119 | AsPolygons : Boolean; |
120 | IsSelect : Boolean; |
121 | NbNodes : Integer; |
122 | Vertices, Bounds : out Integer ); |
123 | ---Purpose: Calculate how many polygons or polylines are necessary to draw passed topology |
124 | |
125 | DrawArrays ( me; Prs : Presentation from Prs3d; |
37ac4a67 |
126 | thePolygons : ArrayOfPrimitives from Graphic3d; |
127 | theLines : ArrayOfPrimitives from Graphic3d; |
128 | theLinkLines : ArrayOfPrimitives from Graphic3d; |
129 | theVolumesInShad : ArrayOfPrimitives from Graphic3d; |
7fd59977 |
130 | IsPolygonsEdgesOff : Boolean; |
131 | IsSelected : Boolean; |
132 | theFillAsp : AspectFillArea3d from Graphic3d; |
133 | theLineAsp : AspectLine3d from Graphic3d |
134 | ) is protected; |
135 | ---Purpose: Draw array of polygons and polylines in the certain order according to transparency |
136 | |
137 | CalculateCenter ( myclass; theCoords : Array1OfReal from TColStd; |
138 | NbNodes : Integer; |
139 | xG, yG, zG : out Real ) is protected; |
140 | ---Purpose: Default calculation of center of face or link. This method if useful for shrink mode presentation |
141 | -- theCoords is array of nodes co-ordinates in the strict order X1, Y1, Z1, X2... |
142 | -- NbNodes is number of nodes an element consist of |
143 | -- xG, yG, zG are co-ordinates of center whose will be returned |
144 | |
145 | end MeshPrsBuilder; |