RobWorkProject
Public Member Functions | List of all members
LoaderTRI Class Reference

loader for a simple ASCI based triangle format. The format is NOT a standard. There are two elements in the format each is defined in a line More...

#include <LoaderTRI.hpp>

Inherits Model3DLoader.

Public Member Functions

 LoaderTRI ()
 constructor
 
virtual ~LoaderTRI ()
 destructor
 
rw::graphics::Model3D::Ptr load (const std::string &filename)
 load a Model3D from file filename More...
 
- Public Member Functions inherited from Model3DLoader
virtual ~Model3DLoader ()
 destructor
 

Additional Inherited Members

- Public Types inherited from Model3DLoader
typedef rw::common::Ptr< Model3DLoaderPtr
 smart pointer type
 

Detailed Description

loader for a simple ASCI based triangle format. The format is NOT a standard. There are two elements in the format each is defined in a line

* color <float> <float> <float>
* point <float> <float> <float> <float> <float> <float>
* 

line comments can be added by starting the line with '#', '!', '\0'(blank line) or '$'

the color is RGB and the point has a position (first three floats) and a normal (last three floats). Points are implicitly structured as triangles such that:

triangle(points[nrPoints%3],points[nrPoints%3+1],points[nrPoints%3+2]);

all triangles after a specific color element, will be drawn with the RGB values specified

Member Function Documentation

◆ load()

rw::graphics::Model3D::Ptr load ( const std::string &  filename)
virtual

load a Model3D from file filename

Parameters
filename[in] name of file to load
Returns
a model3d if loaded successfully else NULL (or exception)

Implements Model3DLoader.


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