1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#ifndef VISUAL_RING_H
#define VISUAL_RING_H
// Copyright (c) 2000, 2001, 2002, 2003 by David Scherer and others.
// See the file license.txt for complete license terms.
// See the file authors.txt for a complete list of contributors.
#include "prim.h"
namespace visual {
class ring : public Primitive
{
private:
double radius, thickness;
public:
inline ring() : radius(1.0), thickness(0) {}
ring( const ring& other)
: Primitive( other), radius( other.radius), thickness( other.thickness)
{}
inline double get_radius()
{ return radius; }
inline void set_radius( double r)
{ write_lock L(mtx); radius = r; }
inline double get_thickness()
{
if (thickness)
return thickness;
else
return radius * 0.1;
}
inline void
set_thickness( double r)
{ write_lock L(mtx); thickness = r; }
virtual vector getScale();
virtual void glRender( rView& view);
};
} // !namespace visual
#endif // !VISUAL_RING_H
|