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

MayaShaderColorDef Class Reference

This defines the various attributes that Maya may associate with the "color" channel for a particular shader (as well as on the "transparency" channel). More...

#include <mayaShaderColorDef.h>

List of all members.

Public Types

enum  ProjectionType {
  PT_off, PT_planar, PT_spherical, PT_cylindrical,
  PT_ball, PT_cubic, PT_triplanar, PT_concentric,
  PT_perspective
}

Public Member Functions

 MayaShaderColorDef ()
 ~MayaShaderColorDef ()
LMatrix3d compute_texture_matrix () const
 Returns a texture matrix corresponding to the texture transforms indicated by the shader.

bool has_projection () const
 Returns true if the shader has a projection in effect.

TexCoordd project_uv (const LPoint3d &pos, const LPoint3d &ref_point) const
 If the shader has a projection (has_projection() returns true), this computes the appropriate UV corresponding to the indicated 3-d point.

bool reset_maya_texture (const Filename &texture)
 Changes the texture filename stored in the Maya file for this particular shader.

void write (ostream &out) const

Public Attributes

bool _has_texture
Filename _texture
RGBColorf _color_gain
bool _has_flat_color
Colord _flat_color
ProjectionType _projection_type
LMatrix4d _projection_matrix
double _u_angle
double _v_angle
LVector2f _coverage
LVector2f _translate_frame
double _rotate_frame
bool _mirror
bool _stagger
bool _wrap_u
bool _wrap_v
LVector2f _repeat_uv
LVector2f _offset
double _rotate_uv

Private Member Functions

void read_surface_color (MObject color)
 Determines the surface color specified by the shader.

void set_projection_type (const string &type)
 Sets up the shader to apply UV's according to the indicated projection type.

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.


Private Attributes

LPoint2d(MayaShaderColorDef::* _map_uvs )(const LPoint3d &pos, const LPoint3d &centroid) const
MObject * _color_object

Friends

class MayaShader


Detailed Description

This defines the various attributes that Maya may associate with the "color" channel for a particular shader (as well as on the "transparency" channel).

Definition at line 43 of file mayaShaderColorDef.h.


Member Enumeration Documentation

enum MayaShaderColorDef::ProjectionType
 

Enumeration values:
PT_off 
PT_planar 
PT_spherical 
PT_cylindrical 
PT_ball 
PT_cubic 
PT_triplanar 
PT_concentric 
PT_perspective 

Definition at line 55 of file mayaShaderColorDef.h.


Constructor & Destructor Documentation

MayaShaderColorDef::MayaShaderColorDef  ) 
 

Definition at line 45 of file mayaShaderColorDef.cxx.

References NULL.

MayaShaderColorDef::~MayaShaderColorDef  ) 
 

Definition at line 80 of file mayaShaderColorDef.cxx.

References _coverage, _offset, _repeat_uv, _rotate_frame, and _translate_frame.


Member Function Documentation

LMatrix3d MayaShaderColorDef::compute_texture_matrix  )  const
 

Returns a texture matrix corresponding to the texture transforms indicated by the shader.

Definition at line 97 of file mayaShaderColorDef.cxx.

References _projection_type, and PT_off.

Referenced by MayaToEggConverter::set_shader_attributes().

bool MayaShaderColorDef::has_projection  )  const
 

Returns true if the shader has a projection in effect.

Definition at line 120 of file mayaShaderColorDef.cxx.

References _map_uvs, and _projection_matrix.

LPoint2d MayaShaderColorDef::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 430 of file mayaShaderColorDef.cxx.

LPoint2d MayaShaderColorDef::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 360 of file mayaShaderColorDef.cxx.

References _v_angle.

LPoint2d MayaShaderColorDef::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 377 of file mayaShaderColorDef.cxx.

References _u_angle, nassertr, and rad_2_deg().

TexCoordd MayaShaderColorDef::project_uv const LPoint3d &  pos,
const LPoint3d &  ref_point
const
 

If the shader has a projection (has_projection() returns true), this computes the appropriate UV corresponding to the indicated 3-d point.

Seams that might be introduced on polygons that cross quadrants are closed up by ensuring the point is in the same quadrant as the indicated reference point.

Definition at line 143 of file mayaShaderColorDef.cxx.

References _color_gain.

void MayaShaderColorDef::read_surface_color MObject  color  )  [private]
 

Determines the surface color specified by the shader.

This includes texturing and other advanced shader properties.

Definition at line 220 of file mayaShaderColorDef.cxx.

References size_t.

Referenced by MayaShader::get_rgba().

bool MayaShaderColorDef::reset_maya_texture const Filename texture  ) 
 

Changes the texture filename stored in the Maya file for this particular shader.

Definition at line 188 of file mayaShaderColorDef.cxx.

References _color_gain.

void MayaShaderColorDef::set_projection_type const string &  type  )  [private]
 

Sets up the shader to apply UV's according to the indicated projection type.

Definition at line 312 of file mayaShaderColorDef.cxx.

void MayaShaderColorDef::write ostream &  out  )  const
 

Definition at line 157 of file mayaShaderColorDef.cxx.

References _color_object, _has_texture, _texture, NULL, and set_string_attribute().


Friends And Related Function Documentation

friend class MayaShader [friend]
 

Definition at line 105 of file mayaShaderColorDef.h.


Member Data Documentation

RGBColorf MayaShaderColorDef::_color_gain
 

Definition at line 69 of file mayaShaderColorDef.h.

Referenced by project_uv(), and reset_maya_texture().

MObject* MayaShaderColorDef::_color_object [private]
 

Definition at line 103 of file mayaShaderColorDef.h.

Referenced by write().

LVector2f MayaShaderColorDef::_coverage
 

Definition at line 79 of file mayaShaderColorDef.h.

Referenced by ~MayaShaderColorDef().

Colord MayaShaderColorDef::_flat_color
 

Definition at line 72 of file mayaShaderColorDef.h.

Referenced by MayaShader::write().

bool MayaShaderColorDef::_has_flat_color
 

Definition at line 71 of file mayaShaderColorDef.h.

Referenced by MayaShader::write().

bool MayaShaderColorDef::_has_texture
 

Definition at line 67 of file mayaShaderColorDef.h.

Referenced by write().

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

Referenced by has_projection().

bool MayaShaderColorDef::_mirror
 

Definition at line 83 of file mayaShaderColorDef.h.

LVector2f MayaShaderColorDef::_offset
 

Definition at line 89 of file mayaShaderColorDef.h.

Referenced by ~MayaShaderColorDef().

LMatrix4d MayaShaderColorDef::_projection_matrix
 

Definition at line 75 of file mayaShaderColorDef.h.

Referenced by has_projection().

ProjectionType MayaShaderColorDef::_projection_type
 

Definition at line 74 of file mayaShaderColorDef.h.

Referenced by compute_texture_matrix().

LVector2f MayaShaderColorDef::_repeat_uv
 

Definition at line 88 of file mayaShaderColorDef.h.

Referenced by ~MayaShaderColorDef().

double MayaShaderColorDef::_rotate_frame
 

Definition at line 81 of file mayaShaderColorDef.h.

Referenced by ~MayaShaderColorDef().

double MayaShaderColorDef::_rotate_uv
 

Definition at line 90 of file mayaShaderColorDef.h.

bool MayaShaderColorDef::_stagger
 

Definition at line 84 of file mayaShaderColorDef.h.

Filename MayaShaderColorDef::_texture
 

Definition at line 68 of file mayaShaderColorDef.h.

Referenced by write().

LVector2f MayaShaderColorDef::_translate_frame
 

Definition at line 80 of file mayaShaderColorDef.h.

Referenced by ~MayaShaderColorDef().

double MayaShaderColorDef::_u_angle
 

Definition at line 76 of file mayaShaderColorDef.h.

Referenced by map_spherical().

double MayaShaderColorDef::_v_angle
 

Definition at line 77 of file mayaShaderColorDef.h.

Referenced by map_planar().

bool MayaShaderColorDef::_wrap_u
 

Definition at line 85 of file mayaShaderColorDef.h.

Referenced by MayaToEggConverter::set_shader_attributes().

bool MayaShaderColorDef::_wrap_v
 

Definition at line 86 of file mayaShaderColorDef.h.

Referenced by MayaToEggConverter::set_shader_attributes().


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