VIZ++ Class: OpenGLCylinder

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

Source code

/*
 * OpenGLCylinder.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 OpenGLCylinder :public OpenGLObject {
private:
  OpenGLQuadric* quadric; 
public:
  OpenGLCylinder(OpenGLQuadric* q)
  :OpenGLObject(),
   quadric(q)
  {
    if (q == NULL) {
      throw IException("Invalid argument");
    }
  } 

  ~OpenGLCylinder()
  {
  }
 
  void draw(GLdouble   base,  
    GLdouble   top,  
    GLdouble   height,  
    GLint   slices,  
    GLint   stacks) 
  {
    gluCylinder(quadric->getQuadric(),
                base, top, height, slices, stacks);
  }
};
}


Last modified: 10 Feb 2017

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