Ocean
Ocean::Rendering::PrimitiveAttribute Class Reference

This class implements an attribute specifying face and culling properties of primitives. More...

Inheritance diagram for Ocean::Rendering::PrimitiveAttribute:

Public Types

enum  FaceMode { MODE_FACE , MODE_LINE , MODE_POINT , MODE_DEFAULT }
 Defines different face rendering modes. More...
 
enum  CullingMode {
  CULLING_NONE = 0 , CULLING_BACK = 1 , CULLING_FRONT = 2 , CULLING_BOTH = CULLING_BACK | CULLING_FRONT ,
  CULLING_DEFAULT
}
 Defines different face culling modes. More...
 
enum  LightingMode { LM_SINGLE_SIDE_LIGHTING , LM_TWO_SIDED_LIGHTING , LM_DEFAULT }
 Definition of different lighting modes. More...
 
- Public Types inherited from Ocean::Rendering::Object
enum  ObjectType {
  TYPE_UNKNOWN , TYPE_ABSOLUTE_TRANSFORM , TYPE_ATTRIBUTE , TYPE_ATTRIBUTE_SET ,
  TYPE_BACKGROUND , TYPE_BILLBOARD , TYPE_BITMAP_FRAMEBUFFER , TYPE_BLEND_ATTRIBUTE ,
  TYPE_BOX , TYPE_CONE , TYPE_CYLINDER , TYPE_DEPTH_ATTRIBUTE ,
  TYPE_DIRECTIONAL_LIGHT , TYPE_FRAMEBUFFER , TYPE_FRAME_TEXTURE_2D , TYPE_GEOMETRY ,
  TYPE_GROUP , TYPE_INDEPENDENT_PRIMITIVE , TYPE_LIGHT_SOURCE , TYPE_LINES ,
  TYPE_LINE_STRIPS , TYPE_LOD , TYPE_MATERIAL , TYPE_NODE ,
  TYPE_OBJECT , TYPE_PARALLEL_VIEW , TYPE_PERSPECTIVE_VIEW , TYPE_PHANTOM_ATTRIBUTE ,
  TYPE_POINT_LIGHT , TYPE_POINTS , TYPE_PRIMITIVE , TYPE_PRIMITIVE_ATTRIBUTE ,
  TYPE_QUAD_STRIPS , TYPE_QUADS , TYPE_RENDERABLE , TYPE_SCENE ,
  TYPE_SHADER_PROGRAM , TYPE_SHAPE , TYPE_SKY_BACKGROUND , TYPE_SPHERE ,
  TYPE_SPOT_LIGHT , TYPE_STEREO_ATTRIBUTE , TYPE_STEREO_VIEW , TYPE_STRIP_PRIMITIVE ,
  TYPE_SWITCH , TYPE_TEXT , TYPE_TEXTURE , TYPE_TEXTURE_2D ,
  TYPE_MEDIA_TEXTURE_2D , TYPE_TEXTURE_FRAMEBUFFER , TYPE_TEXTURES , TYPE_TRANSFORM ,
  TYPE_TRIANGLE_FANS , TYPE_TRIANGLES , TYPE_TRIANGLE_STRIPS , TYPE_UNDISTORTED_BACKGROUND ,
  TYPE_VERTEX_SET , TYPE_VIEW , TYPE_WINDOW_FRAMEBUFFER
}
 Definition of different object type. More...
 
typedef std::unordered_map< ObjectId, unsigned int > ObjectIdMap
 Definition of a map holding object ids to reference counters. More...
 

Public Member Functions

virtual FaceMode faceMode () const
 Returns the face mode of this attribute. More...
 
virtual CullingMode cullingMode () const
 Returns the culling mode of this attribute. More...
 
virtual LightingMode lightingMode () const
 Returns the lighting mode of this attribute. More...
 
virtual void setFaceMode (const FaceMode mode)
 Sets the face mode for this attribute. More...
 
virtual void setCullingMode (const CullingMode culling)
 Sets the culling mode for this attribute. More...
 
virtual void setLightingMode (const LightingMode lighting)
 Sets the lighting mode for this attribute. More...
 
ObjectType type () const override
 Returns the type of this object. More...
 
- Public Member Functions inherited from Ocean::Rendering::Object
ObjectId id () const
 Returns the unique object id of this object. More...
 
const std::string & name () const
 Returns the name of this object. More...
 
virtual void setName (const std::string &name)
 Sets or changes the name of this object. More...
 
virtual const std::string & engineName () const =0
 Returns the name of the owner engine. More...
 
ObjectRefs parentObjects () const
 Returns all parent objects. More...
 
ObjectRefSet parentNodes () const
 Returns all parent nodes. More...
 
virtual std::string descriptiveInformation () const
 Returns descriptive information about the object as string. More...
 

Protected Member Functions

 PrimitiveAttribute ()
 Creates a new primitive attribute. More...
 
- Protected Member Functions inherited from Ocean::Rendering::Attribute
 Attribute ()
 Creates a new attribute object. More...
 
 ~Attribute () override
 Destructs an attribute object. More...
 
- Protected Member Functions inherited from Ocean::Rendering::Object
 Object ()
 Creates a new object. More...
 
 Object (const Object &object)=delete
 Disabled copy constructor. More...
 
