improved VMD class
[engrid.git] / vertexmeshdensity.cpp
blob2ec55f65cad7ebc7ca395ce50d5808287aa23279
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<<" BCmap="<<A.BCmap;
42 out<<" type="<<(int)A.type;
43 out<<" nodeset="<<A.nodeset;
44 out<<" density="<<A.density;
45 return(out);
48 ostream& operator<<(ostream &out, QVector<VertexMeshDensity> VMDvector)
50 int N=VMDvector.size();
51 out<<"Size="<<N;
52 if(N>0) out<<endl;
53 for(int i=0;i<N;i++)
55 out<<VMDvector[i];
56 if(i!=N-1) out<<endl;
58 return(out);