public

Inheritance Graph

graph BT
	ColorCube
	click ColorCube "classMinSG_1_1ColorCube"

Description

class containing color-data used for coloring the faces of node’s bounding box.

Note: a color cube does not contain information about the form/geometry of the color cubes, because it is described by the absolute bounding box stored at the corresponding node.

Note: The processing of color cubes can only be done by an instance of ColorCubeGenerator . It is automatically created when the color cube of any node is required but is missing and then registered at current rendering context. The appropriate color cube is then available at the next frame see ColorCube::buildColorCubes(FrameContext, Node).

Author: Paul Justus

Date: 2010-08-15

Public Functions

   
   
  ColorCube()
   
const Util::Color4ub & getColor( Geometry::side_t side) const

Public Static Functions

   
   
const ColorCube & getColorCube( Node * node)
Return the color cube of the given node. If the node has no color cube, throw an exception.
   
bool hasColorCube( Node * node)
Check if the node has got a color cube.
   
void attachColorCube( Node * node, const ColorCube & cc)
   
void removeColorCube( Node * node, bool recursive)
   
void buildColorCubes( FrameContext & context, Node * node, uint32_t nodeCount, uint32_t triangleCount)

Documentation

function
MinSG::ColorCube::ColorCube

public inline
   
   
ColorCube( )

[ctor] creates a (default) color cube with all faces colored red

Note: use static function buildColorCubes(FrameContext, Node) instead to ensure the existence of a color cube

Defined in MinSG/Ext/ColorCubes/ColorCube.h:60


function
MinSG::ColorCube::getColor

public const inline
     
     
const Util::Color4ub & getColor( Geometry::side_t side ) const

returns the color of the specified side

Returns

the color

Defined in MinSG/Ext/ColorCubes/ColorCube.h:68


function
MinSG::ColorCube::getColorCube

public static
     
     
const ColorCube & getColorCube( Node * node )

Return the color cube of the given node. If the node has no color cube, throw an exception.

Defined in MinSG/Ext/ColorCubes/ColorCube.h:73


function
MinSG::ColorCube::hasColorCube

public static
     
     
bool hasColorCube( Node * node )

Check if the node has got a color cube.

Defined in MinSG/Ext/ColorCubes/ColorCube.h:76


function
MinSG::ColorCube::attachColorCube

public static
     
     
void attachColorCube( Node * node,
  const ColorCube & cc
)    

! Stores the given colorCube in the given Node as nodeAttribute calculates a string representation of the color cube for saving in minsg files and stores it as nodeAttribute

Note: first calculate the color cube and then attach it, do NOT try to create, attach and finally fill the color cube with values

Defined in MinSG/Ext/ColorCubes/ColorCube.h:85


function
MinSG::ColorCube::removeColorCube

public static
     
     
void removeColorCube( Node * node,
  bool recursive
)    

removes the color cube from the specified node. It also removes all color cubes on the path from specified node up to the rootNode. If the second parameter recursive is set to true, color cubes from all nodes in the subtree (with node as its root) are removed recursively (this parameter defaults to true).

Note: this function could/should be used when there is need for recalculating of color cube for any node/subtree

Parameters

node
whose color cube should be removed / root of the subtree in which all color cubes should be removed
recursive
determines whether all color cubes in the subtree should be removed or only the color cube of the specified node.

Defined in MinSG/Ext/ColorCubes/ColorCube.h:97


function
MinSG::ColorCube::buildColorCubes

public static
     
     
void buildColorCubes( FrameContext & context,
  Node * node,
  uint32_t nodeCount,
  uint32_t triangleCount
)    

Defined in MinSG/Ext/ColorCubes/ColorCube.h:102