HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Ramp Class Reference

Utility class for containing a color ramp. More...

#include <UT_Ramp.h>

Public Member Functions

 UT_Ramp ()
 
 UT_Ramp (const UT_Ramp &copy)
 
 ~UT_Ramp ()
 
int64 getMemoryUsage (bool inclusive) const
 Return the amount of memory owned by this UT_Ramp in bytes. More...
 
void setColorType (UT_ColorType color_space)
 
UT_ColorType getColorType () const
 
void clearAndDestroy ()
 
void ensureRampIsBuilt ()
 Force updating of the ramp after being modified. More...
 
bool getGlobalEnable () const
 
void setGlobalEnable (bool enable)
 
int getNodeCount () const
 
const UT_ColorNodegetNode (int i) const
 
UT_ColorNodegetRamp ()
 
const UT_ColorNodegetRamp () const
 
void convertToRaster (UT_Raster *raster, UT_RampOrient dir, int doInterping=1, fpreal cx=0.0f, fpreal cy=0.0f, fpreal phase=0.0f, fpreal radius=1.0f)
 
const UT_ColorNodegetClosestNode (fpreal pos) const
 
int getClosestNodeIndex (fpreal pos) const
 
const UT_ColorNodegetCurrentNode () const
 
int getCurrentNodeIndex () const
 
void setCurrentNodeIndex (int i, bool add_to_selection)
 
void getColor (fpreal pos, UT_FRGBA *clr, int doInterping=1) const
 
void getColor (fpreal pos, float fvals[4], int doInterping=1) const
 
void getColor (UT_FRGBA *values, int num, int doInterping=1) const
 
void setColorAt (int i, float fvals[4])
 
void setColorAt (int i, const UT_FRGBA &clr)
 
void setCurrentNodeColor (fpreal32 fvals[4])
 
void setCurrentNodeColor (fpreal64 fvals[4])
 
void setCurrentNodeColor (const UT_FRGBA &clr)
 
void setCurrentNodeBasis (UT_SPLINE_BASIS basis)
 
void setNodeBasis (int i, UT_SPLINE_BASIS basis)
 
void setEnable (int i, bool enable_pos, bool enable_val, bool enable_interp)
 
bool getEnablePos (int i) const
 
bool getEnableVal (int i) const
 
bool getEnableInterp (int i) const
 
void clearSelection ()
 
bool isNodeSelected (int i)
 
void selectNode (int i, bool add)
 
void selectRange (int first_i, int last_i, bool add)
 
void deselectNode (int i)
 
void toggleSelectNode (int i)
 
void getSelectionIndices (UT_IntArray &indices)
 
void setSelectionIndices (const UT_IntArray &indices)
 
void addNode (fpreal pos)
 
void addNode (fpreal pos, fpreal32 fvals[4], UT_SPLINE_BASIS basis=UT_SPLINE_LINEAR)
 
void addNode (fpreal pos, fpreal64 fvals[4], UT_SPLINE_BASIS basis=UT_SPLINE_LINEAR)
 
void addNode (fpreal pos, const UT_FRGBA &color, UT_SPLINE_BASIS basis=UT_SPLINE_LINEAR)
 
bool deleteNode (fpreal pos)
 
bool deleteNodeAt (int i)
 
void deleteSelectedNodes ()
 
void moveNode (const UT_ColorNode *node, fpreal pos)
 
void moveNodeSelection (int node_i, fpreal pos)
 
int load (const char *pathname)
 
bool load (UT_IStream &is)
 
int save (const char *pathname) const
 
int save (std::ostream &os) const
 
UT_Rampoperator= (const UT_Ramp &from)
 
bool operator== (const UT_Ramp &from) const
 
void setRamp (const UT_ColorNode *r, int size)
 
void rampLookup (fpreal pos, float values[4]) const
 
void rampLookupNoInterp (fpreal pos, float values[4]) const
 
void rampLookup (fpreal u0, fpreal u1, float values[4], int ns) const
 
void rampLookupNoInterp (fpreal u0, fpreal u1, float values[4], int ns) const
 
template<typename ARCHIVER_T >
bool serialize (ARCHIVER_T &archiver)
 
bool resolveOpRamp (const char *op_path, const char *ramp_parm, bool *is_rgb=NULL, int *op_id=NULL, int *op_version=NULL)
 

Static Public Member Functions

static void setRampOpResolver (UT_RampOpResolver *resolver)
 

Detailed Description

Utility class for containing a color ramp.

Definition at line 84 of file UT_Ramp.h.

Constructor & Destructor Documentation

UT_Ramp::UT_Ramp ( )
UT_Ramp::UT_Ramp ( const UT_Ramp copy)
explicit

Do not pass by value, you should be passing by const &. If you really need by value make the copy internally to your system.

UT_Ramp::~UT_Ramp ( )

Member Function Documentation

void UT_Ramp::addNode ( fpreal  pos)
void UT_Ramp::addNode ( fpreal  pos,
fpreal32  fvals[4],
UT_SPLINE_BASIS  basis = UT_SPLINE_LINEAR 
)
void UT_Ramp::addNode ( fpreal  pos,
fpreal64  fvals[4],
UT_SPLINE_BASIS  basis = UT_SPLINE_LINEAR 
)
void UT_Ramp::addNode ( fpreal  pos,
const UT_FRGBA color,
UT_SPLINE_BASIS  basis = UT_SPLINE_LINEAR 
)
void UT_Ramp::clearAndDestroy ( )
void UT_Ramp::clearSelection ( )
void UT_Ramp::convertToRaster ( UT_Raster raster,
UT_RampOrient  dir,
int  doInterping = 1,
fpreal  cx = 0.0f,
fpreal  cy = 0.0f,
fpreal  phase = 0.0f,
fpreal  radius = 1.0f 
)
bool UT_Ramp::deleteNode ( fpreal  pos)
bool UT_Ramp::deleteNodeAt ( int  i)
void UT_Ramp::deleteSelectedNodes ( )
void UT_Ramp::deselectNode ( int  i)
void UT_Ramp::ensureRampIsBuilt ( )

