Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CLwoSurface Class Reference

This class is a wrapper around LwoSurface and stores additional information useful during the conversion-to-egg process. More...

#include <cLwoSurface.h>

List of all members.

Public Types

enum  Flags {
  F_rgb = 0x0001, F_diffuse = 0x0002, F_luminosity = 0x0004, F_specular = 0x0008,
  F_reflection = 0x0010, F_transparency = 0x0020, F_gloss = 0x0040, F_translucency = 0x0080,
  F_smooth_angle = 0x0100, F_backface = 0x0200
}

Public Member Functions

 CLwoSurface (LwoToEggConverter *converter, const LwoSurface *surface)
 ~CLwoSurface ()
const string & get_name () const
 Returns the name of the surface.

void apply_properties (EggPrimitive *egg_prim, vector_PT_EggVertex &egg_vertices, float &smooth_angle)
 Applies the color, texture, etc.

bool check_texture ()
 Checks whether the surface demands a texture or not.

bool check_material ()
 Checks whether the surface demands a material or not.

bool has_named_uvs () const
 Returns true if the surface is set up to reference UV's stored on the vertices, by name (as opposed to generated UV's, which is the more common Lightwave case).

const string & get_uv_name () const
 Returns the name of the set of UV's that are associated with this surface, if has_named_uvs() is true.


Public Attributes

int _flags
RGBColorf _rgb
float _diffuse
float _luminosity
float _specular
float _reflection
float _transparency
float _gloss
float _translucency
float _smooth_angle
bool _backface
Colorf _color
Colorf _diffuse_color
LwoToEggConverter_converter
ConstPointerTo< LwoSurface_surface
bool _checked_material
PT_EggMaterial _egg_material
bool _checked_texture
PT_EggTexture _egg_texture
CLwoSurfaceBlock_block

Private Member Functions

void generate_uvs (vector_PT_EggVertex &egg_vertices)
 Computes all the UV's for the polygon's vertices, according to the _projection_mode defined in the block.

LPoint2d map_planar (const LPoint3d &pos, const LPoint3d &centroid) const
 Computes a UV based on the given point in space, using a planar projection.

LPoint2d map_spherical (const LPoint3d &pos, const LPoint3d &centroid) const
 Computes a UV based on the given point in space, using a spherical projection.

LPoint2d map_cylindrical (const LPoint3d &pos, const LPoint3d &centroid) const
 Computes a UV based on the given point in space, using a cylindrical projection.

LPoint2d map_cubic (const LPoint3d &pos, const LPoint3d &centroid) const
 Computes a UV based on the given point in space, using a cubic projection.


Private Attributes

LPoint2d(CLwoSurface::* _map_uvs )(const LPoint3d &pos, const LPoint3d &centroid) const


Detailed Description

This class is a wrapper around LwoSurface and stores additional information useful during the conversion-to-egg process.

Definition at line 54 of file cLwoSurface.h.


Member Enumeration Documentation

enum CLwoSurface::Flags
 

Enumeration values:
F_rgb 
F_diffuse 
F_luminosity 
F_specular 
F_reflection 
F_transparency 
F_gloss 
F_translucency 
F_smooth_angle 
F_backface 

Definition at line 71 of file cLwoSurface.h.


Constructor & Destructor Documentation

CLwoSurface::CLwoSurface LwoToEggConverter converter,
const LwoSurface surface
 

Definition at line 46 of file cLwoSurface.cxx.

References NULL.

CLwoSurface::~CLwoSurface  ) 
 

Definition at line 164 of file cLwoSurface.cxx.

References _converter, _diffuse_color, _surface, apply_properties(), check_material(), check_texture(), LwoToEggConverter::get_surface(), NULL, and EggPrimitive::set_color().


Member Function Documentation

void CLwoSurface::apply_properties EggPrimitive egg_prim,
vector_PT_EggVertex &  egg_vertices,
float &  smooth_angle
 

Applies the color, texture, etc.

described by the surface to the indicated egg primitive.

If the surface defines a smoothing angle, smooth_angle may be updated to reflect it if the angle is greater than that specified.

Definition at line 189 of file cLwoSurface.cxx.

References _egg_material, and EggPrimitive::set_material().

Referenced by ~CLwoSurface().

bool CLwoSurface::check_material  ) 
 

Checks whether the surface demands a material or not.

Returns true if so, false otherwise.

Definition at line 328 of file cLwoSurface.cxx.

References _color, _egg_material, _flags, _luminosity, Colorf, and F_luminosity.

Referenced by ~CLwoSurface().

bool CLwoSurface::check_texture  ) 
 

Checks whether the surface demands a texture or not.

Returns true if so, false otherwise.

If the surface demands a texture, this also sets up _egg_texture and _compute_uvs as appropriate for the texture.

Definition at line 244 of file cLwoSurface.cxx.

