b311480e |
1 | -- Created on: 2004-06-10 |
2 | -- Created by: Alexander SOLOVYOV |
973c2be1 |
3 | -- Copyright (c) 2004-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 DataSource from XSDRAWSTLVRML inherits DataSource from MeshVS |
17 | |
18 | ---Purpose: The sample DataSource for working with STLMesh_Mesh |
19 | |
20 | uses |
21 | Mesh from StlMesh, |
22 | |
23 | Integer from Standard, |
24 | Boolean from Standard, |
25 | Address from Standard, |
26 | |
27 | Array1OfReal from TColStd, |
28 | Array1OfInteger from TColStd, |
29 | SequenceOfInteger from TColStd, |
30 | PackedMapOfInteger from TColStd, |
31 | |
32 | EntityType from MeshVS, |
33 | |
34 | HArray2OfInteger from TColStd, |
35 | HArray2OfReal from TColStd |
36 | |
37 | is |
38 | |
6e33d3ce |
39 | Create ( aMesh : Mesh from StlMesh ) returns DataSource from XSDRAWSTLVRML; |
7fd59977 |
40 | ---Purpose: Constructor |
41 | |
42 | GetGeom ( me; ID : Integer; |
43 | IsElement : Boolean; |
44 | Coords : out Array1OfReal; |
45 | NbNodes : out Integer; |
46 | Type : out EntityType ) returns Boolean; |
47 | ---Purpose: Returns geometry information about node ( if IsElement is False ) or element ( IsElement is True ) |
48 | -- by co-ordinates. For element this method must return all its nodes co-ordinates in the strict order: X, Y, Z and |
49 | -- with nodes order is the same as in wire bounding the face or link. NbNodes is number of nodes of element. |
50 | -- It is recommended to return 1 for node. Type is an element type. |
51 | |
52 | GetGeomType ( me; ID : Integer; |
53 | IsElement : Boolean; |
54 | Type : out EntityType ) returns Boolean; |
55 | ---Purpose: This method is similar to GetGeom, but returns only element or node type. This method is provided for |
56 | -- a fine performance. |
57 | |
58 | GetAddr ( me; ID : Integer; |
59 | IsElement : Boolean ) returns Address; |
60 | ---Purpose: This method returns by number an address of any entity which represents element or node data structure. |
61 | |
62 | GetNodesByElement ( me; ID : Integer; |
63 | NodeIDs : out Array1OfInteger from TColStd; |
64 | NbNodes : out Integer ) returns Boolean is redefined; |
65 | ---Purpose: This method returns information about what node this element consist of. |
66 | |
67 | GetAllNodes ( me ) returns PackedMapOfInteger; |
68 | ---C++: return const & |
69 | ---Purpose: This method returns map of all nodes the object consist of. |
70 | |
71 | GetAllElements ( me ) returns PackedMapOfInteger; |
72 | ---C++: return const & |
73 | ---Purpose: This method returns map of all elements the object consist of. |
74 | |
75 | GetNormal ( me; Id : Integer; Max : Integer; |
76 | nx, ny, nz : out Real ) returns Boolean is redefined virtual; |
77 | ---Purpose: This method calculates normal of face, which is using for correct reflection presentation. |
78 | -- There is default method, for advance reflection this method can be redefined. |
79 | |
80 | fields |
81 | myMesh : Mesh from StlMesh; |
82 | myNodes : PackedMapOfInteger from TColStd; |
83 | myElements : PackedMapOfInteger from TColStd; |
84 | myElemNodes : HArray2OfInteger from TColStd; |
85 | |
86 | myNodeCoords, myElemNormals : HArray2OfReal from TColStd; |
87 | |
88 | end DataSource; |