1 -- Created on: 2003-10-10
2 -- Created by: Alexander SOLOVYOV
3 -- Copyright (c) 2003-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
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
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.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class MeshPrsBuilder from MeshVS inherits PrsBuilder from MeshVS
18 ---Purpose: This class provides methods to compute base mesh presentation
21 Integer from Standard,
22 Boolean from Standard,
24 Presentation from Prs3d,
26 PrsBuilder from MeshVS,
29 DisplayModeFlags from MeshVS,
30 DataSource from MeshVS,
31 BuilderPriority 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,
40 ArrayOfSegments from Graphic3d,
41 ArrayOfPolygons from Graphic3d,
42 ArrayOfPrimitives from Graphic3d,
43 ArrayOfTriangles from Graphic3d,
44 PackedMapOfInteger from TColStd
48 Create ( Parent : Mesh from MeshVS;
49 Flags : DisplayModeFlags from MeshVS = MeshVS_DMF_OCCMask;
50 DS : DataSource from MeshVS = 0;
52 Priority : BuilderPriority from MeshVS = MeshVS_BP_Mesh ) returns MeshPrsBuilder from MeshVS;
53 ---Purpose: Creates builder with certain display mode flags, data source, ID and priority
55 Build ( me; Prs : Presentation from Prs3d;
56 IDs : PackedMapOfInteger;
57 IDsToExclude: in out PackedMapOfInteger;
59 DisplayMode : Integer ) is virtual;
60 ---Purpose: Builds base mesh presentation by calling the methods below
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
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
74 BuildHilightPrs ( me; Prs : Presentation from Prs3d;
75 IDs : PackedMapOfInteger;
78 ---Purpose: Builds presentation of hilighted entity
80 AddLinkPrs ( me; theCoords : Array1OfReal from TColStd;
81 theLines : ArrayOfSegments from Graphic3d;
85 ---Purpose: Add to array of polylines some lines representing link
88 theCoords : Array1OfReal from TColStd;
90 theLines : ArrayOfSegments from Graphic3d;
91 theIsShrinked : Boolean;
92 theShrinkingCoef : Real
94 ---Purpose: Add to array of segments representing face's wire
96 AddFaceSolidPrs ( me; ID : Integer;
97 theCoords : Array1OfReal from TColStd;
99 theMaxNodes : Integer;
100 theTriangles : ArrayOfTriangles from Graphic3d;
101 theIsReflected : Boolean;
102 theIsShrinked : Boolean;
103 theShrinkCoef : Real;
104 theIsMeshSmoothShading : Boolean
106 ---Purpose: Add to array of polygons a polygon representing face
108 AddVolumePrs ( myclass; Topo : HArray1OfSequenceOfInteger from MeshVS;
109 Nodes : Array1OfReal from TColStd;
111 Array : ArrayOfPrimitives from Graphic3d;
112 IsReflected : Boolean;
113 IsShrinked : Boolean;
116 ---Purpose: Add to array polygons or polylines representing volume
118 HowManyPrimitives( myclass; Topo : HArray1OfSequenceOfInteger from MeshVS;
119 AsPolygons : Boolean;
122 Vertices, Bounds : out Integer );
123 ---Purpose: Calculate how many polygons or polylines are necessary to draw passed topology
125 DrawArrays ( me; Prs : Presentation from Prs3d;
126 thePolygons : ArrayOfPrimitives from Graphic3d;
127 theLines : ArrayOfPrimitives from Graphic3d;
128 theLinkLines : ArrayOfPrimitives from Graphic3d;
129 theVolumesInShad : ArrayOfPrimitives from Graphic3d;
130 IsPolygonsEdgesOff : Boolean;
131 IsSelected : Boolean;
132 theFillAsp : AspectFillArea3d from Graphic3d;
133 theLineAsp : AspectLine3d from Graphic3d
135 ---Purpose: Draw array of polygons and polylines in the certain order according to transparency
137 CalculateCenter ( myclass; theCoords : Array1OfReal from TColStd;
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