summaryrefslogtreecommitdiff
path: root/inc/XSDRAWSTLVRML_DataSource.hxx
blob: 3035b286752752b9f093c2eb0fdd402efa29501f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _XSDRAWSTLVRML_DataSource_HeaderFile
#define _XSDRAWSTLVRML_DataSource_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_XSDRAWSTLVRML_DataSource_HeaderFile
#include <Handle_XSDRAWSTLVRML_DataSource.hxx>
#endif

#ifndef _Handle_StlMesh_Mesh_HeaderFile
#include <Handle_StlMesh_Mesh.hxx>
#endif
#ifndef _TColStd_PackedMapOfInteger_HeaderFile
#include <TColStd_PackedMapOfInteger.hxx>
#endif
#ifndef _Handle_TColStd_HArray2OfInteger_HeaderFile
#include <Handle_TColStd_HArray2OfInteger.hxx>
#endif
#ifndef _Handle_TColStd_HArray2OfReal_HeaderFile
#include <Handle_TColStd_HArray2OfReal.hxx>
#endif
#ifndef _MeshVS_DataSource_HeaderFile
#include <MeshVS_DataSource.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _MeshVS_EntityType_HeaderFile
#include <MeshVS_EntityType.hxx>
#endif
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class StlMesh_Mesh;
class TColStd_HArray2OfInteger;
class TColStd_HArray2OfReal;
class TColStd_Array1OfReal;
class TColStd_Array1OfInteger;


//! The sample DataSource for working with STLMesh_Mesh <br>
class XSDRAWSTLVRML_DataSource : public MeshVS_DataSource {

public:

  //! Constructor <br>
  Standard_EXPORT   XSDRAWSTLVRML_DataSource(const Handle(StlMesh_Mesh)& aMesh);
  //! Returns geometry information about node ( if IsElement is False ) or element ( IsElement is True ) <br>
//! by co-ordinates. For element this method must return all its nodes co-ordinates in the strict order: X, Y, Z and <br>
//! with nodes order is the same as in wire bounding the face or link. NbNodes is number of nodes of element. <br>
//! It is recommended to return 1 for node. Type is an element type. <br>
  Standard_EXPORT     Standard_Boolean GetGeom(const Standard_Integer ID,const Standard_Boolean IsElement,TColStd_Array1OfReal& Coords,Standard_Integer& NbNodes,MeshVS_EntityType& Type) const;
  //! This method is similar to GetGeom, but returns only element or node type. This method is provided for <br>
//! a fine performance. <br>
  Standard_EXPORT     Standard_Boolean GetGeomType(const Standard_Integer ID,const Standard_Boolean IsElement,MeshVS_EntityType& Type) const;
  //! This method returns by number an address of any entity which represents element or node data structure. <br>
  Standard_EXPORT     Standard_Address GetAddr(const Standard_Integer ID,const Standard_Boolean IsElement) const;
  //! This method returns information about what node this element consist of. <br>
  Standard_EXPORT   virtual  Standard_Boolean GetNodesByElement(const Standard_Integer ID,TColStd_Array1OfInteger& NodeIDs,Standard_Integer& NbNodes) const;
  //! This method returns map of all nodes the object consist of. <br>
  Standard_EXPORT    const TColStd_PackedMapOfInteger& GetAllNodes() const;
  //! This method returns map of all elements the object consist of. <br>
  Standard_EXPORT    const TColStd_PackedMapOfInteger& GetAllElements() const;
  //! This method calculates normal of face, which is using for correct reflection presentation. <br>
//!   There is default method, for advance reflection this method can be redefined. <br>
  Standard_EXPORT   virtual  Standard_Boolean GetNormal(const Standard_Integer Id,const Standard_Integer Max,Standard_Real& nx,Standard_Real& ny,Standard_Real& nz) const;




  DEFINE_STANDARD_RTTI(XSDRAWSTLVRML_DataSource)

protected:




private: 


Handle_StlMesh_Mesh myMesh;
TColStd_PackedMapOfInteger myNodes;
TColStd_PackedMapOfInteger myElements;
Handle_TColStd_HArray2OfInteger myElemNodes;
Handle_TColStd_HArray2OfReal myNodeCoords;
Handle_TColStd_HArray2OfReal myElemNormals;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif