cee::geo::EffectTexture Class Reference

Effect describing the texture to be used when drawing the associated part data. More...

Public Types

enum  SamplerWrapMode { REPEAT, CLAMP_TO_EDGE, CLAMP_TO_BORDER, MIRRORED_REPEAT }
 Specifies what should happen to texture coordinates that are outside the 0 to 1 range. More...
 
enum  SamplerFilter {
  NEAREST, LINEAR, NEAREST_MIPMAP_NEAREST, LINEAR_MIPMAP_NEAREST,
  NEAREST_MIPMAP_LINEAR, LINEAR_MIPMAP_LINEAR
}
 Specifies the minifying and magnification filtering used when doing the texture mapping. More...
 
- Public Types inherited from cee::geo::Effect
enum  Type {
  COLOR, OPACITY, FRONT_AND_BACK_COLOR, FRONT_AND_BACK_OPACITY,
  TEXTURE, EYE_LIFT, POLYGON_OFFSET, HALO,
  LIGHTING, LINE_WIDTH, POINT_SIZE
}
 Enumerator for each of the available effect types. More...
 

Public Member Functions

 EffectTexture ()
 Constructs an empty effect. More...
 
 EffectTexture (const Image *textureImage)
 Constructs a texture effect with the given image. More...
 
virtual Type type () const
 Returns Effect::TEXTURE. More...
 
virtual PtrRef< Effectclone ()
 Clones the effect. More...
 
const Imageimage () const
 Returns the image used to texture the part. More...
 
void setImage (const Image *textureImage)
 Specifies the image used to texture the part. More...
 
SamplerWrapMode samplerWrapMode () const
 Returns the wrapping mode to use for textures when the texture coordinate is outside the 0 to 1 range. More...
 
void setSamplerWrapMode (SamplerWrapMode wrapMode)
 Specifies what should happen to texture coordinates that are outside the 0 to 1 range. More...
 
SamplerFilter samplerMinifyingFilter () const
 Returns the minifying filter function used for the texture mapping. More...
 
void setSamplerMinifyingFilter (SamplerFilter filterType)
 Specifies the minifying filter function to use in the texture sampler when doing texture mapping. More...
 
SamplerFilter samplerMagnificationFilter () const
 Returns the magnification filter function used for the texture mapping. More...
 
void setSamplerMagnificationFilter (SamplerFilter filterType)
 Specifies the magnify filter function to use in the texture sampler when doing texture mapping. More...
 
Color4f borderColor () const
 Returns the border color to use when wrapping is set to CLAMP_TO_BORDER. More...
 
void setBorderColor (const Color4f &color)
 Sets the border color to use when wrapping is set to CLAMP_TO_BORDER. More...
 
float ambientIntensity () const
 Returns the ambient intensity of the color. More...
 
void setAmbientIntensity (float intensity)
 Specifies the ambient intensity of the color. More...
 
float specularIntensity () const
 Returns the specular intensity of the color. More...
 
void setSpecularIntensity (float intensity)
 Specifies the specular intensity of the color. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 

Static Public Member Functions

static PtrRef< EffectTexturecreateResultMapping (const Image *textureImage)
 Create a texture effect that is suitable to use with a ScalarMapper. More...
 

Additional Inherited Members

- Protected Member Functions inherited from cee::geo::Effect
 Effect ()
 Constructs an empty part effect of a given type. More...
 
Inheritance diagram for cee::geo::EffectTexture:
cee::geo::Effect cee::RefCountedObject

Detailed Description

Effect describing the texture to be used when drawing the associated part data.

May be overridden by the following effects if found further up the stack:

Supported by the following part data:

See also
Part
Effect
PartSettings

Member Enumeration Documentation

Specifies the minifying and magnification filtering used when doing the texture mapping.

Enumerator
NEAREST 

Nearest neighbor filtering on the base MipMap level. Texture will look blocky when zoom into.

LINEAR 

Linear filtering on the base MipMap level. (Default magnification filter in OpenGL). Texture will look blurry when zoomed into.

NEAREST_MIPMAP_NEAREST 

Selects nearest MipMap level and performs nearest neighbor filtering.

LINEAR_MIPMAP_NEAREST 

Selects nearest MipMap level and performs linear filtering.

NEAREST_MIPMAP_LINEAR 

Perform linear interpolation between MipMap levels and perform nearest neighbor filtering. (Default minifying filter in OpenGL).

LINEAR_MIPMAP_LINEAR 

Perform linear interpolation between MipMap levels and perform linear filtering (trilinear mipmapping).

Specifies what should happen to texture coordinates that are outside the 0 to 1 range.

Enumerator
REPEAT 

The integer part of the coordinate will be ignored and a repeating pattern is formed.

CLAMP_TO_EDGE 

The texture coordinates will be clamped into the range 0 to 1.

CLAMP_TO_BORDER 

The coordinates that fall outside the 0 to 1 range will be given the borderColor().

