Public Member Functions

ICurve Class Reference

Search for all occurrences

Detailed Description

See also:
Class ReferenceTarget, Class ICurveCtl, Class CurvePoint, COLORREF, Class BitArray.

Description:
This class is available in release 3.0 and later only.

This class is an interface to a single curve used by a ICurveCtl. A pointer to one of these is returned from the method ICurveCtl::GetControlCurve().

All methods of this class are implemented by the system.

#include <icurvctl.h>

Inheritance diagram for ICurve:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  SetPenProperty (COLORREF color, int width=0, int style=PS_SOLID)=0
virtual void  GetPenProperty (COLORREF &color, int &width, int &style)=0
virtual void  SetDisabledPenProperty (COLORREF color, int width=0, int style=PS_SOLID)=0
virtual void  GetDisabledPenProperty (COLORREF &color, int &width, int &style)=0
virtual float  GetValue (TimeValue t, float fX, Interval &ivalid=FOREVER, BOOL UseLookupTable=FALSE)=0
virtual void  SetCanBeAnimated (BOOL Animated)=0
virtual BOOL  GetCanBeAnimated ()=0
virtual int  IsAnimated (int index)=0
virtual int  GetNumPts ()=0
virtual void  SetNumPts (int count)=0
virtual BitArray  GetSelectedPts ()=0
virtual void  SetSelectedPts (BitArray &sel, int flags)=0
virtual void  SetPoint (TimeValue t, int index, CurvePoint *point, BOOL CheckConstraints=TRUE, BOOL notify=TRUE)=0
virtual CurvePoint  GetPoint (TimeValue t, int index, Interval &valid=FOREVER)=0
virtual void  SetOutOfRangeType (int type)=0
virtual int  GetOutOfRangeType ()=0
virtual int  Insert (int where, CurvePoint &p)=0
virtual int  Insert (int where, CurvePoint &p, BOOL do_not_hold)=0
virtual void  Delete (int index)=0
virtual void  SetLookupTableSize (int size)=0
virtual int  GetLookupTableSize ()=0

Member Function Documentation

virtual void SetPenProperty ( COLORREF  color,
int  width = 0,
int  style = PS_SOLID 
) [pure virtual]
Remarks:
Sets the pen properties of a curve
Parameters:
COLORREF color

The color for the curve lines.

int width = 0

The width of the lines in pixels.

int style = PS_SOLID

The pen style to use. One of the following types may be used. See the Win32 API Reference for more information on pen styles.

PS_SOLID

PS_DASH

PS_DOT

PS_DASHDOT

PS_DASHDOTDOT

PS_NULL

PS_INSIDEFRAME
virtual void GetPenProperty ( COLORREF &  color,
int &  width,
int &  style 
) [pure virtual]
Remarks:
Retrieves the color, width and style of a curve.
Parameters:
COLORREF &color

The color in use.

int &width

The width in use.

int &style

The style in use. One of the following types:

PS_SOLID

PS_DASH

PS_DOT

PS_DASHDOT

PS_DASHDOTDOT

PS_NULL

PS_INSIDEFRAME
virtual void SetDisabledPenProperty ( COLORREF  color,
int  width = 0,
int  style = PS_SOLID 
) [pure virtual]
Remarks:
Sets the pen properties of a curve if it is disabled.
Parameters:
COLORREF color

The color to set.

int width = 0

The width to set.

int style = PS_SOLID

The style to set. One of the following types:

PS_SOLID

PS_DASH

PS_DOT

PS_DASHDOT

PS_DASHDOTDOT

PS_NULL

PS_INSIDEFRAME
virtual void GetDisabledPenProperty ( COLORREF &  color,
int &  width,
int &  style 
) [pure virtual]
Remarks:
Retrieves the color of a curve if it is disabled.
Parameters:
COLORREF &color

The color in use.

int &width

The width in use.

int &style

The style in use. One of the following types:

PS_SOLID

PS_DASH

PS_DOT

PS_DASHDOT

PS_DASHDOTDOT

PS_NULL

PS_INSIDEFRAME
virtual float GetValue ( TimeValue  t,
float  fX,
Interval ivalid = FOREVER,
BOOL  UseLookupTable = FALSE 
) [pure virtual]
Remarks:
Returns the Y-value for a given X-Value of the curve. Note that values outside the X-range are extrapolated from the curve using a straight line based on the tangents of the first or last point.
Parameters:
TimeValue t

The time to get the value.

float fX

The input X value.

Interval &ivalid = FOREVER

The validity interval which is updated by this method to reflect the validity of the curve.

BOOL UseLookupTable = FALSE

If TRUE a lookup table is used to get the value (for speed). If FALSE the value is computed.

This is used to speed up value access. The default value for the lookup table size is 1000. The lookup table will be calculated whenever this method is called with TRUE and the current lookup table is not initialized yet, or invalid (it will be invalidated, when a point or tangent is moved, or the time has changed in case it is animated).
virtual void SetCanBeAnimated ( BOOL  Animated ) [pure virtual]
Remarks:
Sets if the curve can be animated or not.
Parameters:
BOOL Animated

