本文整理汇总了C++中IString::ToInteger方法的典型用法代码示例。如果您正苦于以下问题:C++ IString::ToInteger方法的具体用法?C++ IString::ToInteger怎么用?C++ IString::ToInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IString
的用法示例。
在下文中一共展示了IString::ToInteger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addCubeViewport
/**
* Add a cubeViewport to the workspace, open the cube.
*
* @param cubename[in] (QString) cube name
*
* @internal
* @history 2006-06-12 Tracie Sucharski, Clear errors after catching when
* attempting to open cube.
* @history 2007-02-13 Tracie Sucharski, Open cube read, not read/write.
* Opening read/write was done to accomodate the
* EditTool. EditTool will now reopen the cube
* read/write.
* @history 2008-05-27 Noah Hilt, When opening a cube now if a
* user specifies extra arguments to the cube name,
* the cube will be opened using a CubeAttributeInput
* specifically for the number and index of bands to
* be opened. Additionally, if a cube is opened with 3
* bands it will be opened in RGB mode with red,
* green, and blue set to the 3 bands respectively.
* @history 2008-12-04 Jeannie Walldren - Removed "delete cube"
* since this was causing a segfault and this
* deallocation is already taking place in
* addCubeViewport(cube).
*
*/
void Workspace::addCubeViewport(QString cubename) {
Cube *cube = new Cube;
//Read in the CubeAttribueInput from the cube name
CubeAttributeInput inAtt(cubename);
std::vector<QString> bands = inAtt.bands();
//Set the virtual bands to the bands specified by the input
cube->setVirtualBands(bands);
cube->open(cubename);
MdiCubeViewport *cvp = addCubeViewport(cube);
// Check for RGB format (#R,#G,#B)
if(bands.size() == 3) {
IString st = IString(bands.at(0));
int index_red = st.ToInteger();
st = IString(bands.at(1));
int index_green = st.ToInteger();
st = IString(bands.at(2));
int index_blue = st.ToInteger();
cvp->viewRGB(index_red, index_green, index_blue);
}
}