Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

vtkPaletteElement Class Reference

#include <vtkPaletteElement.h>

Inheritance diagram for vtkPaletteElement:

Inheritance graph
[legend]
Collaboration diagram for vtkPaletteElement:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract base element for palette objects.

Author:
Sean McInerney
Version:
Revision
1.1
Date:
Date
2004/06/02 11:35:08
See also:
vtkExtensionsObject

Definition at line 46 of file vtkPaletteElement.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkPaletteElement, vtkExtensionsObject)
void PrintSelf (ostream &, vtkIndent)
virtual vtkPaletteElementGetParent (void) const
 Get the parent palette of this palette.

 vtkGetXMLStringMacro (ID, vtkXMLChType)
 Get the id attribute of this palette element.

 vtkGetXMLStringMacro (Name, vtkXMLChType)
 Get the name attribute of this palette element.

virtual const vtkXMLChTypeGetTagName (void) const =0
 Get the XML tag name for marshalling / unmarshalling.

virtual int GetType (void) const
 Get an enumeration of the element type.

virtual int IsRoot (void) const
 Is this palette element a root node (i.e.

virtual int IsLeaf (void) const
 Is this palette element a leaf node (i.e.

virtual int IsEmpty (void) const
 Returns true if the palette is empty.

virtual vtkIdType GetSize (void) const
 Returns the total number of elements in the palette including children.

virtual vtkIdType GetCapacity (void) const
 Returns the total number of elements that can be held by this object.

virtual vtkPaletteElementFind (const char *name) const
 Find an element associated with a name as a child of this object.

virtual int Insert (vtkPaletteElement *element)
 Add an element to this object.

virtual int Erase (const char *name)
 Erase an element associated with a name from this object.

void Marshal (ostream &target, vtkIndent indent)
 Serialize object to an output stream.

void UnmarshalAttributes (const vtkXMLChType **attrs)
 Unmarshal (read) XML element attributes into this object.

virtual void UnmarshalContent (const vtkXMLChType *const &content)
 Unmarshal (read) XML element content into this object.

 vtkGetXMLStringMacro (Description, vtkXMLChType)
 Get/Set the name attribute of this palette element.

 vtkSetXMLStringMacro (Description, vtkXMLChType)
 Get/Set the name attribute of this palette element.


Static Public Member Functions

Color and Material Format Conversion Methods
void ConvertColor (unsigned char const &c0, unsigned char const &c1, unsigned char const &c2, unsigned char const &alpha, vtkColorWord &color)
 Convert color component bytes into a packed color word.

void ConvertColor (double const &c0, double const &c1, double const &c2, double const &alpha, vtkColorWord &color)
 Convert color component floats into a packed color word.

void ConvertColor (vtkColorWord const &color, unsigned char &c0, unsigned char &c1, unsigned char &c2, unsigned char &alpha)
 Convert a packed color word into color component bytes.

void ConvertColor (vtkColorWord const &color, double &c0, double &c1, double &c2, double &alpha)
 Convert a packed color word into color component floats.

void ConvertColor (double const &c0, double const &c1, double const &c2, double const &alpha, vtkMaterial &material)
 Convert color component floats into a material structure.

void ConvertColor (unsigned char const &c0, unsigned char const &c1, unsigned char const &c2, unsigned char const &alpha, vtkMaterial &material)
 Convert color component bytes into a material structure.

void ConvertColor (vtkColorWord const &color, vtkMaterial &material)
 Convert a packed color word into a material structure.

void ConvertMaterial (vtkMaterial const &material, double &c0, double &c1, double &c2, double &alpha)
 Convert a material structure into color component floats.

void ConvertMaterial (vtkMaterial const &material, unsigned char &c0, unsigned char &c1, unsigned char &c2, unsigned char &alpha)
 Convert a material structure into color component bytes.

void ConvertMaterial (vtkMaterial const &material, vtkColorWord &color)
 Convert a material structure into a packed color word.


Static Public Attributes

const vtkXMLChType *const idString
const vtkXMLChType *const nameString
const vtkXMLChType *const descriptionString

Protected Member Functions

 vtkPaletteElement (void)
 ~vtkPaletteElement ()
virtual void SetParent (vtkPaletteElement *)
void SetID (const vtkXMLChType *const &)
 Set the id attribute of this palette element.

 vtkSetXMLStringMacro (Name, vtkXMLChType)
 Set the name attribute of this palette element.

virtual void MarshalAttributes (ostream &target)
virtual void MarshalContent (ostream &target, vtkIndent indent)
virtual void UnmarshalAttribute (const vtkXMLChType *const &attr, const vtkXMLChType *const &value)

Protected Attributes

vtkPaletteElementParent
vtkXMLChTypeID
vtkXMLChTypeName
vtkXMLChTypeDescription


Constructor & Destructor Documentation

vtkPaletteElement::vtkPaletteElement void   )  [protected]
 

vtkPaletteElement::~vtkPaletteElement  )  [protected]
 


