/****************************************************************************
** GMAF - The Geometry Modeling Algorithms Framework
**
** Created : 04042000
**
** Copyright (C) 2000 by Le-Jeng Shiue.  All rights reserved.
**
****************************************************************************/
#include <assert.h>
#include <iostream>
#include <vector>

#include "gmafConfig.h"

#include "Algorithm/CCSubdivision/gmafQuad.h"
#include "Algorithm/CCSubdivision/gmafQuadMap.h"
#include "gmafPCCMQuad.h"
#include "gmafPCCMQuadMap.h"

gmafPCCMQuadMap::gmafPCCMQuadMap(gmafQuadMap* qm) 
  : gmafDataStructure("PCCMQuadMap"), mpQuadMap(qm) {
  gmafPCCMQuad* pccmq;
  vector<gmafQuad*>& quadlist = mpQuadMap->getQuadList();
  vector<gmafQuad*>::iterator qitr = quadlist.begin();
  for (; qitr != quadlist.end(); qitr++) {
    pccmq = new gmafPCCMQuad(*qitr);
    mPCCMQuadList.push_back(pccmq);
  }

  mValid = true;
}


gmafPCCMQuadMap::~gmafPCCMQuadMap() {
  vector<gmafPCCMQuad*>::iterator pccmqitr = mPCCMQuadList.begin();
  for (; pccmqitr != mPCCMQuadList.end(); pccmqitr++)
    delete (*pccmqitr);
}
