Hi guys. I need a simple Boundary Representation class (a really simple one), which will hold a list of QVector3D's representing vertices (say list A), and a list of integer lists (say list B), which will represent the indexes in A that holds the right vertices to use. List B is just a simple representation of a volume's faces, each one being a list of vertices contained into a larger and ordered list of faces.
I'm doing this in my class:
{
Q_OBJECT
public:
typedef QList<QVector3D> VertexList;
typedef QList<int> IndexList;
class Brep : public QObject
{
Q_OBJECT
public:
typedef QList<QVector3D> VertexList;
typedef QList<int> IndexList;
To copy to clipboard, switch view to plain text mode
Later on:
private:
Brep::VertexList vert;
QList<Brep::IndexList> idx;
};
private:
Brep::VertexList vert;
QList<Brep::IndexList> idx;
};
To copy to clipboard, switch view to plain text mode
In the implementation file:
void Brep::addFace(const Brep::VertexList &vertices, const Brep::IndexList indices)
{
void Brep::addFace(const Brep::VertexList &vertices, const Brep::IndexList indices)
{
To copy to clipboard, switch view to plain text mode
...
QList<int> auxList;
for(it=indices.begin(); it!=indices.end(); it++) {
auxList = *it;
QList<int> auxList;
for(it=indices.begin(); it!=indices.end(); it++) {
auxList = *it;
To copy to clipboard, switch view to plain text mode
GCC complains:
In member function 'void Brep::addFace(const QList<QVector3D>&, QList<int>)':
../brep.cpp:47: error: no match for 'operator=' in 'it = QList<T>::begin() const [with T = int]()'
/Library/Frameworks/QtCore.framework/Headers/qlist.h:168: note: candidates are: QList<int>::iterator& QList<int>::iterator:

perator=(const QList<int>::iterator&)
I'd like to make use of the existing container classes instead of having to write a new one from scratch.
Bookmarks