1 #include "vertexmeshdensity.h"
2 #include "egvtkobject.h"
6 VertexMeshDensity::VertexMeshDensity()
11 // VertexMeshDensity::~VertexMeshDensity()
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;*/
23 if(this->nodeset
.size()>0) //node ID mode
25 if(this->nodeset
.contains(VMD
.CurrentNode
) ) return(true);//node ID given, we're done
28 else //node properties mode
30 if(this->type
!=VMD
.type
&& this->type
!=-1) return(false);
32 QMapIterator
<int, int> i(this->BCmap
);
35 // cout << i.key() << ": " << i.value() << endl;
37 if((this->BCmap
)[index
]!=VMD
.BCmap
[index
] && (this->BCmap
)[index
]!=1) return(false);
44 //converts string to nodeset
45 void VertexMeshDensity::SetNodes(QString str
)
47 nodeset
.clear();//empty by default
48 cout
<<"str.size="<<str
.size()<<endl
;
51 QStringList L
= str
.split(",");
52 foreach(QString elt
,L
) nodeset
.insert(elt
.toInt());
56 // QVector < QVector <int> > BClist;
57 // QVector <char> type;
58 // QVector <double> density;
60 ostream
& operator<<(ostream
&out
, VertexMeshDensity A
)
62 out
<<" BClist="<<A
.BClist
;
63 out
<<" BCmap="<<A
.BCmap
;
64 out
<<" type="<<(int)A
.type
;
65 out
<<" nodeset="<<A
.nodeset
;
66 out
<<" density="<<A
.density
;
70 ostream
& operator<<(ostream
&out
, QVector
<VertexMeshDensity
> VMDvector
)
72 int N
=VMDvector
.size();