VIZ++ Class: OpenGLQuadric

 VIZ++ Class Library  VIZ++ Samples  VIZ++ ClassTree 

Source code

/*
 * OpenGLQuadric.h 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#include <viz++/Exception.h>
//#include <viz++/ArrayT.h>
#include <viz++/opengl/OpenGLObject.h>
#include <math.h>

namespace VIZ {


class OpenGLQuadric :public OpenGLObject {
private:
  GLUquadric* quadric;
 
public:
  OpenGLQuadric()
  :OpenGLObject(),
  quadric(NULL)
  {
    quadric = gluNewQuadric();
  } 

  ~OpenGLQuadric()
  {
    gluDeleteQuadric(quadric);
  }
 
  //2016/08/01
  operator   GLUquadric*()
  {
    return quadric;
  }
  
  GLUquadric* getQuadric()
  {
     return quadric;
  }

  void orientation(GLenum orientation)
  {
    //orientation will take GLU_OUTSIDE, and GLU_INSIDE
    gluQuadricOrientation(quadric, orientation);
  }

  void texture(GLboolean texture)
  {
    gluQuadricTexture(quadric, texture);
  }

  void drawStyle(GLenum style)
  {
    //style will take GLU_FILL, GLU_LINE, GLU_SILHOUETTE, and GLU_POINT. 
    gluQuadricDrawStyle(quadric, style);
  }

  void normals(GLenum normal)
  {
    //normal will take GLU_NONE, GLU_FLAT, and GLU_SMOOTH
    gluQuadricNormals(quadric, normal);
  }
};

}


Last modified: 10 Feb 2017

Copyright (c) 2009-2017 Antillia.com ALL RIGHTS RESERVED.