Member Function Documentation

void vtkPaletteElement::ConvertColor vtkColorWord const &  color,
vtkMaterial material
[inline, static]
 

Convert a packed color word into a material structure.

Definition at line 412 of file vtkPaletteElement.h.

References ConvertColor(), VTK_EXTENSIONS_GET_RGBA_A, VTK_EXTENSIONS_GET_RGBA_B, VTK_EXTENSIONS_GET_RGBA_G, and VTK_EXTENSIONS_GET_RGBA_R.

void vtkPaletteElement::ConvertColor unsigned char const &  c0,
unsigned char const &  c1,
unsigned char const &  c2,
unsigned char const &  alpha,
vtkMaterial material
[inline, static]
 

Convert color component bytes into a material structure.

Definition at line 397 of file vtkPaletteElement.h.

References ConvertColor(), and VTK_EXTENSIONS_RGB_MAX.

void vtkPaletteElement::ConvertColor double const &  c0,
double const &  c1,
double const &  c2,
double const &  alpha,
vtkMaterial material
[inline, static]
 

Convert color component floats into a material structure.

Definition at line 384 of file vtkPaletteElement.h.

References ConvertColor(), vtkMaterial::Ka, vtkMaterial::Kd, and vtkMaterial::Ks.

void vtkPaletteElement::ConvertColor vtkColorWord const &  color,
double &  c0,
double &  c1,
double &  c2,
double &  alpha
[inline, static]
 

Convert a packed color word into color component floats.

Definition at line 366 of file vtkPaletteElement.h.

References ConvertColor(), and VTK_EXTENSIONS_RGB_MAX.

void vtkPaletteElement::ConvertColor vtkColorWord const &  color,
unsigned char &  c0,
unsigned char &  c1,
unsigned char &  c2,
unsigned char &  alpha
[inline, static]
 

Convert a packed color word into color component bytes.

Definition at line 353 of file vtkPaletteElement.h.

References ConvertColor(), VTK_EXTENSIONS_GET_RGBA_A, VTK_EXTENSIONS_GET_RGBA_B, VTK_EXTENSIONS_GET_RGBA_G, and VTK_EXTENSIONS_GET_RGBA_R.

void vtkPaletteElement::ConvertColor double const &  c0,
double const &  c1,
double const &  c2,
double const &  alpha,
vtkColorWord color
[inline, static]
 

Convert color component floats into a packed color word.

Definition at line 334 of file vtkPaletteElement.h.

References ConvertColor(), and VTK_EXTENSIONS_RGB_MAX.

void vtkPaletteElement::ConvertColor unsigned char const &  c0,
unsigned char const &  c1,
unsigned char const &  c2,
unsigned char const &  alpha,
vtkColorWord color
[inline, static]
 

Convert color component bytes into a packed color word.

Definition at line 324 of file vtkPaletteElement.h.

References ConvertColor(), VTK_EXTENSIONS_MAKE_RGBA, and vtkColorWord.

Referenced by ConvertColor().

void vtkPaletteElement::ConvertMaterial vtkMaterial const &  material,
vtkColorWord color
[inline, static]
 

Convert a material structure into a packed color word.

Definition at line 476 of file vtkPaletteElement.h.

References ConvertMaterial(), and VTK_EXTENSIONS_MAKE_RGBA.

void vtkPaletteElement::ConvertMaterial vtkMaterial const &  material,
unsigned char &  c0,
unsigned char &  c1,
unsigned char &  c2,
unsigned char &  alpha
[inline, static]
 

Convert a material structure into color component bytes.

Definition at line 455 of file vtkPaletteElement.h.

References ConvertMaterial(), and VTK_EXTENSIONS_RGB_MAX.

