52 #ifndef ACG_GLPRIMITIVES_HH 53 #define ACG_GLPRIMITIVES_HH 59 #include <ACG/Config/ACGDefines.hh> 60 #include <ACG/GL/GLState.hh> 61 #include <ACG/Math/VectorT.hh> 62 #include <ACG/GL/VertexDeclaration.hh> 79 void draw_primitive();
95 virtual int getNumTriangles() = 0;
96 virtual int getNumLines() {
return 0;}
99 unsigned int getVBO();
103 enum NormalOrientation {OUTSIDE, INSIDE};
108 virtual void updateVBO() = 0;
119 bool vboDataInvalid_;
121 NormalOrientation normalOrientation_;
125 void updateVBOData();
149 int getNumTriangles()
override;
153 void updateVBO()
override;
155 void addTriangle(
int sl0,
int st0,
int sl1,
int st1,
int sl2,
int st2);
157 ACG::Vec3f positionOnSphere(
int _sliceNumber,
int _stackNumber);
158 ACG::Vec2f texCoordOnSphere(
int _sliceNumber,
int _stackNumber);
172 GLCone(
int _slices,
int _stacks,
float _bottomRadius,
float _topRadius,
bool _bottomCap_,
bool _topCap);
186 float _radiusScale = 1.0f);
188 int getNumTriangles()
override;
190 void updateVBO()
override;
191 void setBottomRadius(
float _bottomRadius);
192 void setTopRadius(
float _topRadius);
193 void setNormalOrientation(NormalOrientation orienation);
197 void addTriangle(
int sl0,
int st0,
int sl1,
int st1,
int sl2,
int st2);
199 ACG::Vec3f positionOnCone(
int _sliceNumber,
int _stackNumber);
200 ACG::Vec2f texCoordOnCone(
int _sliceNumber,
int _stackNumber);
201 ACG::Vec3f normalOnCone(
int _sliceNumber,
int _stackNumber);
220 GLCylinder(
int _slices,
int _stacks,
float _radius,
bool _bottomCap,
bool _topCap);
227 GLPartialDisk(
int _slices,
int _loops,
float _innerRadius,
float _outerRadius,
float _startAngle,
float _sweepAngle);
229 void setInnerRadius(
float _innerRadius);
230 void setOuterRadius(
float _outerRadius);
231 int getNumTriangles()
override;
239 void updateVBO()
override;
254 GLDisk(
int _slices,
int _loops,
float _innerRadius,
float _outerRadius);
266 int getNumTriangles()
override;
270 void updateVBO()
override;
282 int getNumTriangles()
override;
283 int getNumLines()
override;
287 void updateVBO()
override;
299 int getNumTriangles()
override;
303 void updateVBO()
override;
315 int getNumTriangles()
override;
319 void updateVBO()
override;
331 int getNumTriangles()
override;
335 void updateVBO()
override;
347 int getNumTriangles()
override;
351 void updateVBO()
override;
361 GLdouble outerRadius,
362 GLint nsides, GLint rings);
365 int getNumTriangles()
override;
369 void updateVBO()
override;
382 #endif // ACG_GLPRIMITIVES_HH defined
Namespace providing different geometric functions concerning angles.
Class to define the vertex input layout.
Interface class between scenegraph and renderer.