Referenced by ~CLwoSurface().

void CLwoSurface::generate_uvs vector_PT_EggVertex &  egg_vertices  )  [private]
 

Computes all the UV's for the polygon's vertices, according to the _projection_mode defined in the block.

Definition at line 393 of file cLwoSurface.cxx.

const string & CLwoSurface::get_name  )  const [inline]
 

Returns the name of the surface.

Each surface in a given Lightwave file should have a unique name.

Definition at line 34 of file cLwoSurface.I.

References _block, CLwoSurfaceBlock::_projection_mode, INLINE, LwoSurfaceBlockProjection::M_uv, and NULL.

const string & CLwoSurface::get_uv_name  )  const [inline]
 

Returns the name of the set of UV's that are associated with this surface, if has_named_uvs() is true.

Definition at line 73 of file cLwoSurface.I.

Referenced by CLwoPolygons::make_faces().

bool CLwoSurface::has_named_uvs  )  const [inline]
 

Returns true if the surface is set up to reference UV's stored on the vertices, by name (as opposed to generated UV's, which is the more common Lightwave case).

In this case, get_uv_name() can be called to return the name of the UV's.

Definition at line 55 of file cLwoSurface.I.

References _block.

LPoint2d CLwoSurface::map_cubic const LPoint3d &  pos,
const LPoint3d &  centroid
const [private]
 

Computes a UV based on the given point in space, using a cubic projection.

Definition at line 547 of file cLwoSurface.cxx.

LPoint2d CLwoSurface::map_cylindrical const LPoint3d &  pos,
const LPoint3d &  centroid
const [private]
 

Computes a UV based on the given point in space, using a cylindrical projection.

Definition at line 507 of file cLwoSurface.cxx.

References x, and y.

LPoint2d CLwoSurface::map_planar const LPoint3d &  pos,
const LPoint3d &  centroid
const [private]
 

Computes a UV based on the given point in space, using a planar projection.

Definition at line 432 of file cLwoSurface.cxx.

LPoint2d CLwoSurface::map_spherical const LPoint3d &  pos,
const LPoint3d &  centroid
const [private]
 

Computes a UV based on the given point in space, using a spherical projection.

Definition at line 452 of file cLwoSurface.cxx.


Member Data Documentation

bool CLwoSurface::_backface
 

Definition at line 94 of file cLwoSurface.h.

CLwoSurfaceBlock* CLwoSurface::_block
 

Definition at line 108 of file cLwoSurface.h.

Referenced by CLwoSurfaceBlock::CLwoSurfaceBlock(), get_name(), and has_named_uvs().

bool CLwoSurface::_checked_material
 

Definition at line 102 of file cLwoSurface.h.

bool CLwoSurface::_checked_texture
 

Definition at line 105 of file cLwoSurface.h.

Colorf CLwoSurface::_color
 

Definition at line 96 of file cLwoSurface.h.

Referenced by check_material().

LwoToEggConverter* CLwoSurface::_converter
 

Definition at line 99 of file cLwoSurface.h.

Referenced by ~CLwoSurface().

float CLwoSurface::_diffuse
 

Definition at line 86 of file cLwoSurface.h.

Colorf CLwoSurface::_diffuse_color
 

Definition at line 97 of file cLwoSurface.h.

Referenced by ~CLwoSurface().

PT_EggMaterial CLwoSurface::_egg_material
 

Definition at line 103 of file cLwoSurface.h.

Referenced by apply_properties(), and check_material().

PT_EggTexture CLwoSurface::_egg_texture
 

Definition at line 106 of file cLwoSurface.h.

int CLwoSurface::_flags
 

Definition at line 84 of file cLwoSurface.h.

Referenced by check_material().

float CLwoSurface::_gloss
 

Definition at line 91 of file cLwoSurface.h.

float CLwoSurface::_luminosity
 

Definition at line 87 of file cLwoSurface.h.

Referenced by check_material().

LPoint2d(CLwoSurface::* CLwoSurface::_map_uvs)(const LPoint3d &pos, const LPoint3d &centroid) const [private]
 

float CLwoSurface::_reflection
 

Definition at line 89 of file cLwoSurface.h.

RGBColorf CLwoSurface::_rgb
 

Definition at line 85 of file cLwoSurface.h.

float CLwoSurface::_smooth_angle
 

Definition at line 93 of file cLwoSurface.h.

float CLwoSurface::_specular
 

Definition at line 88 of file cLwoSurface.h.

ConstPointerTo< LwoSurface > CLwoSurface::_surface
 

Definition at line 100 of file cLwoSurface.h.

Referenced by ~CLwoSurface().

float CLwoSurface::_translucency
 

Definition at line 92 of file cLwoSurface.h.

float CLwoSurface::_transparency
 

Definition at line 90 of file cLwoSurface.h.


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:26:00 2003 for Panda-Tool by doxygen1.3