void vtkPaletteElement::ConvertMaterial vtkMaterial const &  material,
double &  c0,
double &  c1,
double &  c2,
double &  alpha
[inline, static]
 

Convert a material structure into color component floats.

Definition at line 428 of file vtkPaletteElement.h.

References ConvertMaterial(), vtkMaterial::Ka, vtkMaterial::Kd, vtkMaterial::Ks, and MAX3.

Referenced by ConvertMaterial().

int vtkPaletteElement::Erase const char *  name  )  [inline, virtual]
 

Erase an element associated with a name from this object.

Parameters:
name The name of the element to be erased.
Returns:
true on success, false otherwise.

Reimplemented in vtkPalette, and vtkPaletteMaterial.

Definition at line 317 of file vtkPaletteElement.h.

References Erase(), and VTK_FALSE.

Referenced by Erase().

vtkPaletteElement * vtkPaletteElement::Find const char *  name  )  const [inline, virtual]
 

Find an element associated with a name as a child of this object.

Parameters:
name The full path name of the element to be found.
Returns:
The element associated with the specified name if found or NULL if the name is removed, empty, or non-existant.

Reimplemented in vtkPalette, and vtkPaletteMaterial.

Definition at line 305 of file vtkPaletteElement.h.

References Find().

Referenced by Find().

vtkIdType vtkPaletteElement::GetCapacity void   )  const [inline, virtual]
 

Returns the total number of elements that can be held by this object.

Reimplemented in vtkPalette, and vtkPaletteMaterial.

Definition at line 299 of file vtkPaletteElement.h.

vtkPaletteElement * vtkPaletteElement::GetParent void   )  const [inline, virtual]
 

Get the parent palette of this palette.

Reimplemented in vtkPalette, vtkPaletteAmbientColor, vtkPaletteDiffuseColor, and vtkPaletteSpecularColor.

Definition at line 263 of file vtkPaletteElement.h.

References Parent.

vtkIdType vtkPaletteElement::GetSize void   )  const [inline, virtual]
 

Returns the total number of elements in the palette including children.

Reimplemented in vtkPalette, and vtkPaletteMaterial.

Definition at line 293 of file vtkPaletteElement.h.

virtual const vtkXMLChType* vtkPaletteElement::GetTagName void   )  const [pure virtual]
 

Get the XML tag name for marshalling / unmarshalling.

Implemented in vtkPalette, vtkPaletteAmbientColor, vtkPaletteColor, vtkPaletteDiffuseColor, vtkPaletteMaterial, and vtkPaletteSpecularColor.

int vtkPaletteElement::GetType void   )  const [inline, virtual]
 

Get an enumeration of the element type.

Reimplemented in vtkAbstractPaletteMaterial, vtkPalette, vtkPaletteAmbientColor, vtkPaletteColor, vtkPaletteDiffuseColor, vtkPaletteMaterial, and vtkPaletteSpecularColor.

Definition at line 269 of file vtkPaletteElement.h.

References VTK_PALETTE_NONE.

int vtkPaletteElement::Insert vtkPaletteElement element  )  [inline, virtual]
 

Add an element to this object.

Parameters:
element A pointer to the element to be added.
Note:
The element is added directly to this object using the name attribute of the element as the key. The insertion will fail if the name attribute is empty. The insertion will also fail if this object cannot accept children.
Returns:
true on success, false otherwise.

Reimplemented in vtkPalette.

Definition at line 311 of file vtkPaletteElement.h.

References Insert(), and VTK_FALSE.

Referenced by Insert().

int vtkPaletteElement::IsEmpty void   )  const [inline, virtual]
 

Returns true if the palette is empty.

Reimplemented in vtkPalette, and vtkPaletteMaterial.

Definition at line 287 of file vtkPaletteElement.h.

References VTK_TRUE.

int vtkPaletteElement::IsLeaf void   )  const [inline, virtual]
 

Is this palette element a leaf node (i.e.

cannot have children).

Reimplemented in vtkPalette, and vtkPaletteMaterial.

Definition at line 281 of file vtkPaletteElement.h.

References VTK_TRUE.

int vtkPaletteElement::IsRoot void   )  const [inline, virtual]
 

Is this palette element a root node (i.e.

cannot have parent).

Reimplemented in vtkPalette.

Definition at line 275 of file vtkPaletteElement.h.

References VTK_FALSE.

void vtkPaletteElement::Marshal ostream &  target,
vtkIndent  indent
 

Serialize object to an output stream.

virtual void vtkPaletteElement::MarshalAttributes ostream &  target  )  [protected, virtual]
 

Reimplemented in vtkAbstractPaletteMaterial, vtkPalette, vtkPaletteColor, vtkPaletteDiffuseColor, and vtkPaletteSpecularColor.

virtual void vtkPaletteElement::MarshalContent ostream &  target,
vtkIndent  indent
[inline, protected, virtual]
 

Reimplemented in vtkPalette, vtkPaletteColorBase, and vtkPaletteMaterial.

Definition at line 221 of file vtkPaletteElement.h.

void vtkPaletteElement::PrintSelf ostream &  ,
vtkIndent 
[virtual]
 

Reimplemented from vtkExtensionsObject.

Reimplemented in vtkPalette, vtkPaletteColor, vtkPaletteColorBase, vtkPaletteDiffuseColor, vtkPaletteMaterial, and vtkPaletteSpecularColor.

void vtkPaletteElement::SetID const vtkXMLChType *const &   )  [inline, protected]
 

Set the id attribute of this palette element.

Definition at line 246 of file vtkPaletteElement.h.

References vtkStringOps::ToLatin1::data(), ID, SetID(), and vtkSetXMLStringBodyMacro.

Referenced by SetID().

virtual void vtkPaletteElement::SetParent vtkPaletteElement  )  [protected, virtual]
 

virtual void vtkPaletteElement::UnmarshalAttribute const vtkXMLChType *const &  attr,
const vtkXMLChType *const &  value
[protected, virtual]
 

Reimplemented in vtkAbstractPaletteMaterial, vtkPalette, vtkPaletteColor, vtkPaletteDiffuseColor, and vtkPaletteSpecularColor.

void vtkPaletteElement::UnmarshalAttributes const vtkXMLChType **  attrs  ) 
 

Unmarshal (read) XML element attributes into this object.

virtual void vtkPaletteElement::UnmarshalContent const vtkXMLChType *const &  content  )  [inline, virtual]
 

Unmarshal (read) XML element content into this object.

Reimplemented in vtkPaletteColorBase.

Definition at line 129 of file vtkPaletteElement.h.

vtkPaletteElement::vtkGetXMLStringMacro Description  ,
vtkXMLChType 
 

Get/Set the name attribute of this palette element.

vtkPaletteElement::vtkGetXMLStringMacro Name  ,
vtkXMLChType 
 

Get the name attribute of this palette element.

vtkPaletteElement::vtkGetXMLStringMacro ID  ,
vtkXMLChType 
 

Get the id attribute of this palette element.

vtkPaletteElement::vtkSetXMLStringMacro Name  ,
vtkXMLChType 
[protected]
 

Set the name attribute of this palette element.

vtkPaletteElement::vtkSetXMLStringMacro Description  ,
vtkXMLChType 
 

Get/Set the name attribute of this palette element.

vtkPaletteElement::vtkTypeRevisionMacro vtkPaletteElement  ,
vtkExtensionsObject 
 


Member Data Documentation

vtkXMLChType* vtkPaletteElement::Description [protected]
 

Definition at line 229 of file vtkPaletteElement.h.

const vtkXMLChType* const vtkPaletteElement::descriptionString [static]
 

Definition at line 200 of file vtkPaletteElement.h.

vtkXMLChType* vtkPaletteElement::ID [protected]
 

Definition at line 227 of file vtkPaletteElement.h.

Referenced by SetID().

const vtkXMLChType* const vtkPaletteElement::idString [static]
 

Definition at line 198 of file vtkPaletteElement.h.

vtkXMLChType* vtkPaletteElement::Name [protected]
 

Definition at line 228 of file vtkPaletteElement.h.

const vtkXMLChType* const vtkPaletteElement::nameString [static]
 

Definition at line 199 of file vtkPaletteElement.h.

vtkPaletteElement* vtkPaletteElement::Parent [protected]
 

Definition at line 226 of file vtkPaletteElement.h.

Referenced by GetParent().


The documentation for this class was generated from the following file:
Generated on Tue Aug 10 03:44:00 2004 for vtkExtensions by doxygen 1.3.7