TRUE if it can be animated; FALSE if it can't.
virtual BOOL GetCanBeAnimated ( ) [pure virtual]
Remarks:
Returns TRUE if the curve can be animated; otherwise FALSE.
virtual int IsAnimated ( int  index ) [pure virtual]
Remarks:
Returns nonzero if the specified point is animated; otherwise zero.
Parameters:
int index

The zero based index of the curve to check.
virtual int GetNumPts ( ) [pure virtual]
Remarks:
Returns the number of points in the curve.
virtual void SetNumPts ( int  count ) [pure virtual]
Remarks:
Sets the number of points in the curve.
Parameters:
int count

The number to set.
virtual BitArray GetSelectedPts ( ) [pure virtual]
Remarks:
Returns a BitArray which contains the selected / de-selected state for each point. The BitArray is GetNumPts() in size where the 0-th bit corresponds to the 0-th point.
virtual void SetSelectedPts ( BitArray sel,
int  flags 
) [pure virtual]
Remarks:
Sets the selected state of the points in the curve using the BitArray passed. Bits which are are affected as specified by the flags.
Parameters:
BitArray &sel

Specifies which points are affected. The 0-th bit corresponds to the 0-th point.

int flags

One or more of the following values:

SELPTS_SELECT

Select the points.

SELPTS_DESELECT

De-select the points.

SELPTS_CLEARPTS

If this bit is set the method de-selects (clears) all the points before performing the operation as specified by the flags above.
virtual void SetPoint ( TimeValue  t,
int  index,
CurvePoint point,
BOOL  CheckConstraints = TRUE,
BOOL  notify = TRUE 
) [pure virtual]
Remarks:
Sets the specified point at the time passed.
Parameters:
TimeValue t

The time at which to set the point.

int index

The zero based index of the point in the curve.

CurvePoint *point

Points to the curve point to set.

BOOL CheckConstraints = TRUE

When you're setting a point, it checks the in and outtan handles to prevent them from going beyond the previous or next point's location, since that would create an invalid curve. Thus the Curve Control will adjust the tangents due to the constraints. However, if you set the first point, there is no next point, to check the tangent location against, thus you have to have a possibility to turn CheckConstraints off, so the constraints won't be checked (developers have to make sure that they are inserting valid points/tangents. )

BOOL notify = TRUE

This parameter is available in release 4.0 and later only.

This allows developers to control whether the command sends windows messages or not. When set to FALSE windows messages are not sent to the message handler. This lets developers constrain points when the user attempts to move them without getting into a message loop. When TRUE messages are sent.
virtual CurvePoint GetPoint ( TimeValue  t,
int  index,
Interval valid = FOREVER 
) [pure virtual]
Remarks:
Retrieves data about the specfied point and updates the validity interval to reflect the validity of the point's controller.
Parameters:
TimeValue t

The time to get the data.

int index

The zero based index of the point.

Interval &valid = FOREVER

The validity interval which is updated.
virtual void SetOutOfRangeType ( int  type ) [pure virtual]
Remarks:
This method allows you to set the out of range type.
Parameters:
int type

Currently these types are supported;

CURVE_EXTRAPOLATE_LINEAR

CURVE_EXTRAPOLATE_CONSTANT
virtual int GetOutOfRangeType ( ) [pure virtual]
Remarks:
This method returns the out of range type.
Returns:
One of the following; CURVE_EXTRAPOLATE_LINEAR, CURVE_EXTRAPOLATE_CONSTANT
virtual int Insert ( int  where,
CurvePoint p 
) [pure virtual]
Remarks:
Inserts the specified point at the location passed.
Parameters:
int where

This value becomes the new index of the point.

CurvePoint &p

The point to insert.
Returns:
Nonzero if the point was inserted; otherwise zero.
virtual int Insert ( int  where,
CurvePoint p,
BOOL  do_not_hold 
) [pure virtual]
Remarks:
This is identical to the Insert above but allows you to turn off/on the hold that occurs.this is useful when you are doing interactive inserts and moves from code, the original Insert hold would often get in the way
Parameters:
int where

This value becomes the new index of the point.

CurvePoint &p

The point to insert.

BOOL do_not_hold

TRUE in order not to hold; otherwise FALSE.
Returns:
Nonzero if the point was inserted; otherwise zero.
virtual void Delete ( int  index ) [pure virtual]
Remarks:
Deletes the point whose index is passed.
Parameters:
int index

The zero based index of the point to delete.
virtual void SetLookupTableSize ( int  size ) [pure virtual]
Remarks:
This method sets the size of the Curve Control lookup table. The lookup table allows users of the Curve Control to easily speed up their value access. The default value for the lookup table size is 1000. The lookup table will be calculated whenever GetValue() is called with the parameter UseLookupTable==TRUE and the current LookupTable is not initialized yet, or invalid (it will be invalidated, when a point or tangent is moved, or the time has changed in case it is animated).
Parameters:
int size

The size to set.
virtual int GetLookupTableSize ( ) [pure virtual]
Remarks:
Returns the current size of the lookup table. See SetLookupTableSize() above.

ICurve ICurve ICurve ICurve ICurve ICurve ICurve ICurve ICurve ICurve
ICurve ICurve ICurve ICurve ICurve ICurve ICurve ICurve ICurve ICurve