1 -- Created on: 2003-10-10
2 -- Created by: Alexander SOLOVYOV
3 -- Copyright (c) 2003-2012 OPEN CASCADE SAS
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
22 class MeshPrsBuilder from MeshVS inherits PrsBuilder from MeshVS
24 ---Purpose: This class provides methods to compute base mesh presentation
27 Integer from Standard,
28 Boolean from Standard,
30 Presentation from Prs3d,
32 PrsBuilder from MeshVS,
35 DisplayModeFlags from MeshVS,
36 DataSource from MeshVS,
37 BuilderPriority from MeshVS,
39 HArray1OfSequenceOfInteger from MeshVS,
40 MaterialAspect from Graphic3d,
41 AspectFillArea3d from Graphic3d,
42 AspectLine3d from Graphic3d,
43 AspectMarker3d from Graphic3d,
44 Array1OfReal from TColStd,
45 ArrayOfPolylines from Graphic3d,
46 ArrayOfPolygons from Graphic3d,
47 ArrayOfPrimitives from Graphic3d,
48 PackedMapOfInteger from TColStd
52 Create ( Parent : Mesh from MeshVS;
53 Flags : DisplayModeFlags from MeshVS = MeshVS_DMF_OCCMask;
54 DS : DataSource from MeshVS = 0;
56 Priority : BuilderPriority from MeshVS = MeshVS_BP_Mesh ) returns mutable MeshPrsBuilder from MeshVS;
57 ---Purpose: Creates builder with certain display mode flags, data source, ID and priority
59 Build ( me; Prs : Presentation from Prs3d;
60 IDs : PackedMapOfInteger;
61 IDsToExclude: in out PackedMapOfInteger;
63 DisplayMode : Integer ) is virtual;
64 ---Purpose: Builds base mesh presentation by calling the methods below
66 BuildNodes ( me; Prs : Presentation from Prs3d;
67 IDs : PackedMapOfInteger;
68 IDsToExclude: in out PackedMapOfInteger;
69 DisplayMode : Integer ) is virtual;
70 ---Purpose: Builds nodes presentation
72 BuildElements ( me; Prs : Presentation from Prs3d;
73 IDs : PackedMapOfInteger;
74 IDsToExclude: in out PackedMapOfInteger;
75 DisplayMode : Integer ) is virtual;
76 ---Purpose: Builds elements presentation
78 BuildHilightPrs ( me; Prs : Presentation from Prs3d;
79 IDs : PackedMapOfInteger;
82 ---Purpose: Builds presentation of hilighted entity
84 AddLinkPrs ( me; theCoords : Array1OfReal from TColStd;
85 theLines : ArrayOfPolylines from Graphic3d;
89 ---Purpose: Add to array of polylines some lines representing link
91 AddFaceWirePrs ( me; theCoords : Array1OfReal from TColStd;
93 theLines : ArrayOfPolylines from Graphic3d;
97 ---Purpose: Add to array of polylines some lines representing face's wire
99 AddFaceSolidPrs ( me; ID : Integer;
100 theCoords : Array1OfReal from TColStd;
103 thePolygons : ArrayOfPolygons from Graphic3d;
104 IsReflected : Boolean;
105 IsShrinked : Boolean;
107 IsMeshSmoothShading : Boolean
109 ---Purpose: Add to array of polygons a polygon representing face
111 AddVolumePrs ( myclass; Topo : HArray1OfSequenceOfInteger from MeshVS;
112 Nodes : Array1OfReal from TColStd;
114 Array : ArrayOfPrimitives from Graphic3d;
115 IsReflected : Boolean;
116 IsShrinked : Boolean;
119 ---Purpose: Add to array polygons or polylines representing volume
121 HowManyPrimitives( myclass; Topo : HArray1OfSequenceOfInteger from MeshVS;
122 AsPolygons : Boolean;
125 Vertices, Bounds : out Integer );
126 ---Purpose: Calculate how many polygons or polylines are necessary to draw passed topology
128 DrawArrays ( me; Prs : Presentation from Prs3d;
129 thePolygons : ArrayOfPolygons from Graphic3d;
130 theLines : ArrayOfPolylines from Graphic3d;
131 theLinkLines : ArrayOfPolylines from Graphic3d;
132 theVolumesInShad : ArrayOfPolygons from Graphic3d;
133 IsPolygonsEdgesOff : Boolean;
134 IsSelected : Boolean;
135 theFillAsp : AspectFillArea3d from Graphic3d;
136 theLineAsp : AspectLine3d from Graphic3d
138 ---Purpose: Draw array of polygons and polylines in the certain order according to transparency
140 CalculateCenter ( myclass; theCoords : Array1OfReal from TColStd;
142 xG, yG, zG : out Real ) is protected;
143 ---Purpose: Default calculation of center of face or link. This method if useful for shrink mode presentation
144 -- theCoords is array of nodes co-ordinates in the strict order X1, Y1, Z1, X2...
145 -- NbNodes is number of nodes an element consist of
146 -- xG, yG, zG are co-ordinates of center whose will be returned