VIZ++ Class: OpenGLSphere

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

Source code

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


#pragma once

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

namespace VIZ {

class OpenGLSphere :public OpenGLObject {
private:
  OpenGLQuadric* quadric;

public:
  OpenGLSphere(OpenGLQuadric* q)
  :OpenGLObject(),
   quadric(q)
  {
    if (q == NULL) {
      throw IException("Invalid argument");
    } 
  } 

  ~OpenGLSphere()
  {
  }
 
  void draw(GLdouble radius,
                        GLint slices,
                        GLint stacks)
  {
    gluSphere(quadric->getQuadric(),
                        radius,
                        slices,
                        stacks);
  }
};

}


Last modified: 10 Feb 2017

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