The SColorGradient class allow the user to edit a color gradient.
You cannot create a new color gradient. You can access to it by calling GetColorGradient() on a SMultiline, SPoly or SCloud. With this class you can manipulate color and cursor position of an existing color gradient.
More...
#include <SColorGradient.h>
|
Array | AddCursor (Number Position) |
| Add a new cursor in the color gradient. More...
|
|
Array | DeleteCursor (Number Index) |
| Remove a peg of the color gradient. More...
|
|
Array | GetColorFromValue (Number value) |
| To color from a specific value in the gradient. More...
|
|
Array | GetColUndefined () |
| To get the undefined color of the color gradient. More...
|
|
Array | GetCursorInfo (Number Index) |
| To get cursor information. More...
|
|
Number | GetNbCursor () |
|
Number | GetNbCursorMax () |
|
Array | GetRange () |
| To get the maximal and minimal value of the color gradient. More...
|
|
Array | SetColAfter (Number Index, Number Red, Number Green, Number Blue, Number Alpha=-1) |
| To set the color of a cursor after the value of the cursor. More...
|
|
Array | SetColBefore (Number Index, Number Red, Number Green, Number Blue, Number Alpha=-1) |
| To set the color of a cursor before the value of the cursor. More...
|
|
| SetColUndefined (Number Red, Number Green, Number Blue, Number Alpha=-1) |
| To set the undefined color of the color gradient. More...
|
|
Array | SetCursorPos (Number Index, Number Position) |
| To set position of an indexed peg. More...
|
|
| SetDisplayOption (DisplayFlag DisplayPalette) |
| You can choose how the palette will be displayed. More...
|
|
| SetInterpolation (Interpolation Method) |
| To define how the color is interpolated between 2 cursors. More...
|
|
| SetMagnification (Number magnification) |
| You can set the magnification (only for polyline inspection) More...
|
|
Array | SetNbCursor (Number NbCursor) |
| To set the number of cursors of the color gradient
You can set from 2 cursors to GetNbCursorMax() cursors, each of the band will have a unique color. More...
|
|
Array | SetRange (Number MinValue, Number MaxValue) |
| To update the min and max values of the color gradient, and delete all invalid pegs. More...
|
|
String | toString () |
| Get the type of the variable. More...
|
|
| Clear () |
| To deallocate memory of the object. More...
|
|
String | toString () |
| Get the type of the variable. More...
|
|
The SColorGradient class allow the user to edit a color gradient.
You cannot create a new color gradient. You can access to it by calling GetColorGradient() on a SMultiline, SPoly or SCloud. With this class you can manipulate color and cursor position of an existing color gradient.
◆ DisplayFlag
Available options for the display of the gradient palette
Use SColorGradient.HIDE.
Enumerator |
---|
HIDE | Gradient is not displayed
|
SHOW_FOREGROUND | Gradient is displayed in foreground
|
SHOW_BACKGROUND | Gradient is displayed in background
|
◆ Interpolation
Interpolation method to define how the color is interpolate between two cursors.
Enumerator |
---|
Linear | |
HSLCounterClockwise | |
HSLClockwise | |
HSLShortest | |
HSLLongest | |
◆ AddCursor
Array SColorGradient::AddCursor |
( |
Number |
Position | ) |
|
|
slot |
Add a new cursor in the color gradient.
- Note
- You cannot add more cursor than the maximal number of cursor allowed
- See also
- GetNbCursorMax()
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Impossible to add a new cursor, limit reached
|
Array.Index | index of your new cursor |
◆ DeleteCursor
Array SColorGradient::DeleteCursor |
( |
Number |
Index | ) |
|
|
slot |
Remove a peg of the color gradient.
- Note
- You cannot remove the first and the last cursor of the color gradient.
At least the color gradient must have 2 cursors.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Index of the cursor is invalid
|
◆ GetColorFromValue
Array SColorGradient::GetColorFromValue |
( |
Number |
value | ) |
|
|
slot |
To color from a specific value in the gradient.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Index of the cursor is invalid
|
Array.Red | The undefined red color between [0-1] |
Array.Green | The undefined green color between [0-1] |
Array.Blue | The undefined blue color between [0-1] |
◆ GetColUndefined
Array SColorGradient::GetColUndefined |
( |
| ) |
|
|
slot |
To get the undefined color of the color gradient.
- Return values
-
Array.Red | The undefined red color between [0-1] |
Array.Green | The undefined green color between [0-1] |
Array.Blue | The undefined blue color between [0-1] |
◆ GetCursorInfo
Array SColorGradient::GetCursorInfo |
( |
Number |
Index | ) |
|
|
slot |
To get cursor information.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Index of the cursor is invalid
|
Array.RedBefore | The red color before the cursor between [0-1]. |
Array.GreenBefore | The green color before the cursor between [0-1]. |
Array.BlueBefore | The blue color before the cursor between [0-1]. |
Array.RedAfter | The red color after the cursor between [0-1]. |
Array.GreenAfter | The green color after the cursor between [0-1]. |
Array.BlueAfter | The blue color after the cursor between [0-1]. |
Array.Position | The position of the cursor. |
◆ GetNbCursor
Number SColorGradient::GetNbCursor |
( |
| ) |
|
|
slot |
- Return values
-
Number | of cursor of the color gradient |
◆ GetNbCursorMax
Number SColorGradient::GetNbCursorMax |
( |
| ) |
|
|
slot |
- Return values
-
Number | maximal of cursor you can have in this color gradient |
◆ GetRange
Array SColorGradient::GetRange |
( |
| ) |
|
|
slot |
To get the maximal and minimal value of the color gradient.
- Return values
-
Array.Max | Maximal value. |
Array.Min | Minimal value. |
◆ SetColAfter
Array SColorGradient::SetColAfter |
( |
Number |
Index, |
|
|
Number |
Red, |
|
|
Number |
Green, |
|
|
Number |
Blue, |
|
|
Number |
Alpha = -1 |
|
) |
| |
|
slot |
To set the color of a cursor after the value of the cursor.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Index of the cursor is invalid
|
- Parameters
-
[in] | Index | index of the cursor between 0 and the number of cursor |
[in] | Red | Red color between [0-1] |
[in] | Green | Green color between [0-1] |
[in] | Blue | Blue color between [0-1] |
[in] | Alpha | Alpha value [0-1]. If < 0, do not change the current alpha |
◆ SetColBefore
Array SColorGradient::SetColBefore |
( |
Number |
Index, |
|
|
Number |
Red, |
|
|
Number |
Green, |
|
|
Number |
Blue, |
|
|
Number |
Alpha = -1 |
|
) |
| |
|
slot |
To set the color of a cursor before the value of the cursor.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Index of the cursor is invalid
|
- Parameters
-
[in] | Index | index of the cursor between 0 and the number of cursor |
[in] | Red | Red color between [0-1] |
[in] | Green | Green color between [0-1] |
[in] | Blue | Blue color between [0-1] |
[in] | Alpha | Alpha value [0-1]. If < 0, do not change the current alpha |
◆ SetColUndefined
SColorGradient::SetColUndefined |
( |
Number |
Red, |
|
|
Number |
Green, |
|
|
Number |
Blue, |
|
|
Number |
Alpha = -1 |
|
) |
| |
|
slot |
To set the undefined color of the color gradient.
- Parameters
-
[in] | Red | Red color between [0-1] |
[in] | Green | Green color between [0-1] |
[in] | Blue | Blue color between [0-1] |
[in] | Alpha | Alpha value [0-1]. If < 0, do not change the current alpha |
◆ SetCursorPos
Array SColorGradient::SetCursorPos |
( |
Number |
Index, |
|
|
Number |
Position |
|
) |
| |
|
slot |
To set position of an indexed peg.
- Note
- Range can be update if position is upper.
- Warning
- Cursor order is sorted each time you change position. It will set cursor with maximal value first, and cursor with minimal value as the last.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 Index of the cursor is invalid
|
◆ SetDisplayOption
SColorGradient::SetDisplayOption |
( |
DisplayFlag |
DisplayPalette | ) |
|
|
slot |
You can choose how the palette will be displayed.
- Note
- SetRepresentationType(SCloud.INSPECTION); can be necessary
◆ SetInterpolation
To define how the color is interpolated between 2 cursors.
◆ SetMagnification
SColorGradient::SetMagnification |
( |
Number |
magnification | ) |
|
|
slot |
You can set the magnification (only for polyline inspection)
- Parameters
-
magnification | greater than 0 |
◆ SetNbCursor
Array SColorGradient::SetNbCursor |
( |
Number |
NbCursor | ) |
|
|
slot |
To set the number of cursors of the color gradient
You can set from 2 cursors to GetNbCursorMax() cursors, each of the band will have a unique color.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 The number of cursor is invalid
|
- Parameters
-
◆ SetRange
Array SColorGradient::SetRange |
( |
Number |
MinValue, |
|
|
Number |
MaxValue |
|
) |
| |
|
slot |
To update the min and max values of the color gradient, and delete all invalid pegs.
- Return values
-
Array.ErrorCode | The error code.
- 0 OK, no error
- 1 the min value is upper than the max value, nothing is done
- 2 an error occurred or the gradient is not valid
|
- Parameters
-
MinValue | the minimal value of the color gradient |
MaxValue | the maximal value of the color gradient |
◆ toString
String SColorGradient::toString |
( |
| ) |
|
|
slot |
Get the type of the variable.