Force updating of the ramp after being modified.

const UT_ColorNode* UT_Ramp::getClosestNode ( fpreal  pos) const
int UT_Ramp::getClosestNodeIndex ( fpreal  pos) const
void UT_Ramp::getColor ( fpreal  pos,
UT_FRGBA clr,
int  doInterping = 1 
) const
void UT_Ramp::getColor ( fpreal  pos,
float  fvals[4],
int  doInterping = 1 
) const
void UT_Ramp::getColor ( UT_FRGBA values,
int  num,
int  doInterping = 1 
) const
UT_ColorType UT_Ramp::getColorType ( ) const
inline

Definition at line 98 of file UT_Ramp.h.

const UT_ColorNode* UT_Ramp::getCurrentNode ( ) const
int UT_Ramp::getCurrentNodeIndex ( ) const
bool UT_Ramp::getEnableInterp ( int  i) const
bool UT_Ramp::getEnablePos ( int  i) const
bool UT_Ramp::getEnableVal ( int  i) const
bool UT_Ramp::getGlobalEnable ( ) const
inline

Definition at line 106 of file UT_Ramp.h.

int64 UT_Ramp::getMemoryUsage ( bool  inclusive) const

Return the amount of memory owned by this UT_Ramp in bytes.

const UT_ColorNode* UT_Ramp::getNode ( int  i) const
int UT_Ramp::getNodeCount ( ) const
inline

Definition at line 111 of file UT_Ramp.h.

UT_ColorNode* UT_Ramp::getRamp ( )
inline

Definition at line 114 of file UT_Ramp.h.

const UT_ColorNode* UT_Ramp::getRamp ( ) const
inline

Definition at line 116 of file UT_Ramp.h.

void UT_Ramp::getSelectionIndices ( UT_IntArray indices)
bool UT_Ramp::isNodeSelected ( int  i)
int UT_Ramp::load ( const char *  pathname)
bool UT_Ramp::load ( UT_IStream is)
void UT_Ramp::moveNode ( const UT_ColorNode node,
fpreal  pos 
)
void UT_Ramp::moveNodeSelection ( int  node_i,
fpreal  pos 
)
UT_Ramp& UT_Ramp::operator= ( const UT_Ramp from)
bool UT_Ramp::operator== ( const UT_Ramp from) const
void UT_Ramp::rampLookup ( fpreal  pos,
float  values[4] 
) const
void UT_Ramp::rampLookup ( fpreal  u0,
fpreal  u1,
float  values[4],
int  ns 
) const
void UT_Ramp::rampLookupNoInterp ( fpreal  pos,
float  values[4] 
) const
void UT_Ramp::rampLookupNoInterp ( fpreal  u0,
fpreal  u1,
float  values[4],
int  ns 
) const
bool UT_Ramp::resolveOpRamp ( const char *  op_path,
const char *  ramp_parm,
bool *  is_rgb = NULL,
int op_id = NULL,
int op_version = NULL 
)

Fetch the ramp from an OP node's ramp parm. May return false if the OP or parm is not found, if the parm is not a ramp, or if the UT_RampOpResolver is not assigned by setRampOpResolver(). is_rgb, op_id, and op_version are optional return values for the type of ramp, the parent node's unique ID, and the parent node's version parm serial (as reported by getVersionParms()).

int UT_Ramp::save ( const char *  pathname) const
int UT_Ramp::save ( std::ostream &  os) const
void UT_Ramp::selectNode ( int  i,
bool  add 
)
void UT_Ramp::selectRange ( int  first_i,
int  last_i,
bool  add 
)
template<typename ARCHIVER_T >
bool UT_Ramp::serialize ( ARCHIVER_T &  archiver)
void UT_Ramp::setColorAt ( int  i,
float  fvals[4] 
)
void UT_Ramp::setColorAt ( int  i,
const UT_FRGBA clr 
)
void UT_Ramp::setColorType ( UT_ColorType  color_space)
inline

Definition at line 96 of file UT_Ramp.h.

void UT_Ramp::setCurrentNodeBasis ( UT_SPLINE_BASIS  basis)
void UT_Ramp::setCurrentNodeColor ( fpreal32  fvals[4])
void UT_Ramp::setCurrentNodeColor ( fpreal64  fvals[4])
void UT_Ramp::setCurrentNodeColor ( const UT_FRGBA clr)
void UT_Ramp::setCurrentNodeIndex ( int  i,
bool  add_to_selection 
)
void UT_Ramp::setEnable ( int  i,
bool  enable_pos,
bool  enable_val,
bool  enable_interp 
)
void UT_Ramp::setGlobalEnable ( bool  enable)
inline

Definition at line 108 of file UT_Ramp.h.

void UT_Ramp::setNodeBasis ( int  i,
UT_SPLINE_BASIS  basis 
)
void UT_Ramp::setRamp ( const UT_ColorNode r,
int  size 
)
static void UT_Ramp::setRampOpResolver ( UT_RampOpResolver resolver)
static

Install an OP node resolver for ramp parameters. Required for resolveOpRamp() to work. OP_Director calls this.

void UT_Ramp::setSelectionIndices ( const UT_IntArray indices)
void UT_Ramp::toggleSelectNode ( int  i)

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