24 this->operator =(cylinder);
30 height = cylinder.height;
31 topRadius = cylinder.topRadius;
32 btRadius = cylinder.btRadius;
33 sidesVisible = cylinder.sidesVisible;
34 topVisible = cylinder.topVisible;
35 bottomVisible = cylinder.bottomVisible;
36 material = cylinder.material;
48 topRadius = btRadius = fRad;
49 sidesVisible = topVisible = bottomVisible =
true;
58 topRadius = btRadius = fRad;
68 float maxRadius = (topRadius > btRadius)? topRadius : btRadius;
69 bBox.SetBoundingBox(-maxRadius, -maxRadius, 0, maxRadius, maxRadius, height);
74 float maxRadius = (topRadius > btRadius)? topRadius : btRadius;
76 bBox.SetBoundingBox(-maxRadius, -maxRadius, 0, maxRadius, maxRadius, h);
77 ComputeRecursiveBoundingBox();
82 topRadius = btRadius = r;
83 bBox.SetBoundingBox(-r, -r, 0, r, r, height);
84 ComputeRecursiveBoundingBox();
89 bottomVisible =
static_cast<bool>(parts & BOTTOM);
90 sidesVisible =
static_cast<bool>(parts & SIDES);
91 topVisible =
static_cast<bool>(parts & TOP);
96 if (parts & BOTTOM) bottomVisible = !bottomVisible;
97 if (parts & SIDES) sidesVisible = !sidesVisible;
98 if (parts & TOP) topVisible = !topVisible;
104 if (bottomVisible) result = result & BOTTOM;
105 if (sidesVisible) result = result & SIDES;
106 if (topVisible) result = result & TOP;
112 sidesVisible = yesno;
113 cerr <<
"Warning: VART::Cylinder::ShowSide is deprecated." << endl;
119 cerr <<
"Warning: VART::Cylinder::ShowTop is deprecated." << endl;
124 bottomVisible = yesno;
125 cerr <<
"Warning: VART::Cylinder::ShowBottom is deprecated." << endl;
145 cerr <<
"Warning: VART::Cylinder::ShowSide is deprecated." << endl;
151 cerr <<
"Warning: VART::Cylinder::ShowTop is deprecated." << endl;
157 cerr <<
"Warning: VART::Cylinder::ShowBottom is deprecated." << endl;
158 return bottomVisible;
161 bool VART::Cylinder::DrawInstanceOGL()
const
164 GLUquadricObj* qObj = gluNewQuadric();
172 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
175 glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
178 glPolygonMode(GL_FRONT, GL_FILL);
181 if ( material.GetTexture().HasData() ) {
182 gluQuadricTexture(qObj,GL_TRUE);
184 result = material.DrawOGL();
187 gluQuadricDrawStyle(qObj, GLU_FILL);
188 gluQuadricNormals(qObj, GLU_SMOOTH);
189 gluCylinder(qObj, btRadius, topRadius, height, 15, 1);
193 gluQuadricOrientation(qObj,GLU_INSIDE);
194 gluDisk(qObj, 0.0, btRadius, 15, 1);
199 gluQuadricOrientation(qObj,GLU_OUTSIDE);
200 glTranslatef(0.0f, 0.0f, height);
201 gluDisk(qObj, 0.0, topRadius, 15, 1);
204 gluDeleteQuadric(qObj);
207 bBox.DrawInstanceOGL();
209 recBBox.DrawInstanceOGL();
void SetPartsVisibility(PartsID parts)
Sets which parts are visible.
VART::Cylinder & operator=(const VART::Cylinder &cylinder)
Base class for objects that compose a scene graph.
virtual void ComputeBoundingBox()
Computes the bounding box.
void SetRadius(float r)
Sets the value of top and bottom radius.
PartsID
Bitmask for cylinder parts.
void SetBoundingBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
float GetBottomRadius()
Returns the bottom radius.
PartsID GetPartsVisibility()
Returns internal visibility state as PartsID.
An scene node that is associated with a shape.
SceneNode & operator=(const SceneNode &node)
void TogglePartsVisibilty(PartsID parts)
Toogle visibility of marked parts.
Header file for V-ART class "Cylinder".
Cylinder()
Creates an uninitialized cylinder.
float GetTopRadius()
Returns the top radius.
virtual VART::SceneNode * Copy()
Returns a copy of an cylinder. Every derived class must reimplements this method, to avoid errors wit...