graphic< C, V > Struct Template Reference

#include <graphic.hpp>

Inheritance diagram for graphic< C, V >:
geometric< V >

List of all members.

Public Types

Public Member Functions

Public Attributes

Protected Attributes


Detailed Description

template<class C, class V = default_env>
struct mmx::shape::graphic< C, V >

Definition at line 28 of file graphic.hpp.


Member Enumeration Documentation

anonymous enum
Enumerator:
E_TRIANGLE 
E_QUAD 
E_UNSTRUCT 

Definition at line 31 of file graphic.hpp.


Constructor & Destructor Documentation

graphic ( void   )  [inline]

Definition at line 40 of file graphic.hpp.

00040 {};

graphic ( int  nbv,
int  nbe,
int  nbf,
bool  hasnormal = false,
bool  hascolor = false,
int  type = E_TRIANGLE 
) [inline]

Definition at line 54 of file graphic.hpp.

References graphic< C, V >::colors, graphic< C, V >::E_QUAD, graphic< C, V >::edges, graphic< C, V >::faces, graphic< C, V >::normals, Seq< C, R >::resize(), and graphic< C, V >::vertices.

00054                                                                                 {
00055     this->type = type;
00056     this->vertices.resize(3*nbv);
00057     this->edges.resize(2*nbe);
00058     if (type == E_QUAD) this->faces.resize(4*nbf); else this->faces.resize(3*nbf);
00059     if ( hasnormal ) this->normals.resize(3*nbv);
00060     if ( hascolor ) this->colors.resize(3*nbv);
00061 }

~graphic ( void   )  [inline, virtual]

Definition at line 63 of file graphic.hpp.

00063                {
00064 //    if ( vertices ) delete[] vertices;
00065 //    if ( normals  ) delete[] normals;
00066 //    if ( edges ) delete[] edges;
00067 //    if ( faces ) delete[] faces;
00068 //    if ( colors )  delete[] colors;
00069 }


Member Function Documentation

int edge_index ( unsigned  i  )  const [inline]

Definition at line 47 of file graphic.hpp.

References graphic< C, V >::edges.

00047 {return edges[i];}

int face_index ( unsigned  i  )  const [inline]

Definition at line 48 of file graphic.hpp.

References graphic< C, V >::faces.

00048 {return faces[i];}

unsigned nbe ( void   )  const [inline]

Definition at line 43 of file graphic.hpp.

References graphic< C, V >::edges, and Seq< C, R >::size().

00043 {return edges.size()/2;}

unsigned nbf (  )  const [inline]

Definition at line 44 of file graphic.hpp.

References graphic< C, V >::m_nbf.

00044 {return m_nbf;}

unsigned nbv (  )  const [inline]

Definition at line 42 of file graphic.hpp.

References Seq< C, R >::size(), and graphic< C, V >::vertices.

00042 {return vertices.size()/3;}

bool orientation ( double *  q0,
double *  q1,
double *  q2,
double *  q3 
) [inherited]
bool position ( double *  x,
double *  y,
double *  z 
) [inherited]
C vertex_coord ( unsigned  i  )  const [inline]

Definition at line 46 of file graphic.hpp.

References graphic< C, V >::vertices.

00046 {return vertices[i];}


Member Data Documentation

Seq<float> colors

Definition at line 37 of file graphic.hpp.

Referenced by graphic< C, V >::graphic().

Seq<int> edges
Seq<int> faces

Definition at line 35 of file graphic.hpp.

Referenced by graphic< C, V >::face_index(), and graphic< C, V >::graphic().

unsigned m_nbf

Definition at line 36 of file graphic.hpp.

Referenced by graphic< C, V >::nbf().

double m_q0 [protected, inherited]

Definition at line 75 of file shape.hpp.

double m_q1 [protected, inherited]

Definition at line 75 of file shape.hpp.

double m_q2 [protected, inherited]

Definition at line 75 of file shape.hpp.

double m_q3 [protected, inherited]

Definition at line 75 of file shape.hpp.

double m_x [protected, inherited]

Definition at line 74 of file shape.hpp.

double m_y [protected, inherited]

Definition at line 74 of file shape.hpp.

double m_z [protected, inherited]

Definition at line 74 of file shape.hpp.

Definition at line 33 of file graphic.hpp.

Referenced by graphic< C, V >::graphic().

unsigned type

Definition at line 30 of file graphic.hpp.


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1