2.2.4.17.32 GraphLayer::ReorderPlotsReorderPlots
Description
Reorder plots in a specific group or all plots in GraphLayer.
Syntax
int GraphLayer::ReorderPlots(const vector<uint>& vnIndices, int c1 = 0, BOOL bUndo = FALSE);
Parameters
- vnIndices
- [input] The indexes of all the plots in the layer or a specific group to be reordered.
- The sequence of the indexes determines how to reorder the plots.
- c1
- [input] The beginning index (counting from 0) of the group you want to reorder.
- If you want to reorder all plots, just ignore it.
- undo
- [input] FALSE as default value. Set true to enable undo block.
Return
-1 if vnIndices does not exist
-2 if the size of vnIndices plus c1 is larger than the total number of plots
-3 if try to reorder a sub part of a group. Maybe you should do UngroupPlots firstly.
0 if success, or the size of vnIndices is zero
Examples
EX1
//reorder all plots
// you will need to have a graph which has exactly 4 plots to use this code
void test_ReorderPlots()
{
GraphLayer gl = Project.ActiveLayer();//gl is the active layer
vector<uint> vecUI = {1,0,3,2};//vecUI contains the reorder sequence counting from 0
int nRet = gl.ReorderPlots(vecUI);
printf("%d",nRet);
}
EX2
//reorder a specific group in graph whose indexes starting from 2
// you will need to have a graph which has at least 2 group of plots to use this code
void test_ReorderPlots()
{
GraphLayer gl = Project.ActiveLayer();//gl is the active layer
vector<uint> vecUI = {1,0};//the group contains exactly 2 plots
int nRet = gl.ReorderPlots(vecUI,2);
printf("%d",nRet);
}
Remark
See Also
Header to Include
origin.h
|