pgl
PrimitiveOpenGL3Dprimitivelibrary
Classes | Public Member Functions | Protected Member Functions | List of all members
pgl::Model Class Reference

STL model. More...

#include <primitive.h>

Inheritance diagram for pgl::Model:
Inheritance graph
[legend]
Collaboration diagram for pgl::Model:
Collaboration graph
[legend]

Classes

struct  Triangle
 

Public Member Functions

 Model (const std::string &file, double scale=1)
 Specifies model file name and optional scale.
 
 Model (const std::string &file, const Vector3 &offset, double scale=1)
 Specifies model file name, offset, and optional scale.
 
- Public Member Functions inherited from pgl::Primitive
 Primitive ()
 Default constructor. More...
 
virtual void draw ()
 Draw primitive and its children.
 
- Public Member Functions inherited from pgl::Object
 Object ()
 Default constructor. More...
 
- Public Member Functions inherited from pgl::Node
template<class T >
T * attach (T *child)
 Add child to list of sub-objects. More...
 

Protected Member Functions

void make (const std::string &file, double scale)
 
- Protected Member Functions inherited from pgl::Primitive
double align (const Vector3 &start, const Vector3 &end)
 Align primitive along axis. More...
 
virtual void normal (const Vector3 &v)
 Sets norm for subsequent vertices.
 
virtual void vertex (const Vector3 &v)
 Enters vertex into display list.
 
virtual void quad (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3, const Vector3 &v4)
 Draws a four-sided polygon using two triangles. More...
 
virtual void triangle (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 Draws triangle.
 

Additional Inherited Members

- Public Attributes inherited from pgl::Primitive
Vector3 color
 Primitive color.
 
- Public Attributes inherited from pgl::Object
Transform transform
 Position and orientation.
 
- Public Attributes inherited from pgl::Node
std::vector< Node * > children
 Sub-objects.
 
- Protected Attributes inherited from pgl::Primitive
GLuint list_
 OpenGL display list identifier.
 

Detailed Description

STL model.

Reads model from a binary STL file.

Note
STL files have arbitrary scale and no color information. The scale can therefore be specified in the constructor, and the color has to be set afterwards in the same way as the other primitives. The entire model will have the same color.

The documentation for this class was generated from the following file: