Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoNormalBundle Class Reference

The SoNormalBundle class simplifies normal handling. More...

#include <Inventor/bundles/SoNormalBundle.h>

Inheritance diagram for SoNormalBundle:
SoBundle

Public Member Functions

 SoNormalBundle (SoAction *action, SbBool forrendering)
 
 ~SoNormalBundle ()
 
void beginPolygon (void)
 
void endPolygon (void)
 
void generate (int startindex=0, SbBool addtostate=TRUE)
 
const SbVec3fget (int index) const
 
const SbVec3fgetGeneratedNormals (void) const
 
int getNumGeneratedNormals (void) const
 
void initGenerator (int initnum=100)
 
void polygonVertex (const SbVec3f &v)
 
void send (int index) const
 
void set (int32_t num, const SbVec3f *normals)
 
SbBool shouldGenerate (int numneeded)
 
void triangle (const SbVec3f &p1, const SbVec3f &p2, const SbVec3f &p3)
 

Public Attributes

SoNormalGeneratorgenerator
 

Additional Inherited Members

- Protected Member Functions inherited from SoBundle
 SoBundle (SoAction *action)
 
 ~SoBundle ()
 
- Protected Attributes inherited from SoBundle
SoStatestate
 The state of the current action.
 

Detailed Description

The SoNormalBundle class simplifies normal handling.

This class is currently not used in Coin but is provided for API compatibility.

Constructor & Destructor Documentation

◆ SoNormalBundle()

SoNormalBundle::SoNormalBundle ( SoAction * action,
SbBool forrendering )

Constructor.

◆ ~SoNormalBundle()

SoNormalBundle::~SoNormalBundle ( )

Destructor.

Member Function Documentation

◆ beginPolygon()

void SoNormalBundle::beginPolygon ( void )

Start polygon specification. Call polygonVertex() for each vertex in the polygon, and then endPolygon() to close the polygon.

See also
polygonVertex(), endPolygon()

◆ endPolygon()

void SoNormalBundle::endPolygon ( void )

Call to close a polygon.

See also
beginPolygon(), polygonVertex()

◆ generate()

void SoNormalBundle::generate ( int startindex = 0,
SbBool addtostate = TRUE )

Generate normals for the shape. startindex should always be 0 (the SoNonIndexedShape::startIndex field is obsoleted). addtostate should be true if the generated normals should be pushed onto the current state.

◆ get()

const SbVec3f & SoNormalBundle::get ( int index) const

Returns the index'th normal from the state.

◆ getGeneratedNormals()

const SbVec3f * SoNormalBundle::getGeneratedNormals ( void ) const

Returns the number of generated normals.

◆ getNumGeneratedNormals()

int SoNormalBundle::getNumGeneratedNormals ( void ) const

Returns a pointer to the generated normals.

◆ initGenerator()

void SoNormalBundle::initGenerator ( int initnum = 100)

Initializes the normal generator. initnum is a hint that should contain the approximate number of normals to be generated.

◆ polygonVertex()

void SoNormalBundle::polygonVertex ( const SbVec3f & v)

Call for each vertex in a polygon.

See also
beginPolygon(), endPolygon()

◆ send()

void SoNormalBundle::send ( int index) const

Send the index'th normal to OpenGL.

◆ set()

void SoNormalBundle::set ( int32_t num,
const SbVec3f * normals )

Can be used by nodes that generate their own normals. The state will be updated with the new normals, and the state will be popped again when the SoNormalBundle destructor is called.

◆ shouldGenerate()

SbBool SoNormalBundle::shouldGenerate ( int numneeded)

Returns FALSE if there are normals on the state. Otherwise initGenerator() is called with numneeded as argument, and TRUE is returned.

◆ triangle()

void SoNormalBundle::triangle ( const SbVec3f & p1,
const SbVec3f & p2,
const SbVec3f & p3 )

Convenience method to specify a triangle. p1, p2, and p3 are the triangles vertices.


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