virtual ~Object ()
 Destructs an object. More...
 
Engineengine () const
 Returns the render engine which is owner of this object. More...
 
void registerParent (const ObjectId parentId)
 Registers a parent node for this (child) node. More...
 
void unregisterParent (const ObjectId parentId)
 Unregisters a parent node for this (child) node. More...
 
void registerThisObjectAsParent (const ObjectRef &child)
 Registers this object at a child as parent object. More...
 
void unregisterThisObjectAsParent (const ObjectRef &child)
 Unregisters this object from a child as parent. More...
 
Objectoperator= (const Object &object)=delete
 Disabled copy operator. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Rendering::Object
static std::string translateObjectType (const ObjectType objectType)
 Translates an object type to a readable string. More...
 
- Protected Attributes inherited from Ocean::Rendering::Object
Lock objectLock
 Lock for the object. More...
 

Detailed Description

This class implements an attribute specifying face and culling properties of primitives.

Member Enumeration Documentation

◆ CullingMode

Defines different face culling modes.

Enumerator
CULLING_NONE 

Neither front nor back faces culling which results in front and back face rendering.

CULLING_BACK 

Back face culling mode rendering front faces only, which is the default mode.

CULLING_FRONT 

Front face culling mode rendering back faces only.

CULLING_BOTH 

Front and back face culling mode rendering neither front nor back faces.

CULLING_DEFAULT 

Default culling mode.

◆ FaceMode

Defines different face rendering modes.

Enumerator
MODE_FACE 

Face rendering mode rendering the entire face, which is the default mode.

MODE_LINE 

Line rendering mode rendering the face outlines only.

MODE_POINT 

Point rendering mode rendering the face vertices only.

MODE_DEFAULT 

Default face mode.

◆ LightingMode

Definition of different lighting modes.

Enumerator
LM_SINGLE_SIDE_LIGHTING 

Front face is lighted.

LM_TWO_SIDED_LIGHTING 

Both faces are lighted.

LM_DEFAULT 

Default lighting.

Constructor & Destructor Documentation

◆ PrimitiveAttribute()

Ocean::Rendering::PrimitiveAttribute::PrimitiveAttribute ( )
protected

Creates a new primitive attribute.

Member Function Documentation

◆ cullingMode()

virtual CullingMode Ocean::Rendering::PrimitiveAttribute::cullingMode ( ) const
virtual

Returns the culling mode of this attribute.

The default is CULLLING_BACK.

Returns
Culling mode
See also
setCullingMode(), Framebuffer::cullingMode().
Exceptions
NotSupportedExceptionIs thrown if this function is not supported

Reimplemented in Ocean::Rendering::GLESceneGraph::GLESPrimitiveAttribute.

◆ faceMode()

virtual FaceMode Ocean::Rendering::PrimitiveAttribute::faceMode ( ) const
virtual

Returns the face mode of this attribute.

The default is MODE_FACE.

Returns
Face mode
See also
setFaceMode(), Framebuffer::faceMode().
Exceptions
NotSupportedExceptionIs thrown if this function is not supported

Reimplemented in Ocean::Rendering::GLESceneGraph::GLESPrimitiveAttribute.

◆ lightingMode()

virtual LightingMode Ocean::Rendering::PrimitiveAttribute::lightingMode ( ) const
virtual

Returns the lighting mode of this attribute.

If both sides are lighted the back face is lighted using the inversed normal.
The default is LM_SINGLE_LIGHTING.

Returns
Lighting mode
See also
setLightingMode(), Framebuffer::lightingMode().
Exceptions
NotSupportedExceptionIs thrown if this function is not supported

Reimplemented in Ocean::Rendering::GLESceneGraph::GLESPrimitiveAttribute.

◆ setCullingMode()

virtual void Ocean::Rendering::PrimitiveAttribute::setCullingMode ( const CullingMode  culling)
virtual

Sets the culling mode for this attribute.

Parameters
cullingCulling mode to set
See also
cullingMode(), Framebuffer::setCullingMode().
Exceptions
NotSupportedExceptionIs thrown if this function is not supported

Reimplemented in Ocean::Rendering::GLESceneGraph::GLESPrimitiveAttribute.

◆ setFaceMode()

virtual void Ocean::Rendering::PrimitiveAttribute::setFaceMode ( const FaceMode  mode)
virtual

Sets the face mode for this attribute.

Parameters
modeFace mode to set
See also
faceMode(), Framebuffer::setFaceMode().
Exceptions
NotSupportedExceptionIs thrown if this function is not supported

Reimplemented in Ocean::Rendering::GLESceneGraph::GLESPrimitiveAttribute.

◆ setLightingMode()

virtual void Ocean::Rendering::PrimitiveAttribute::setLightingMode ( const LightingMode  lighting)
virtual

Sets the lighting mode for this attribute.

Parameters
lightingLighting mode to set
See also
lightingMode(), Framebuffer::setLightingMode().
Exceptions
NotSupportedExceptionIs thrown if this function is not supported

Reimplemented in Ocean::Rendering::GLESceneGraph::GLESPrimitiveAttribute.

◆ type()

ObjectType Ocean::Rendering::PrimitiveAttribute::type ( ) const
overridevirtual

Returns the type of this object.

See also
Object::type().

Reimplemented from Ocean::Rendering::Attribute.


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