MIRRORED_REPEAT 

The texture will also be repeated, but it will be mirrored when the integer part of the coordinate is odd.

Constructor & Destructor Documentation

cee::geo::EffectTexture::EffectTexture ( )

Constructs an empty effect.

cee::geo::EffectTexture::EffectTexture ( const Image textureImage)

Constructs a texture effect with the given image.

Member Function Documentation

float cee::geo::EffectTexture::ambientIntensity ( ) const

Returns the ambient intensity of the color.

1.0f is max intensity 0.0f is min intensity

Note
Ignored for OpenGL Fixed Function pipeline
See also
setAmbientIntensity
cee::Color4f cee::geo::EffectTexture::borderColor ( ) const

Returns the border color to use when wrapping is set to CLAMP_TO_BORDER.

See also
setBorderColor
PtrRef< Effect > cee::geo::EffectTexture::clone ( )
virtual

Clones the effect.

Implements cee::geo::Effect.

PtrRef< EffectTexture > cee::geo::EffectTexture::createResultMapping ( const Image textureImage)
static

Create a texture effect that is suitable to use with a ScalarMapper.

The method creates an EffectTexture and then configures the following settings:

  • setSamplerMinifyingFilter(cee::geo::EffectTexture::NEAREST)
  • setSamplerMagnificationFilter(cee::geo::EffectTexture::NEAREST)
  • setSamplerWrapMode(cee::geo::EffectTexture::CLAMP_TO_EDGE)
  • setSpecularIntensity(0.1f)
See also
ScalarMapper
ScalarMapperContinuousDomain
const Image * cee::geo::EffectTexture::image ( ) const

Returns the image used to texture the part.

EffectTexture::SamplerFilter cee::geo::EffectTexture::samplerMagnificationFilter ( ) const

Returns the magnification filter function used for the texture mapping.

See also
setSamplerMinifyingFilter
EffectTexture::SamplerFilter cee::geo::EffectTexture::samplerMinifyingFilter ( ) const

Returns the minifying filter function used for the texture mapping.

See also
setSamplerMinifyingFilter
EffectTexture::SamplerWrapMode cee::geo::EffectTexture::samplerWrapMode ( ) const

Returns the wrapping mode to use for textures when the texture coordinate is outside the 0 to 1 range.

See also
setSamplerWrapMode
void cee::geo::EffectTexture::setAmbientIntensity ( float  intensity)

Specifies the ambient intensity of the color.

1.0f is max intensity 0.0f is min intensity

Note
Ignored for OpenGL Fixed Function pipeline
See also
ambientIntensity
void cee::geo::EffectTexture::setBorderColor ( const Color4f color)

Sets the border color to use when wrapping is set to CLAMP_TO_BORDER.

Any pixel with a texture coordinate outside the 0 to 1 range will get this color.

void cee::geo::EffectTexture::setImage ( const Image textureImage)

Specifies the image used to texture the part.

void cee::geo::EffectTexture::setSamplerMagnificationFilter ( SamplerFilter  filterType)

Specifies the magnify filter function to use in the texture sampler when doing texture mapping.

The texture coordinates are independent of the texture resolution. This method specifies what do when the texture is magnified, i.e. getting a bigger resolution in pixels on the screen than the original image. There are two options: LINEAR will do an weighted average of the 4 pixels surrounding the given coordinates. NEAREST will just pick the pixel closest to the coordinates.

The default value is EffectTexture::LINEAR.

Note
Legal values: EffectTexture::LINEAR or EffectTexture::NEAREST.
void cee::geo::EffectTexture::setSamplerMinifyingFilter ( SamplerFilter  filterType)

Specifies the minifying filter function to use in the texture sampler when doing texture mapping.

The texture coordinates are independent of the texture resolution. This method specifies what do when the texture is minified, i.e. getting a smaller resolution in pixels on the screen than the original image.

The default value is EffectTexture::LINEAR_MIPMAP_LINEAR

void cee::geo::EffectTexture::setSamplerWrapMode ( SamplerWrapMode  wrapMode)

Specifies what should happen to texture coordinates that are outside the 0 to 1 range.

The SamplerWrapMode defines how to handle texture coordinates that are outside the 0 to 1 range.

The default value is EffectTexture::REPEAT.

void cee::geo::EffectTexture::setSpecularIntensity ( float  intensity)

Specifies the specular intensity of the color.

1.0f is max intensity 0.0f is min intensity

Note
Ignored for OpenGL Fixed Function pipeline
See also
specularIntensity
float cee::geo::EffectTexture::specularIntensity ( ) const

Returns the specular intensity of the color.

1.0f is max intensity 0.0f is min intensity

Note
Ignored for OpenGL Fixed Function pipeline
See also
setSpecularIntensity
Effect::Type cee::geo::EffectTexture::type ( ) const
virtual

Returns Effect::TEXTURE.

Implements cee::geo::Effect.