Skip to content

Commit 92046b0

Browse files
committed
Fix MeshDS compilatin issues
1 parent ede2d26 commit 92046b0

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/MeshDataSource/MeshDataSource.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
IMPLEMENT_STANDARD_RTTIEXT(MeshDS_DataSource, MeshVS_DataSource)
55

6-
MeshDS_DataSource::MeshDS_DataSource(std::vector<gp_Pnt>& CoordData, std::vector<std::vector<int>>& Ele2NodeData)
6+
MeshDS_DataSource::MeshDS_DataSource(const std::vector<gp_Pnt>& CoordData, const std::vector<std::vector<int>>& Ele2NodeData)
77
{
88
InitializeFromData(CoordData, Ele2NodeData);
99
}
@@ -69,7 +69,7 @@ MeshDS_DataSource::MeshDS_DataSource(const Handle(Poly_Triangulation)& polyTri)
6969
// Purpose :
7070
//================================================================
7171
void MeshDS_DataSource::SetElemNormals
72-
(std::vector<gp_Vec>& ElemNormalsData)
72+
(const std::vector<gp_Vec>& ElemNormalsData)
7373
{
7474
for (size_t ElementId = 1; ElementId <= ElemNormalsData.size(); ElementId++)
7575
{
@@ -84,7 +84,7 @@ void MeshDS_DataSource::SetElemNormals
8484
// Purpose :
8585
//================================================================
8686
void MeshDS_DataSource::SetNodeNormals
87-
(std::vector<std::vector<gp_Vec>>& NodeNormalsData)
87+
(const std::vector<std::vector<gp_Vec>>& NodeNormalsData)
8888
{
8989
for (size_t ElementId = 1; ElementId <= myElemNodes->NbRows(); ElementId++)
9090
{
@@ -250,7 +250,7 @@ Standard_Boolean MeshDS_DataSource::GetNodeNormal
250250
// Purpose :
251251
//================================================================
252252
void MeshDS_DataSource::InitializeFromData
253-
(std::vector<gp_Pnt>& CoordData, std::vector<std::vector<int>>& Ele2NodeData)
253+
(const std::vector<gp_Pnt>& CoordData, const std::vector<std::vector<int>>& Ele2NodeData)
254254
{
255255
//initialize arrays
256256
myNodeCoords = new TColStd_HArray2OfReal(1, CoordData.size(), 1, 3);

src/MeshDataSource/MeshDataSource.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class MeshDS_DataSource : public MeshVS_DataSource
4141
//! Initialize data source with vector of nodes and vector of elements (triangles or quadrangles)
4242
//! Face normals are calculated using the three first nodes of each element
4343
//! Node normals are calculated averaging the normals of the neighboring elements
44-
MeshDS_DataSource(std::vector<gp_Pnt>& CoordData, std::vector<std::vector<int>>& Ele2NodeData);
44+
MeshDS_DataSource(const std::vector<gp_Pnt>& CoordData, const std::vector<std::vector<int>>& Ele2NodeData);
4545

4646
MeshDS_DataSource(double* Vertices, int nVerts1, int nVerts2, int* Faces, int nFaces1, int nFaces2);
4747

@@ -51,10 +51,10 @@ class MeshDS_DataSource : public MeshVS_DataSource
5151
MeshDS_DataSource(const Handle(Poly_Triangulation)& polyTri);
5252

5353
//! This method define the normal of the face for each element
54-
void SetElemNormals(std::vector<gp_Vec>& ElemNormalsData);
54+
void SetElemNormals(const std::vector<gp_Vec>& ElemNormalsData);
5555

5656
//! This method define the normal of all nodes for each element
57-
void SetNodeNormals(std::vector<std::vector<gp_Vec>>& NodeNormalsData);
57+
void SetNodeNormals(const std::vector<std::vector<gp_Vec>>& NodeNormalsData);
5858

5959
//! Returns geometry information about node ( if IsElement is False ) or element ( IsElement is True )
6060
//! by co-ordinates. For element this method must return all its nodes co-ordinates in the strict order: X, Y, Z and
@@ -98,7 +98,7 @@ class MeshDS_DataSource : public MeshVS_DataSource
9898
Handle(TColStd_HArray2OfReal) myNodeCoords;
9999
Handle(TColStd_HArray2OfReal) myElemNormals;
100100
Handle(TColStd_HArray2OfReal) myNodeNormals;
101-
void InitializeFromData(std::vector<gp_Pnt>& CoordData, std::vector<std::vector<int>>& Ele2NodeData);
101+
void InitializeFromData(const std::vector<gp_Pnt>& CoordData, const std::vector<std::vector<int>>& Ele2NodeData);
102102
void InitializeFromData(double* Vertices, const int nVerts1, const int nVerts2, int* Faces, const int nFaces1, const int nFaces2);
103103
};
104104

src/SWIG_files/wrapper/MeshDS.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ from OCC.Core.Exception import *
9494

9595
class MeshDS_DataSource : public MeshVS_DataSource {
9696
public:
97-
MeshDS_DataSource(std::vector<gp_Pnt> CoordData, std::vector<std::vector<int>> Ele2NodeData);
97+
MeshDS_DataSource(const std::vector<gp_Pnt> CoordData, const std::vector<std::vector<int>> Ele2NodeData);
9898
MeshDS_DataSource(double* Vertices, int nVerts1, int nVerts2, int* Faces, int nFaces1, int nFaces2);
9999
MeshDS_DataSource(const opencascade::handle<Poly_Triangulation> & polyTri);
100-
void SetElemNormals(std::vector<gp_Vec> ElemNormalsData);
101-
void SetNodeNormals(std::vector<std::vector<gp_Vec>> NodeNormalsData);
100+
void SetElemNormals(const std::vector<gp_Vec> ElemNormalsData);
101+
void SetNodeNormals(const std::vector<std::vector<gp_Vec>> NodeNormalsData);
102102
Standard_Boolean GetGeom(Standard_Integer ID, Standard_Boolean IsElement, TColStd_Array1OfReal& Coords, Standard_Integer &OutValue, MeshVS_EntityType& Type);
103103
Standard_Boolean GetGeomType(Standard_Integer ID, Standard_Boolean IsElement, MeshVS_EntityType& Type);
104104
Standard_Address GetAddr(Standard_Integer ID, Standard_Boolean IsElement);

0 commit comments

Comments
 (0)