/****************************************************************************
** GMAF - The Geometry Modeling Algorithms Framework
**
** Created : 07132000
**
** Copyright (C) 2000 by Le-Jeng Shiue.  All rights reserved.
**
****************************************************************************/
#ifndef gmafPCCMVisualObject_H
#define gmafPCCMVisualObject_H

#include <vector>

#ifdef _MAM_VERSION
#include <vrs/vrs.h>
#include <mam/mam.h>
#endif _MAM_VERSION

#ifdef _OGL_VERSION
#include <GL/glut.h>
#endif _OGL_VERSION

#include "gmafConfig.h"
#include "Algorithm/gmafVisualObject.h"

class gmafPCCMQuadMap;
class gmafPCCMQuad;
/**
  gmafPCCMVisualObject
*/
class gmafPCCMVisualObject : public gmafVisualObject {
// ENUMS
public:

// VARIABLES
/**@name Class Variables */
//@{
protected:
  gmafPCCMQuadMap* mpPCCMQuadMap;

  vector<gmafPCCMQuad* > mPCCMQuadList;
private:
  int mOrder;
  int mVPoints;
  int mUPoints;

  float mSamplingTolerance;
  DOUBLE* mpKnots;
//@}

// METHODS
/**@name Class Methods */
//@{
public:
  /**
     Constructor of gmafPCCMVisualObject.
  */   
  gmafPCCMVisualObject(gmafPCCMQuadMap* pccmqm);
  /**
     Destructor of gmafPCCMVisualObject.
  */    
  virtual ~gmafPCCMVisualObject();

#ifdef _MAM_VERSION
public:
  virtual MThing* createMAMObject();

protected:
  RSharedObj* visualizeQuadMap();
  inline RSharedObj* visualizeQuad(gmafPCCMQuad* quad);
  RSharedObj* visualizeQuad(gmafPCCMQuad* quad, int style);

private:
#endif _MAM_VERSION

#ifdef _OGL_VERSION
public:
  virtual void display();
protected:
  void visualizeQuadMap();
  inline void visualizeQuad(gmafPCCMQuad* quad, GLUnurbsObj* pNURBS);
#endif _OGL_VERSION

private:
  void createKnots(int n);

};

#endif gmafPCCMVisualObject_H

