Added getNeighbours functions to class Operation + moved UpdateMeshDensity to class...
[engrid.git] / vertexmeshdensity.cpp
blob3e2e899244096c7959a7c70415b5df58a8c097d4
1 #include "vertexmeshdensity.h"
2 #include "egvtkobject.h"
3 #include <iostream>
4 using namespace std;
6 VertexMeshDensity::VertexMeshDensity()
11 // VertexMeshDensity::~VertexMeshDensity()
12 // {
13 // }
15 //this=user defined
16 //VMD=VMD of current node
17 //This operator is NOT SYMMETRICAL. But it can be used with indexOf.
18 bool VertexMeshDensity::operator==(const VertexMeshDensity & VMD) const
20 /* cout<<"this->nodeset="<<this->nodeset<<endl;
21 cout<<"VMD.nodeset="<<VMD.nodeset<<endl;*/
22 if(this->nodeset.contains(VMD.CurrentNode) ) return(true);
23 if(this->type==VMD.type && this->BClist==VMD.BClist) return(true);
24 else return(false);
27 void VertexMeshDensity::SetNodes(QString str)
29 QStringList L = str.split(",");
30 nodeset.clear();
31 foreach(QString elt,L) nodeset.insert(elt.toInt());
34 // QVector < QVector <int> > BClist;
35 // QVector <char> type;
36 // QVector <double> density;
38 ostream& operator<<(ostream &out, VertexMeshDensity A)
40 out<<" BClist="<<A.BClist;
41 out<<" type="<<(int)A.type;
42 out<<" nodeset="<<A.nodeset;
43 out<<" density="<<A.density;
44 return(out);
47 ostream& operator<<(ostream &out, QVector<VertexMeshDensity> VMDvector)
49 int N=VMDvector.size();
50 out<<"Size="<<N;
51 if(N>0) out<<endl;
52 for(int i=0;i<N;i++)
54 out<<VMDvector[i];
55 if(i!=N-1) out<<endl;
57 return(out);