Open CASCADE Technology  7.3.0
Public Member Functions

Vrml_ShapeHints Class Reference

defines a ShapeHints node of VRML specifying properties of geometry and its appearance. The ShapeHints node indicates that IndexedFaceSets are solid, contain ordered vertices, or contain convex faces. These hints allow VRML implementations to optimize certain rendering features. Optimizations that may be performed include enabling back-face culling and disabling two-sided lighting. For example, if an object is solid and has ordered vertices, an implementation may turn on backface culling and turn off two-sided lighting. To ensure that an IndexedFaceSet can be viewed from either direction, set shapeType to be UNKNOWN_SHAPE_TYPE. If you know that your shapes are closed and will alwsys be viewed from the outside, set vertexOrdering to be either CLOCKWISE or COUNTERCLOCKWISE (depending on how you built your object), and set shapeType to be SOLID. Placing this near the top of your VRML file will allow the scene to be rendered much faster. The ShapeHints node also affects how default normals are generated. When an IndexedFaceSet has to generate default normals, it uses the creaseAngle field to determine which edges should be smoothly shaded and which ones should have a sharp crease. The crease angle is the angle between surface normals on adjacent polygons. For example, a crease angle of .5 radians (the default value) means that an edge between two adjacent polygonal faces will be smooth shaded if the normals to the two faces form an angle that is less than .5 radians (about 30 degrees). Otherwise, it will be faceted. More...

#include <Vrml_ShapeHints.hxx>

Public Member Functions

 Vrml_ShapeHints (const Vrml_VertexOrdering aVertexOrdering=Vrml_UNKNOWN_ORDERING, const Vrml_ShapeType aShapeType=Vrml_UNKNOWN_SHAPE_TYPE, const Vrml_FaceType aFaceType=Vrml_CONVEX, const Standard_Real aAngle=0.5)
 
void SetVertexOrdering (const Vrml_VertexOrdering aVertexOrdering)
 
Vrml_VertexOrdering VertexOrdering () const
 
void SetShapeType (const Vrml_ShapeType aShapeType)
 
Vrml_ShapeType ShapeType () const
 
void SetFaceType (const Vrml_FaceType aFaceType)
 
Vrml_FaceType FaceType () const
 
void SetAngle (const Standard_Real aAngle)
 
Standard_Real Angle () const
 
Standard_OStreamPrint (Standard_OStream &anOStream) const
 

Detailed Description

defines a ShapeHints node of VRML specifying properties of geometry and its appearance. The ShapeHints node indicates that IndexedFaceSets are solid, contain ordered vertices, or contain convex faces. These hints allow VRML implementations to optimize certain rendering features. Optimizations that may be performed include enabling back-face culling and disabling two-sided lighting. For example, if an object is solid and has ordered vertices, an implementation may turn on backface culling and turn off two-sided lighting. To ensure that an IndexedFaceSet can be viewed from either direction, set shapeType to be UNKNOWN_SHAPE_TYPE. If you know that your shapes are closed and will alwsys be viewed from the outside, set vertexOrdering to be either CLOCKWISE or COUNTERCLOCKWISE (depending on how you built your object), and set shapeType to be SOLID. Placing this near the top of your VRML file will allow the scene to be rendered much faster. The ShapeHints node also affects how default normals are generated. When an IndexedFaceSet has to generate default normals, it uses the creaseAngle field to determine which edges should be smoothly shaded and which ones should have a sharp crease. The crease angle is the angle between surface normals on adjacent polygons. For example, a crease angle of .5 radians (the default value) means that an edge between two adjacent polygonal faces will be smooth shaded if the normals to the two faces form an angle that is less than .5 radians (about 30 degrees). Otherwise, it will be faceted.

Constructor & Destructor Documentation

◆ Vrml_ShapeHints()

Vrml_ShapeHints::Vrml_ShapeHints ( const Vrml_VertexOrdering  aVertexOrdering = Vrml_UNKNOWN_ORDERING,
const Vrml_ShapeType  aShapeType = Vrml_UNKNOWN_SHAPE_TYPE,
const Vrml_FaceType  aFaceType = Vrml_CONVEX,
const Standard_Real  aAngle = 0.5 
)

Member Function Documentation

◆ Angle()

Standard_Real Vrml_ShapeHints::Angle ( ) const

◆ FaceType()

Vrml_FaceType Vrml_ShapeHints::FaceType ( ) const

◆ Print()

Standard_OStream& Vrml_ShapeHints::Print ( Standard_OStream anOStream) const

◆ SetAngle()

void Vrml_ShapeHints::SetAngle ( const Standard_Real  aAngle)

◆ SetFaceType()

void Vrml_ShapeHints::SetFaceType ( const Vrml_FaceType  aFaceType)

◆ SetShapeType()

void Vrml_ShapeHints::SetShapeType ( const Vrml_ShapeType  aShapeType)

◆ SetVertexOrdering()

void Vrml_ShapeHints::SetVertexOrdering ( const Vrml_VertexOrdering  aVertexOrdering)

◆ ShapeType()

Vrml_ShapeType Vrml_ShapeHints::ShapeType ( ) const

◆ VertexOrdering()

Vrml_VertexOrdering Vrml_ShapeHints::VertexOrdering ( ) const

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