функция-установщик для вектора в c ++

У меня есть следующие классы:

class Vertex {

public: float X;
        float Y;
        float Z;

Vertex (float first, float second, float third){
          X=first;
          Y=second;
          Z=third;
    }

};


class Obj {


  vector<Vertex>vertexCoordinates;

  vector<vector<int>> faces;

  vector <vector<float>> faceNormals;

  vector <vector<float>> faceCenters; 

  string objName; 

  int vertexCount, faceCount, edgeCount;

  float maxX, minX, maxY, minY, maxZ, minZ, dx, dy, dz;


    setVertexCoordinates(vector <Vertex> vertexCoordinatesP) {

          vertexCoordinates = vertexCoordinatesP; //??
         // How should the assignment be defined? 

    }

};

Нужно ли мне здесь создавать конструктор копирования? Перегрузить оператор = для Vertex и Obj ?

5
задан Chris Barlow 28 February 2012 в 19:23
поделиться